javax.sound.midi

Interface MidiDevice

public interface MidiDevice

Interface for all MIDI devices.

Since: 1.3

Nested Class Summary
static classMidiDevice.Info
A MIDI device descriptor object.
Method Summary
voidclose()
Close this MIDI device, and release any system resources we're using.
MidiDevice.InfogetDeviceInfo()
Get the Info object describing this device.
intgetMaxReceivers()
The maximum number of MIDI IN connections we can get as Receivers, or -1 if there is no maximum.
intgetMaxTransmitters()
The maximum number of MIDI OUT connections we can get as Transmitters, or -1 if there is no maximum.
longgetMicrosecondPosition()
If this device supports time-stamps, then it will return the number of microseconds since this device has been open, and -1 otherwise.
ReceivergetReceiver()
Get a MIDI IN Receiver for this device.
TransmittergetTransmitter()
Get a MIDI OUT Transmitter for this device.
booleanisOpen()
Returns true if this MIDI device is open and false otherwise.
voidopen()
Open this MIDI device and allocate any system resource we need.

Method Detail

close

public void close()
Close this MIDI device, and release any system resources we're using.

getDeviceInfo

public MidiDevice.Info getDeviceInfo()
Get the Info object describing this device.

Returns: the Info object describing this device

getMaxReceivers

public int getMaxReceivers()
The maximum number of MIDI IN connections we can get as Receivers, or -1 if there is no maximum.

Returns: -1 or the maximum number of Receivers we can get

getMaxTransmitters

public int getMaxTransmitters()
The maximum number of MIDI OUT connections we can get as Transmitters, or -1 if there is no maximum.

Returns: -1 or the maximum number of Transmitters we can get

getMicrosecondPosition

public long getMicrosecondPosition()
If this device supports time-stamps, then it will return the number of microseconds since this device has been open, and -1 otherwise.

Returns: -1 or the number of microseconds since this was opened

getReceiver

public Receiver getReceiver()
Get a MIDI IN Receiver for this device.

Returns: a MIDI IN Receiver for this device

Throws: MidiUnavailableException if we can't get a Receiver

getTransmitter

public Transmitter getTransmitter()
Get a MIDI OUT Transmitter for this device.

Returns: a MIDI OUT Transmitter for this device

Throws: MidiUnavailableException if we can't get a Transmitter

isOpen

public boolean isOpen()
Returns true if this MIDI device is open and false otherwise.

Returns: true if this is open, false otherwise

open

public void open()
Open this MIDI device and allocate any system resource we need.

Throws: MidiUnavailableException if we're not able to open for some reason