--- jlscp/trunk/src/org/linuxsampler/lscp/MidiInputDevice.java 2005/10/02 14:40:52 783 +++ jlscp/trunk/src/org/linuxsampler/lscp/MidiInputDevice.java 2005/10/10 14:55:44 784 @@ -22,12 +22,47 @@ package org.linuxsampler.lscp; + /** * Provides information about the current settings of a specific MIDI input device. * @author Grigor Iliev */ public class MidiInputDevice extends AbstractDevice { + private MidiPort[] midiPorts = new MidiPort[0]; + /** Creates a new instance of MidiInputDevice */ public MidiInputDevice() { } + + /** + * Gets the current non-null list of MIDI ports this device offers. + * @return A MidiPort array providing all MIDI ports this device offers. + */ + public MidiPort[] + getMidiPorts() { return midiPorts; } + + /** + * Sets the current list of MIDI ports. + * @param ports The new list of MIDI ports. + * @throws IllegalArgumentException If ports is null. + */ + public void + setMidiPorts(MidiPort[] ports) { + if(ports == null) throw new IllegalArgumentException("ports must be non null"); + midiPorts = ports; + } + + /** + * Gets the MIDI port at the specified index. + * @param index The index of the MIDI port to be retrieved. + */ + public MidiPort + getMidiPort(int index) { return midiPorts[index]; } + + /** + * Gets the current number of MIDI ports this device offers. + * @return The current number of MIDI ports this device offers. + */ + public int + getMidiPortCount() { return midiPorts.length; } }