javax.sound.midi
Interface MidiDevice

All Known Subinterfaces:
Sequencer, Synthesizer

public interface MidiDevice

Interface for all MIDI devices.

Since:
1.3

Nested Class Summary
static class MidiDevice.Info
          A MIDI device descriptor object.
 
Method Summary
 void close()
          Close this MIDI device, and release any system resources we're using.
 MidiDevice.Info getDeviceInfo()
          Get the Info object describing this device.
 int getMaxReceivers()
          The maximum number of MIDI IN connections we can get as Receivers, or -1 if there is no maximum.
 int getMaxTransmitters()
          The maximum number of MIDI OUT connections we can get as Transmitters, or -1 if there is no maximum.
 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.
 Receiver getReceiver()
          Get a MIDI IN Receiver for this device.
 Transmitter getTransmitter()
          Get a MIDI OUT Transmitter for this device.
 boolean isOpen()
          Returns true if this MIDI device is open and false otherwise.
 void open()
          Open this MIDI device and allocate any system resource we need.
 

Method Detail

getDeviceInfo

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

Returns:
the Info object describing this device

open

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

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

close

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


isOpen

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

Returns:
true if this is open, false otherwise

getMicrosecondPosition

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

getMaxReceivers

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

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

getReceiver

Receiver getReceiver()
                     throws MidiUnavailableException
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

Transmitter getTransmitter()
                           throws MidiUnavailableException
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