1. /*
  2. * @(#)Receiver.java 1.19 03/01/27
  3. *
  4. * Copyright 2003 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>Receiver</code> receives <code>{@link MidiEvent}</code> objects and
  10. * typically does something useful in response, such as interpreting them to
  11. * generate sound or raw MIDI output. Common MIDI receivers include
  12. * synthesizers and MIDI Out ports.
  13. *
  14. * @see MidiDevice
  15. * @see Synthesizer
  16. * @see Transmitter
  17. *
  18. * @version 1.19, 03/01/27
  19. * @author Kara Kytle
  20. */
  21. public interface Receiver {
  22. //$$fb 2002-04-12: fix for 4662090: Contradiction in Receiver specification
  23. /**
  24. * Sends a MIDI message and time-stamp to this receiver.
  25. * If time-stamping is not supported by this receiver, the time-stamp
  26. * value should be -1.
  27. * @param message the MIDI message to send
  28. * @param timeStamp the time-stamp for the message, in microseconds.
  29. * @throws IllegalStateException if the receiver is closed
  30. */
  31. public void send(MidiMessage message, long timeStamp);
  32. /**
  33. * Indicates that the application has finished using the receiver, and
  34. * that limited resources it requires may be released or made available.
  35. * Invoking methods on a receiver which has been closed may cause an
  36. * <code>IllegalArgumentException</code> or other exception to be thrown.
  37. */
  38. public void close();
  39. }