KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > sound > midi > Transmitter


1 /*
2  * @(#)Transmitter.java 1.22 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.sound.midi;
9
10
11 /**
12  * A <code>Transmitter</code> sends <code>{@link MidiEvent}</code> objects to one or more
13  * <code>{@link Receiver Receivers}</code>. Common MIDI transmitters include sequencers
14  * and MIDI input ports.
15  *
16  * @see Receiver
17  *
18  * @version 1.22, 03/12/19
19  * @author Kara Kytle
20  */

21 public interface Transmitter {
22
23
24     /**
25      * Sets the receiver to which this transmitter will deliver MIDI messages.
26      * If a receiver is currently set, it is replaced with this one.
27      * @param receiver the desired receiver.
28      */

29     public void setReceiver(Receiver JavaDoc receiver);
30
31
32     /**
33      * Obtains the current receiver to which this transmitter will deliver MIDI messages.
34      * @return the current receiver. If no receiver is currently set,
35      * returns <code>null</code>
36      */

37     public Receiver JavaDoc getReceiver();
38
39     
40     /**
41      * Indicates that the application has finished using the transmitter, and
42      * that limited resources it requires may be released or made available.
43      *
44      * <p>If the creation of this <code>Transmitter</code> resulted in
45      * implicitly opening the underlying device, the device is
46      * implicitly closed by this method. This is true unless the device is
47      * kept open by other <code>Receiver</code> or <code>Transmitter</code>
48      * instances that opened the device implicitly, and unless the device
49      * has been opened explicitly. If the device this
50      * <code>Transmitter</code> is retrieved from is closed explicitly
51      * by calling {@link MidiDevice#close MidiDevice.close}, the
52      * <code>Transmitter</code> is closed, too. For a detailed
53      * description of open/close behaviour see the class description
54      * of {@link javax.sound.midi.MidiDevice MidiDevice}.
55      *
56      * @see javax.sound.midi.MidiSystem#getTransmitter
57      */

58     public void close();
59 }
60
Popular Tags