Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/sound/midi/Receiver.java
38830 views
/*1* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.sound.midi;262728/**29* A <code>Receiver</code> receives <code>{@link MidiEvent}</code> objects and30* typically does something useful in response, such as interpreting them to31* generate sound or raw MIDI output. Common MIDI receivers include32* synthesizers and MIDI Out ports.33*34* @see MidiDevice35* @see Synthesizer36* @see Transmitter37*38* @author Kara Kytle39*/40public interface Receiver extends AutoCloseable {414243//$$fb 2002-04-12: fix for 4662090: Contradiction in Receiver specification44/**45* Sends a MIDI message and time-stamp to this receiver.46* If time-stamping is not supported by this receiver, the time-stamp47* value should be -1.48* @param message the MIDI message to send49* @param timeStamp the time-stamp for the message, in microseconds.50* @throws IllegalStateException if the receiver is closed51*/52public void send(MidiMessage message, long timeStamp);5354/**55* Indicates that the application has finished using the receiver, and56* that limited resources it requires may be released or made available.57*58* <p>If the creation of this <code>Receiver</code> resulted in59* implicitly opening the underlying device, the device is60* implicitly closed by this method. This is true unless the device is61* kept open by other <code>Receiver</code> or <code>Transmitter</code>62* instances that opened the device implicitly, and unless the device63* has been opened explicitly. If the device this64* <code>Receiver</code> is retrieved from is closed explicitly by65* calling {@link MidiDevice#close MidiDevice.close}, the66* <code>Receiver</code> is closed, too. For a detailed67* description of open/close behaviour see the class description68* of {@link javax.sound.midi.MidiDevice MidiDevice}.69*70* @see javax.sound.midi.MidiSystem#getReceiver71*/72public void close();73}747576