APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.media.sound

pack-priv final Class MidiInDevice

extends AbstractMidiDevice
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
javax.sound.midi.MidiUnavailableException, .Transmitter

MidiInDevice class representing functionality of MidiIn devices.
Authors
David Rivas, Kara Kytle, Florian Bomers

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
MidiInDevice.MidiInTransmitter

An own class to distinguish the class name from the transmitter of other devices.

Field Summary

Modifier and TypeField and Description
private volatile Thread
Inherited from com.sun.media.sound.AbstractMidiDevice:
id

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
callbackLongMessage(byte[] data, long timeStamp)

pack-priv void
callbackShortMessage(int packedMsg, long
time-stamp in microseconds
timeStamp
)

Callback from native code when a short MIDI event is received from hardware.

protected Transmitter
public long
protected boolean
hasTransmitters()

Overrides com.sun.media.sound.AbstractMidiDevice.hasTransmitters.

Returns if this device supports Transmitters.

protected synchronized void
protected synchronized void
private native void
nClose(long id)

private native void
nGetMessages(long id)

private native long
nGetTimeStamp(long id)

private native long
nOpen(int index)

private native void
nStart(long id)

private native void
nStop(long id)

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from com.sun.media.sound.AbstractMidiDevice:
closecloseInternalcreateReceiverdoClosefinalizegetDeviceInfogetIdgetMaxReceiversgetMaxTransmittersgetReceivergetReceiverReferenceCountinggetReceiversgetTransmittergetTransmitterListgetTransmitterReferenceCountinggetTransmittershasReceiversisOpenopen

Field Detail

midiInThreadback to summary
private volatile Thread midiInThread

Constructor Detail

MidiInDeviceback to summary
pack-priv MidiInDevice(AbstractMidiDeviceProvider.Info info)

Method Detail

callbackLongMessageback to summary
pack-priv void callbackLongMessage(byte[] data, long timeStamp)
callbackShortMessageback to summary
pack-priv void callbackShortMessage(int packedMsg, long timeStamp)

Callback from native code when a short MIDI event is received from hardware.

Parameters
timeStamp:long

time-stamp in microseconds

createTransmitterback to summary
protected Transmitter createTransmitter()

Overrides com.sun.media.sound.AbstractMidiDevice.createTransmitter.

Doc from com.sun.media.sound.AbstractMidiDevice.createTransmitter.

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.

Annotations
@Override
getMicrosecondPositionback to summary
public long getMicrosecondPosition()

Overrides com.sun.media.sound.AbstractMidiDevice.getMicrosecondPosition.

Implements javax.sound.midi.MidiDevice.getMicrosecondPosition.

Doc from com.sun.media.sound.AbstractMidiDevice.getMicrosecondPosition.

This implementation always returns -1. Devices that actually provide this should over-ride this method.

Annotations
@Override
hasTransmittersback to summary
protected boolean hasTransmitters()

Overrides com.sun.media.sound.AbstractMidiDevice.hasTransmitters.

Doc from com.sun.media.sound.AbstractMidiDevice.hasTransmitters.

Returns if this device supports Transmitters. Subclasses that use Transmitters should override this method to return true. They also should override createTransmitter().

Annotations
@Override
implCloseback to summary
protected synchronized void implClose()

Overrides com.sun.media.sound.AbstractMidiDevice.implClose.

Annotations
@Override
implOpenback to summary
protected synchronized void implOpen() throws MidiUnavailableException

Implements abstract com.sun.media.sound.AbstractMidiDevice.implOpen.

Annotations
@Override
nCloseback to summary
private native void nClose(long id)
nGetMessagesback to summary
private native void nGetMessages(long id)
nGetTimeStampback to summary
private native long nGetTimeStamp(long id)
nOpenback to summary
private native long nOpen(int index) throws MidiUnavailableException
nStartback to summary
private native void nStart(long id) throws MidiUnavailableException
nStopback to summary
private native void nStop(long id)
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
com.sun.media.sound back to summary

private final Class MidiInDevice.MidiInTransmitter

extends BasicTransmitter
Class Inheritance

An own class to distinguish the class name from the transmitter of other devices.

Field Summary

Inherited from com.sun.media.sound.AbstractMidiDevice.BasicTransmitter:
tlist

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from com.sun.media.sound.AbstractMidiDevice.BasicTransmitter:
closegetMidiDevicegetReceiversetReceiver

Constructor Detail

MidiInTransmitterback to summary
private MidiInTransmitter()