Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/sound/midi/Transmitter.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>Transmitter</code> sends <code>{@link MidiEvent}</code> objects to one or more30* <code>{@link Receiver Receivers}</code>. Common MIDI transmitters include sequencers31* and MIDI input ports.32*33* @see Receiver34*35* @author Kara Kytle36*/37public interface Transmitter extends AutoCloseable {383940/**41* Sets the receiver to which this transmitter will deliver MIDI messages.42* If a receiver is currently set, it is replaced with this one.43* @param receiver the desired receiver.44*/45public void setReceiver(Receiver receiver);464748/**49* Obtains the current receiver to which this transmitter will deliver MIDI messages.50* @return the current receiver. If no receiver is currently set,51* returns <code>null</code>52*/53public Receiver getReceiver();545556/**57* Indicates that the application has finished using the transmitter, and58* that limited resources it requires may be released or made available.59*60* <p>If the creation of this <code>Transmitter</code> resulted in61* implicitly opening the underlying device, the device is62* implicitly closed by this method. This is true unless the device is63* kept open by other <code>Receiver</code> or <code>Transmitter</code>64* instances that opened the device implicitly, and unless the device65* has been opened explicitly. If the device this66* <code>Transmitter</code> is retrieved from is closed explicitly67* by calling {@link MidiDevice#close MidiDevice.close}, the68* <code>Transmitter</code> is closed, too. For a detailed69* description of open/close behaviour see the class description70* of {@link javax.sound.midi.MidiDevice MidiDevice}.71*72* @see javax.sound.midi.MidiSystem#getTransmitter73*/74public void close();75}767778