Path: blob/master/src/java.desktop/share/classes/javax/sound/midi/Transmitter.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 Transmitter} sends {@link MidiEvent} objects to one or more29* {@link Receiver Receivers}. Common MIDI transmitters include sequencers and30* MIDI input ports.31*32* @author Kara Kytle33* @see Receiver34*/35public interface Transmitter extends AutoCloseable {3637/**38* Sets the receiver to which this transmitter will deliver MIDI messages.39* If a receiver is currently set, it is replaced with this one.40*41* @param receiver the desired receiver42*/43void setReceiver(Receiver receiver);4445/**46* Obtains the current receiver to which this transmitter will deliver MIDI47* messages.48*49* @return the current receiver. If no receiver is currently set, returns50* {@code null}.51*/52Receiver getReceiver();5354/**55* Indicates that the application has finished using the transmitter, and56* that limited resources it requires may be released or made available.57* <p>58* If the creation of this {@code Transmitter} resulted in implicitly59* opening the underlying device, the device is implicitly closed by this60* method. This is true unless the device is kept open by other61* {@code Receiver} or {@code Transmitter} instances that opened the device62* implicitly, and unless the device has been opened explicitly. If the63* device this {@code Transmitter} is retrieved from is closed explicitly by64* calling {@link MidiDevice#close MidiDevice.close}, the65* {@code Transmitter} is closed, too. For a detailed description of66* open/close behaviour see the class description of67* {@link MidiDevice MidiDevice}.68*69* @see MidiSystem#getTransmitter70*/71@Override72void close();73}747576