| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract class | AbstractMidiDevice.
Base class for Receivers. |
| pack-priv class | AbstractMidiDevice.
Transmitter base class. |
| pack-priv class | AbstractMidiDevice.
a class to manage a list of transmitters. |
| Modifier and Type | Field and Description |
|---|---|
| protected volatile long | id
This is the device handle returned from native code. |
| private final MidiDevice. | |
| private volatile boolean | |
| private List | openKeepingObjects
List of Receivers and Transmitters that opened the device implicitly. |
| private int | |
| private ArrayList | |
| private AbstractMidiDevice. | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| protected | AbstractMidiDevice(MidiDevice.
the description of the device infoConstructs an AbstractMidiDevice with the specified info object. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | close()
Implements javax. Closes the device, indicating that the device should now release any system resources it is using. |
| public final void | closeInternal(Object
The object that might have been opening the device implicitly (for now,
this may be a Transmitter or receiver). object)Close the device for an object that implicitly opened it. |
| protected Receiver | |
| protected Transmitter | |
| public final void | |
| private void | |
| protected final void | finalize()
Overrides java. close this device if discarded by the garbage collector. |
| public final MidiDevice. | getDeviceInfo()
Implements javax. Obtains information about the device, including its Java class and
|
| pack-priv final long | |
| public final int | getMaxReceivers()
Implements javax. Return the maximum number of Receivers supported by this device. |
| public final int | getMaxTransmitters()
Implements javax. Return the maximum number of Transmitters supported by this device. |
| public long | getMicrosecondPosition()
Implements javax. This implementation always returns -1. |
| private synchronized List | |
| public final Receiver | getReceiver()
Implements javax. Retrieve a Receiver for this device. |
| private List | |
| public final Receiver | getReceiverReferenceCounting()
Implements com. Retrieve a Receiver and open the device implicitly. |
| public final List | getReceivers()
Implements javax. Returns all currently active, non-closed receivers connected with this
|
| public final Transmitter | getTransmitter()
Implements javax. This implementation uses createTransmitter, which may throw an exception. |
| pack-priv final AbstractMidiDevice. | |
| public final Transmitter | getTransmitterReferenceCounting()
Implements com. Retrieve a Transmitter and open the device implicitly. |
| public final List | getTransmitters()
Implements javax. Returns all currently active, non-closed transmitters connected with this
|
| protected boolean | Returns: true, if the device supports Receivers, false otherwise.Returns if this device supports Receivers. |
| protected boolean | Returns: true, if the device supports Transmitters, false otherwise.Returns if this device supports Transmitters. |
| protected void | |
| protected abstract void | |
| public final boolean | |
| public final void | |
| private void |
| id | back to summary |
|---|---|
| protected volatile long id This is the device handle returned from native code. | |
| info | back to summary |
|---|---|
| private final MidiDevice. | |
| open | back to summary |
|---|---|
| private volatile boolean open | |
| openKeepingObjects | back to summary |
|---|---|
| private List<Object> openKeepingObjects List of Receivers and Transmitters that opened the device implicitly. | |
| openRefCount | back to summary |
|---|---|
| private int openRefCount | |
| receiverList | back to summary |
|---|---|
| private ArrayList<Receiver> receiverList | |
| transmitterList | back to summary |
|---|---|
| private AbstractMidiDevice. | |
| traRecLock | back to summary |
|---|---|
| private final Object traRecLock | |
| AbstractMidiDevice | back to summary |
|---|---|
| protected AbstractMidiDevice(MidiDevice. Constructs an AbstractMidiDevice with the specified info object.
| |
| close | back to summary |
|---|---|
| public final void close() Implements javax. Doc from javax. Closes the device, indicating that the device should now release any system resources it is using.
All
| |
| closeInternal | back to summary |
|---|---|
| public final void closeInternal(Object object) Close the device for an object that implicitly opened it. This method is intended to be used by Transmitter.close() and Receiver.close(). Those methods should pass this for the object parameter. Since Transmitters or Receivers do not know if their device has been opened implicitly because of them, they call this method in any case. This method now is able to separate Receivers/Transmitters that opened the device implicitly from those that didn't by looking up the R/T in the openKeepingObjects list. Only if the R/T is contained there, the reference count is reduced.
| |
| createReceiver | back to summary |
|---|---|
| protected Receiver createReceiver() throws MidiUnavailableException Create a Receiver object. throwing an exception here means that Receivers aren't enabled. Subclasses that use Receivers should override this method with one that returns objects implementing Receiver. Classes overriding this method should also override hasReceivers() to return true. | |
| createTransmitter | back to summary |
|---|---|
| protected Transmitter createTransmitter() throws MidiUnavailableException Create a Transmitter object. throwing an exception here means that Transmitters aren't enabled. Subclasses that use Transmitters should override this method with one that returns objects implementing Transmitters. Classes overriding this method should also override hasTransmitters() to return true. | |
| doClose | back to summary |
|---|---|
| public final void doClose() | |
| doOpen | back to summary |
|---|---|
| private void doOpen() throws MidiUnavailableException | |
| finalize | back to summary |
|---|---|
| protected final void finalize() Overrides java. close this device if discarded by the garbage collector.
| |
| getDeviceInfo | back to summary |
|---|---|
| public final MidiDevice. Implements javax. Doc from javax. Obtains information about the device, including its Java class and
| |
| getId | back to summary |
|---|---|
| pack-priv final long getId() | |
| getMaxReceivers | back to summary |
|---|---|
| public final int getMaxReceivers() Implements javax. Return the maximum number of Receivers supported by this device. Depending on the return value of hasReceivers(), this method returns either 0 or -1. Subclasses should rather override hasReceivers() than override this method.
| |
| getMaxTransmitters | back to summary |
|---|---|
| public final int getMaxTransmitters() Implements javax. Return the maximum number of Transmitters supported by this device. Depending on the return value of hasTransmitters(), this method returns either 0 or -1. Subclasses should override hasTransmitters().
| |
| getMicrosecondPosition | back to summary |
|---|---|
| public long getMicrosecondPosition() Implements javax. This implementation always returns -1. Devices that actually provide this should over-ride this method.
| |
| getOpenKeepingObjects | back to summary |
|---|---|
| private synchronized List Return the list of objects that have opened the device implicitly. | |
| getReceiver | back to summary |
|---|---|
| public final Receiver getReceiver() throws MidiUnavailableException Implements javax. Retrieve a Receiver for this device. This method returns the value returned by createReceiver(), if it doesn't throw an exception. Subclasses should rather override createReceiver() than override this method. If createReceiver returns a Receiver, it is added to the internal list of Receivers (see getReceiversList)
| |
| getReceiverList | back to summary |
|---|---|
| private List Return the internal list of Receivers, possibly creating it first. | |
| getReceiverReferenceCounting | back to summary |
|---|---|
| public final Receiver getReceiverReferenceCounting() throws MidiUnavailableException Implements com. Retrieve a Receiver and open the device implicitly. This method is called by MidiSystem.getReceiver().
| |
| getReceivers | back to summary |
|---|---|
| public final List Implements javax. Doc from javax. Returns all currently active, non-closed receivers connected with this
Usually the returned receivers implement the
| |
| getTransmitter | back to summary |
|---|---|
| public final Transmitter getTransmitter() throws MidiUnavailableException Implements javax. This implementation uses createTransmitter, which may throw an exception. If a transmitter is returned in createTransmitter, it is added to the internal TransmitterList
| |
| getTransmitterList | back to summary |
|---|---|
| pack-priv final AbstractMidiDevice. Return the internal list of Transmitters, possibly creating it first. | |
| getTransmitterReferenceCounting | back to summary |
|---|---|
| public final Transmitter getTransmitterReferenceCounting() throws MidiUnavailableException Implements com. Retrieve a Transmitter and open the device implicitly. This method is called by MidiSystem.getTransmitter().
| |
| getTransmitters | back to summary |
|---|---|
| public final List Implements javax. Doc from javax. Returns all currently active, non-closed transmitters connected with this
Usually the returned transmitters implement the
| |
| hasReceivers | back to summary |
|---|---|
| protected boolean hasReceivers() Returns if this device supports Receivers. Subclasses that use Receivers should override this method to return true. They also should override createReceiver().
| |
| hasTransmitters | back to summary |
|---|---|
| protected boolean hasTransmitters() Returns if this device supports Transmitters. Subclasses that use Transmitters should override this method to return true. They also should override createTransmitter().
| |
| implClose | back to summary |
|---|---|
| protected void implClose() | |
| implOpen | back to summary |
|---|---|
| protected abstract void implOpen() throws MidiUnavailableException | |
| isOpen | back to summary |
|---|---|
| public final boolean isOpen() Implements javax. Doc from javax. Reports whether the device is open.
| |
| open | back to summary |
|---|---|
| public final void open() throws MidiUnavailableException Implements javax. Open the device from an application program. Setting the open reference count to -1 here prevents Transmitters and Receivers that opened the device implicitly from closing it. The only way to close the device after this call is a call to close().
| |
| openInternal | back to summary |
|---|---|
| private void openInternal(Object object) throws MidiUnavailableException Open the device implicitly. This method is intended to be used by AbstractReceiver and BasicTransmitter. Actually, it is called by getReceiverReferenceCounting() and getTransmitterReferenceCounting(). These, in turn, are called by MidiSytem on calls to getReceiver() and getTransmitter(). The former methods should pass the Receiver or Transmitter just created as the object parameter to this method. Storing references to these objects is necessary to be able to decide later (when it comes to closing) if R/T's are ones that opened the device implicitly. | |
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final MidiDevice | getMidiDevice()
Implements javax. Obtains a |
| pack-priv abstract void | |
| pack-priv final boolean | |
| public final synchronized void | send(final MidiMessage message, final long timeStamp)
Implements javax. Deliver a MidiMessage. |
| open | back to summary |
|---|---|
| private volatile boolean open | |
| AbstractReceiver | back to summary |
|---|---|
| pack-priv AbstractReceiver() | |
| close | back to summary |
|---|---|
| public final void close() Implements javax. Close the Receiver. Here, the call to the magic method closeInternal() takes place. Therefore, subclasses that override this method must call 'super.close()'.
| |
| getMidiDevice | back to summary |
|---|---|
| public final MidiDevice getMidiDevice() Implements javax. Doc from javax. Obtains a
| |
| implSend | back to summary |
|---|---|
| pack-priv abstract void implSend(MidiMessage message, long timeStamp) | |
| isOpen | back to summary |
|---|---|
| pack-priv final boolean isOpen() | |
| send | back to summary |
|---|---|
| public final synchronized void send(final MidiMessage message, final long timeStamp) Implements javax. Deliver a MidiMessage. This method contains magic related to the closed state of a Receiver. Therefore, subclasses should not override this method. Instead, they should implement implSend().
| |
| Modifier and Type | Field and Description |
|---|---|
| private Receiver | |
| pack-priv AbstractMidiDevice. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final MidiDevice | getMidiDevice()
Implements javax. Obtains a |
| public final Receiver | getReceiver()
Implements javax. Obtains the current receiver to which this transmitter will deliver MIDI messages. |
| public final void | setReceiver(Receiver receiver)
Implements javax. Sets the receiver to which this transmitter will deliver MIDI messages. |
| private void |
| receiver | back to summary |
|---|---|
| private Receiver receiver | |
| tlist | back to summary |
|---|---|
| pack-priv AbstractMidiDevice. | |
| BasicTransmitter | back to summary |
|---|---|
| protected BasicTransmitter() | |
| close | back to summary |
|---|---|
| public final void close() Implements javax. Close the Transmitter. Here, the call to the magic method closeInternal() takes place. Therefore, subclasses that override this method must call 'super.close()'.
| |
| getMidiDevice | back to summary |
|---|---|
| public final MidiDevice getMidiDevice() Implements javax. Doc from javax. Obtains a
| |
| getReceiver | back to summary |
|---|---|
| public final Receiver getReceiver() Implements javax. Doc from javax. Obtains the current receiver to which this transmitter will deliver MIDI messages.
| |
| setReceiver | back to summary |
|---|---|
| public final void setReceiver(Receiver receiver) Implements javax. Doc from javax. Sets the receiver to which this transmitter will deliver MIDI messages. If a receiver is currently set, it is replaced with this one.
| |
| setTransmitterList | back to summary |
|---|---|
| private void setTransmitterList(AbstractMidiDevice. | |
| Modifier and Type | Field and Description |
|---|---|
| private MidiOutDevice. | |
| private int | |
| private final ArrayList |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| pack-priv void | |
| private void | |
| private void | |
| pack-priv void | sendMessage(int packedMessage, long timeStamp)
Send this message to all receivers status = packedMessage & 0xFF data1 = (packedMessage & 0xFF00) >> 8; data1 = (packedMessage & 0xFF0000) >> 16; |
| pack-priv void | |
| pack-priv void |
| midiOutReceiver | back to summary |
|---|---|
| private MidiOutDevice. | |
| optimizedReceiverCount | back to summary |
|---|---|
| private int optimizedReceiverCount | |
| transmitters | back to summary |
|---|---|
| private final ArrayList<Transmitter> transmitters | |
| TransmitterList | back to summary |
|---|---|
| pack-priv TransmitterList() | |
| add | back to summary |
|---|---|
| private void add(Transmitter t) | |
| close | back to summary |
|---|---|
| pack-priv void close() closes all transmitters and empties the list | |
| receiverChanged | back to summary |
|---|---|
| private void receiverChanged(AbstractMidiDevice. | |
| remove | back to summary |
|---|---|
| private void remove(Transmitter t) | |
| sendMessage | back to summary |
|---|---|
| pack-priv void sendMessage(int packedMessage, long timeStamp) Send this message to all receivers status = packedMessage & 0xFF data1 = (packedMessage & 0xFF00) >> 8; data1 = (packedMessage & 0xFF0000) >> 16; | |
| sendMessage | back to summary |
|---|---|
| pack-priv void sendMessage(byte[] data, long timeStamp) | |
| sendMessage | back to summary |
|---|---|
| pack-priv void sendMessage(MidiMessage message, long timeStamp) Send this message to all transmitters. | |