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. package javax.sound.midi;
  8. /**
  9. * A <code>Transmitter</code> sends <code>{@link MidiEvent}</code> objects to one or more
  10. * <code>{@link Receiver Receivers}</code>. Common MIDI transmitters include sequencers
  11. * and MIDI input ports.
  12. *
  13. * @see Receiver
  14. *
  15. * @version 1.22, 03/12/19
  16. * @author Kara Kytle
  17. */
  18. public interface Transmitter {
  19. /**
  20. * Sets the receiver to which this transmitter will deliver MIDI messages.
  21. * If a receiver is currently set, it is replaced with this one.
  22. * @param receiver the desired receiver.
  23. */
  24. public void setReceiver(Receiver receiver);
  25. /**
  26. * Obtains the current receiver to which this transmitter will deliver MIDI messages.
  27. * @return the current receiver. If no receiver is currently set,
  28. * returns <code>null</code>
  29. */
  30. public Receiver getReceiver();
  31. /**
  32. * Indicates that the application has finished using the transmitter, and
  33. * that limited resources it requires may be released or made available.
  34. *
  35. * <p>If the creation of this <code>Transmitter</code> resulted in
  36. * implicitly opening the underlying device, the device is
  37. * implicitly closed by this method. This is true unless the device is
  38. * kept open by other <code>Receiver</code> or <code>Transmitter</code>
  39. * instances that opened the device implicitly, and unless the device
  40. * has been opened explicitly. If the device this
  41. * <code>Transmitter</code> is retrieved from is closed explicitly
  42. * by calling {@link MidiDevice#close MidiDevice.close}, the
  43. * <code>Transmitter</code> is closed, too. For a detailed
  44. * description of open/close behaviour see the class description
  45. * of {@link javax.sound.midi.MidiDevice MidiDevice}.
  46. *
  47. * @see javax.sound.midi.MidiSystem#getTransmitter
  48. */
  49. public void close();
  50. }