src/share/classes/javax/sound/midi/Receiver.java

Print this page




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.sound.midi;
  27 
  28 
  29 /**
  30  * A <code>Receiver</code> receives <code>{@link MidiEvent}</code> objects and
  31  * typically does something useful in response, such as interpreting them to
  32  * generate sound or raw MIDI output.  Common MIDI receivers include
  33  * synthesizers and MIDI Out ports.
  34  *
  35  * @see MidiDevice
  36  * @see Synthesizer
  37  * @see Transmitter
  38  *
  39  * @author Kara Kytle
  40  */
  41 public interface Receiver {
  42 
  43 
  44     //$$fb 2002-04-12: fix for 4662090: Contradiction in Receiver specification
  45     /**
  46      * Sends a MIDI message and time-stamp to this receiver.
  47      * If time-stamping is not supported by this receiver, the time-stamp
  48      * value should be -1.
  49      * @param message the MIDI message to send
  50      * @param timeStamp the time-stamp for the message, in microseconds.
  51      * @throws IllegalStateException if the receiver is closed
  52      */
  53     public void send(MidiMessage message, long timeStamp);
  54 
  55     /**
  56      * Indicates that the application has finished using the receiver, and
  57      * that limited resources it requires may be released or made available.
  58      *
  59      * <p>If the creation of this <code>Receiver</code> resulted in
  60      * implicitly opening the underlying device, the device is
  61      * implicitly closed by this method. This is true unless the device is


  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.sound.midi;
  27 
  28 
  29 /**
  30  * A <code>Receiver</code> receives <code>{@link MidiEvent}</code> objects and
  31  * typically does something useful in response, such as interpreting them to
  32  * generate sound or raw MIDI output.  Common MIDI receivers include
  33  * synthesizers and MIDI Out ports.
  34  *
  35  * @see MidiDevice
  36  * @see Synthesizer
  37  * @see Transmitter
  38  *
  39  * @author Kara Kytle
  40  */
  41 public interface Receiver extends AutoCloseable {
  42 
  43 
  44     //$$fb 2002-04-12: fix for 4662090: Contradiction in Receiver specification
  45     /**
  46      * Sends a MIDI message and time-stamp to this receiver.
  47      * If time-stamping is not supported by this receiver, the time-stamp
  48      * value should be -1.
  49      * @param message the MIDI message to send
  50      * @param timeStamp the time-stamp for the message, in microseconds.
  51      * @throws IllegalStateException if the receiver is closed
  52      */
  53     public void send(MidiMessage message, long timeStamp);
  54 
  55     /**
  56      * Indicates that the application has finished using the receiver, and
  57      * that limited resources it requires may be released or made available.
  58      *
  59      * <p>If the creation of this <code>Receiver</code> resulted in
  60      * implicitly opening the underlying device, the device is
  61      * implicitly closed by this method. This is true unless the device is