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

public final Class MidiDeviceReceiverEnvelope

extends Object
implements MidiDeviceReceiver
Class Inheritance
All Implemented Interfaces
javax.sound.midi.MidiDeviceReceiver, javax.sound.midi.Receiver, java.lang.AutoCloseable
Imports
javax.sound.midi.MidiDevice, .MidiDeviceReceiver, .MidiMessage, .Receiver

Helper class which allows to convert Receiver to MidiDeviceReceiver.
Author
Alex Menkov

Field Summary

Modifier and TypeField and Description
private final MidiDevice
private final Receiver

Constructor Summary

AccessConstructor and Description
public
MidiDeviceReceiverEnvelope(MidiDevice
the owner MidiDevice
device
,
Receiver
the Receiver to be enveloped
receiver
)

Creates a new MidiDeviceReceiverEnvelope object which envelops the specified Receiver and is owned by the specified MidiDevice.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements javax.sound.midi.Receiver.close.

Indicates that the application has finished using the receiver, and that limited resources it requires may be released or made available.

public MidiDevice
getMidiDevice()

Implements javax.sound.midi.MidiDeviceReceiver.getMidiDevice.

Obtains a MidiDevice object which is an owner of this Receiver.

public Receiver

Returns:

the enveloped receiver
getReceiver
()

Obtains the receiver enveloped by this MidiDeviceReceiverEnvelope object.

public void
send(MidiMessage message, long timeStamp)

Implements javax.sound.midi.Receiver.send.

Sends a MIDI message and time-stamp to this receiver.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deviceback to summary
private final MidiDevice device
receiverback to summary
private final Receiver receiver

Constructor Detail

MidiDeviceReceiverEnvelopeback to summary
public MidiDeviceReceiverEnvelope(MidiDevice device, Receiver receiver)

Creates a new MidiDeviceReceiverEnvelope object which envelops the specified Receiver and is owned by the specified MidiDevice.

Parameters
device:MidiDevice

the owner MidiDevice

receiver:Receiver

the Receiver to be enveloped

Method Detail

closeback to summary
public void close()

Implements javax.sound.midi.Receiver.close.

Doc from javax.sound.midi.Receiver.close.

Indicates that the application has finished using the receiver, and that limited resources it requires may be released or made available.

If the creation of this Receiver resulted in implicitly opening the underlying device, the device is implicitly closed by this method. This is true unless the device is kept open by other Receiver or Transmitter instances that opened the device implicitly, and unless the device has been opened explicitly. If the device this Receiver is retrieved from is closed explicitly by calling MidiDevice.close, the Receiver is closed, too. For a detailed description of open/close behaviour see the class description of MidiDevice.

Annotations
@Override
getMidiDeviceback to summary
public MidiDevice getMidiDevice()

Implements javax.sound.midi.MidiDeviceReceiver.getMidiDevice.

Doc from javax.sound.midi.MidiDeviceReceiver.getMidiDevice.

Obtains a MidiDevice object which is an owner of this Receiver.

Annotations
@Override
getReceiverback to summary
public Receiver getReceiver()

Obtains the receiver enveloped by this MidiDeviceReceiverEnvelope object.

Returns:Receiver

the enveloped receiver

sendback to summary
public void send(MidiMessage message, long timeStamp)

Implements javax.sound.midi.Receiver.send.

Doc from javax.sound.midi.Receiver.send.

Sends a MIDI message and time-stamp to this receiver. If time-stamping is not supported by this receiver, the time-stamp value should be -1.

Annotations
@Override