Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4931387

RFE: Add methods to MidiDevice to get list of Transmitters and Receivers

XMLWordPrintable

    • b26
    • generic
    • generic

      Name: fb126949 Date: 10/01/2003


      the interface javax.sound.midi.MidiDevice provides methods for getting instances of Receiver and of Transmitter. Usually, each call to getReceiver() or getTransmitter() will return a new, open, instance of the respective interface. However, it is impossible to query the MidiDevice instance for the list of open Receivers/Transmitters. This would be very useful in order to be able to close some devices.

      In our opinion, such methods are simply missing in the API. It is also inconsistent with the javax.sound.sampled package, where the equivalent interface Mixer provides methods such as getSourceLines() to query all lines open to the Mixer instance.

      We propose the following new methods in MidiDevice:

      /**
       * Returns all currently active, non-closed transmitters
       * connected with this MidiDevice.
       * A transmitter can be removed
       * from the device by closing it.
       * @return an unmodifiable list of the open transmitters
       */
      List<Transmitter> getTransmitters();


      /**
       * Returns all currently active, non-closed receivers
       * connected with this MidiDevice.
       * A receiver can be removed
       * from the device by closing it.
       * @return an unmodifiable list of the open receivers
       */
      List<Receiver> getReceivers();

      There is no need for separate removeReceiver and removeTransmitter methods, since closing a Receiver/Transmitter will remove it automatically from the list.



      ======================================================================

            fbomerssunw Florian Bomers (Inactive)
            fbomerssunw Florian Bomers (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: