JDK-4931387 : RFE: Add methods to MidiDevice to get list of Transmitters and Receivers
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-10-02
  • Updated: 2017-05-16
  • Resolved: 2003-10-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b26Fixed
Description
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.



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

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b26 tiger-beta
14-06-2004

PUBLIC COMMENTS Add methods to MidiDevice to get list of Transmitters and Receivers
10-06-2004

EVALUATION ###@###.### 2003-10-02 Important inconsistency. Minor addition of 2 methods. Should be fixed in tiger.
02-10-2003