Path: blob/master/src/java.desktop/share/classes/javax/sound/midi/Receiver.java
41159 views
/*1* Copyright (c) 1999, 2017, 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;2627/**28* A {@code Receiver} receives {@link MidiEvent} objects and typically does29* something useful in response, such as interpreting them to generate sound or30* raw MIDI output. Common MIDI receivers include synthesizers and MIDI Out31* ports.32*33* @author Kara Kytle34* @see MidiDevice35* @see Synthesizer36* @see Transmitter37*/38public interface Receiver extends AutoCloseable {3940//$$fb 2002-04-12: fix for 4662090: Contradiction in Receiver specification4142/**43* Sends a MIDI message and time-stamp to this receiver. If time-stamping is44* not supported by this receiver, the time-stamp value should be -1.45*46* @param message the MIDI message to send47* @param timeStamp the time-stamp for the message, in microseconds48* @throws IllegalStateException if the receiver is closed49*/50void send(MidiMessage message, long timeStamp);5152/**53* Indicates that the application has finished using the receiver, and that54* limited resources it requires may be released or made available.55* <p>56* If the creation of this {@code Receiver} resulted in implicitly opening57* the underlying device, the device is implicitly closed by this method.58* This is true unless the device is kept open by other {@code Receiver} or59* {@code Transmitter} instances that opened the device implicitly, and60* unless the device has been opened explicitly. If the device this61* {@code Receiver} is retrieved from is closed explicitly by calling62* {@link MidiDevice#close MidiDevice.close}, the {@code Receiver} is63* closed, too. For a detailed description of open/close behaviour see the64* class description of {@link MidiDevice MidiDevice}.65*66* @see MidiSystem#getReceiver67*/68@Override69void close();70}717273