|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MidiDevice
is the base interface for all MIDI devices.
Common devices include synthesizers, sequencers, MIDI input ports, and MIDI
output ports. A MidiDevice
can be a transmitter or a receiver of MIDI events, or both. To this end, it
typically also implements the
or
Transmitter
interface (or both), or has access to objects that do.
Receiver
A MidiDevice
includes a
object
to provide manufacturer information and so on.
MidiDevice.Info
Synthesizer
,
Sequencer
,
MidiChannel.setMono(boolean)
Nested Class Summary | |
static class |
MidiDevice.Info
A MidiDevice.Info object contains assorted
data about a , including its
name, the company who created it, and descriptive text. |
Method Summary | |
void |
close()
Closes the device, indicating that the device should now release any system resources it is using. |
MidiDevice.Info |
getDeviceInfo()
Obtains information about the device, including its Java class and Strings containing its name, vendor, and description. |
int |
getMaxReceivers()
Obtains the maximum number of MIDI IN connections available on this MIDI device for receiving MIDI data. |
int |
getMaxTransmitters()
Obtains the maximum number of MIDI OUT connections available on this MIDI device for transmitting MIDI data. |
long |
getMicrosecondPosition()
Obtains the current time-stamp of the device, in microseconds. |
Receiver |
getReceiver()
Obtains a MIDI IN receiver through which the MIDI device may receive MIDI data. |
Transmitter |
getTransmitter()
Obtains a MIDI OUT connection from which the MIDI device will transmit MIDI data The returned transmitter must be closed when the application has finished using it. |
boolean |
isOpen()
Reports whether the device is open. |
void |
open()
Opens the device, indicating that it should now acquire any system resources it requires and become operational. |
Method Detail |
public MidiDevice.Info getDeviceInfo()
Strings
containing its name, vendor, and description.
public void open() throws MidiUnavailableException
Note that some devices, once closed, cannot be reopened. Attempts to reopen such a device will always result in a MidiUnavailableException.
MidiUnavailableException
- thrown if the device cannot be
opened due to resource restrictions.
SecurityException
- thrown if the device cannot be
opened due to security restrictions.close()
,
isOpen()
public void close()
open()
,
isOpen()
public boolean isOpen()
true
if the device is open, otherwise
false
close()
public long getMicrosecondPosition()
public int getMaxReceivers()
public int getMaxTransmitters()
public Receiver getReceiver() throws MidiUnavailableException
MidiUnavailableException
- thrown if a receiver is not available
due to resource restrictionsReceiver.close()
public Transmitter getTransmitter() throws MidiUnavailableException
MidiUnavailableException
- thrown if a transmitter is not available
due to resource restrictionsTransmitter.close()
|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.