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

DOC: clean up MidiDevice documentation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 5.0
    • 5.0
    • client-libs
    • b26
    • generic
    • generic

      The documentation of the class javax.sound.midi.MidiDevice contains at least one obsolete and confusing comment. This should be remove. Other issues should be explained more detailled.

      - (class description:) "To this end, it
       * typically also implements the <code>{@link Transmitter}</code> or
       * <code>{@link Receiver}</code> interface (or both), or has access to objects that do."
      MidiDevices do not implement the interfaces Transmitter and Receiver. The wording should be changed to something like this: "A <code>MidiDevice</code>
       * can be a transmitter or a receiver of MIDI events, or both. Therefore, it
       * can provide <code>{@link Transmitter}</code> or
       * <code>{@link Receiver}</code> instances (or both). Typically, MIDI IN ports provide Transmitters, MIDI OUT ports and Synthesizers provide Receivers. Sequencers typically provide Transmitters for playback and Receivers for recording."

      - for newcomers, it is not obvious how to detect if a MidiDevice represents a hardware MIDI port. The usual code snippet used for this (below) should be included in the documentation.
      ---
      MidiDevice device = ...;
      if ( ! (device instanceof Sequencer) && ! (device instanceof Synthesizer)) {
          // we're now sure that device represents a MIDI port
          // ...
      }
      ---

      - obsolete and commented out code (ThruTransmitter) should be removed.

      ###@###.### 2003-10-22
      Checked in Bug Fix

            kpsmith Kevin Smith (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: