|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.midi.MIDIInReceiver
This class is a Receiver implementation for being connected to the MIDI Input of a MIDIManager. When added MIDIListeners to an instance of this class, it will ask the MIDIManager to open the input device. When all listeners have been removed, it will ask the MIDIManager to clode the input device. For an instance of this class the status bytes of the types of MIDI messages to listen to can be set. Also for any MIDIListener added to this instance, the accepted message types can be set. But a MIDIListener will not be notified of messages the MIDIInReceiver doesn´t acccept, even if he supports them.
| Field Summary | |
|---|---|
private int[] |
acceptStatus
The status bytes of the messages to listen to |
private java.util.HashMap |
listeners
The MIDIListeners registered with this Receiver |
private MIDIManager |
midiManager
The MIDIManager to which this Receiver is connected |
| Constructor Summary | |
|---|---|
MIDIInReceiver(MIDIManager manager)
Construct a new MIDIReciever that listens to all types of MIDI messages on the specified MIDIManager |
|
MIDIInReceiver(MIDIManager manager,
int[] acceptStatus)
Construct a new MIDIReciever that listens to the specified types of MIDI messages on the specified MIDIManager |
|
| Method Summary | |
|---|---|
void |
addMIDIListener(MIDIListener l,
int[] acceptTypes)
Add a MIDIListener that listens to the specified types of messages |
protected static boolean |
checkStatus(int[] accepted,
int status)
Check, if given status accepted |
void |
close()
|
protected void |
finalize()
|
int[] |
getAcceptedStatus()
Get the MIDI message types accepted by this Receveiver |
void |
removeMIDIListener(MIDIListener l)
Remove the specified MIDIListener from the list of listeners. |
void |
send(javax.sound.midi.MidiMessage message,
long timestamp)
|
void |
setAcceptStatus(int[] status)
Set the MIDI message types accepted by this Receveiver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int[] acceptStatus
private java.util.HashMap listeners
private final MIDIManager midiManager
| Constructor Detail |
|---|
MIDIInReceiver(MIDIManager manager)
manager - The MIDIManager to use
MIDIInReceiver(MIDIManager manager,
int[] acceptStatus)
manager - The MIDIManager to useacceptStatus - Array of status bytes to accept. Can be any of
MetaMessage.META,
SysexMessage.SYSTEM_EXCLUSIVE,
SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE or
ShortMessage.*.
The array may also be null to indicate that all types of messages are
accepted.| Method Detail |
|---|
public void addMIDIListener(MIDIListener l,
int[] acceptTypes)
l - The MIDIListener to addacceptTypes - Array of status bytes this listener accepts. Can be
any of MetaMessage.META,
SysexMessage.SYSTEM_EXCLUSIVE,
SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE or
ShortMessage.*.
The array may also be null to indicate that all types of messages are
accepted.
protected static boolean checkStatus(int[] accepted,
int status)
accepted - Array of accepted status bytes or null to
indicate that all types of messages are acceptedstatus - The status byte to check for
null or if the given
status byte is contained inside the Array, false otherwisepublic void close()
close in interface javax.sound.midi.ReceiverReceiver.close()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.ThrowableObject.finalize()public int[] getAcceptedStatus()
null to
indicate that all types are acceptedpublic void removeMIDIListener(MIDIListener l)
l - The MIDIListener to remove
public void send(javax.sound.midi.MidiMessage message,
long timestamp)
send in interface javax.sound.midi.ReceiverReceiver.send(javax.sound.midi.MidiMessage, long)public void setAcceptStatus(int[] status)
status - Array of status bytes to accept or null to
indicate that all types are accepted
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||