< prev index next >

src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java

Print this page




  61  * standard MIDI file data or soundbanks. You can query the {@code MidiSystem}
  62  * for the format of a specified MIDI file.
  63  * <p>
  64  * You cannot instantiate a {@code MidiSystem}; all the methods are static.
  65  * <p>
  66  * Properties can be used to specify default MIDI devices. Both system
  67  * properties and a properties file are considered. The "sound.properties"
  68  * properties file is read from an implementation-specific location (typically
  69  * it is the {@code conf} directory in the Java installation directory). If a
  70  * property exists both as a system property and in the properties file, the
  71  * system property takes precedence. If none is specified, a suitable default is
  72  * chosen among the available devices. The syntax of the properties file is
  73  * specified in {@link Properties#load(InputStream) Properties.load}. The
  74  * following table lists the available property keys and which methods consider
  75  * them:
  76  *
  77  * <table class="striped">
  78  * <caption>MIDI System Property Keys</caption>
  79  * <thead>
  80  *   <tr>
  81  *     <th>Property Key
  82  *     <th>Interface
  83  *     <th>Affected Method
  84  * </thead>
  85  * <tbody>
  86  *   <tr>
  87  *     <td>{@code javax.sound.midi.Receiver}
  88  *     <td>{@link Receiver}
  89  *     <td>{@link #getReceiver}
  90  *   <tr>
  91  *     <td>{@code javax.sound.midi.Sequencer}
  92  *     <td>{@link Sequencer}
  93  *     <td>{@link #getSequencer}
  94  *   <tr>
  95  *     <td>{@code javax.sound.midi.Synthesizer}
  96  *     <td>{@link Synthesizer}
  97  *     <td>{@link #getSynthesizer}
  98  *   <tr>
  99  *     <td>{@code javax.sound.midi.Transmitter}
 100  *     <td>{@link Transmitter}
 101  *     <td>{@link #getTransmitter}
 102  * </tbody>
 103  * </table>
 104  *
 105  * The property value consists of the provider class name and the device name,
 106  * separated by the hash mark (&quot;#&quot;). The provider class name is the
 107  * fully-qualified name of a concrete
 108  * {@link MidiDeviceProvider MIDI device provider} class. The device name is
 109  * matched against the {@code String} returned by the {@code getName} method of
 110  * {@code MidiDevice.Info}. Either the class name, or the device name may be
 111  * omitted. If only the class name is specified, the trailing hash mark is
 112  * optional.
 113  * <p>
 114  * If the provider class is specified, and it can be successfully retrieved from
 115  * the installed providers, the list of {@code MidiDevice.Info} objects is
 116  * retrieved from the provider. Otherwise, or when these devices do not provide
 117  * a subsequent match, the list is retrieved from {@link #getMidiDeviceInfo} to
 118  * contain all available {@code MidiDevice.Info} objects.
 119  * <p>
 120  * If a device name is specified, the resulting list of {@code MidiDevice.Info}
 121  * objects is searched: the first one with a matching name, and whose
 122  * {@code MidiDevice} implements the respective interface, will be returned. If
 123  * no matching {@code MidiDevice.Info} object is found, or the device name is
 124  * not specified, the first suitable device from the resulting list will be
 125  * returned. For Sequencer and Synthesizer, a device is suitable if it
 126  * implements the respective interface; whereas for Receiver and Transmitter, a




  61  * standard MIDI file data or soundbanks. You can query the {@code MidiSystem}
  62  * for the format of a specified MIDI file.
  63  * <p>
  64  * You cannot instantiate a {@code MidiSystem}; all the methods are static.
  65  * <p>
  66  * Properties can be used to specify default MIDI devices. Both system
  67  * properties and a properties file are considered. The "sound.properties"
  68  * properties file is read from an implementation-specific location (typically
  69  * it is the {@code conf} directory in the Java installation directory). If a
  70  * property exists both as a system property and in the properties file, the
  71  * system property takes precedence. If none is specified, a suitable default is
  72  * chosen among the available devices. The syntax of the properties file is
  73  * specified in {@link Properties#load(InputStream) Properties.load}. The
  74  * following table lists the available property keys and which methods consider
  75  * them:
  76  *
  77  * <table class="striped">
  78  * <caption>MIDI System Property Keys</caption>
  79  * <thead>
  80  *   <tr>
  81  *     <th scope="col">Property Key
  82  *     <th scope="col">Interface
  83  *     <th scope="col">Affected Method
  84  * </thead>
  85  * <tbody>
  86  *   <tr>
  87  *     <th scope="row">{@code javax.sound.midi.Receiver}
  88  *     <td>{@link Receiver}
  89  *     <td>{@link #getReceiver}
  90  *   <tr>
  91  *     <th scope="row">{@code javax.sound.midi.Sequencer}
  92  *     <td>{@link Sequencer}
  93  *     <td>{@link #getSequencer}
  94  *   <tr>
  95  *     <th scope="row">{@code javax.sound.midi.Synthesizer}
  96  *     <td>{@link Synthesizer}
  97  *     <td>{@link #getSynthesizer}
  98  *   <tr>
  99  *     <th scope="row">{@code javax.sound.midi.Transmitter}
 100  *     <td>{@link Transmitter}
 101  *     <td>{@link #getTransmitter}
 102  * </tbody>
 103  * </table>
 104  *
 105  * The property value consists of the provider class name and the device name,
 106  * separated by the hash mark ("#"). The provider class name is the
 107  * fully-qualified name of a concrete
 108  * {@link MidiDeviceProvider MIDI device provider} class. The device name is
 109  * matched against the {@code String} returned by the {@code getName} method of
 110  * {@code MidiDevice.Info}. Either the class name, or the device name may be
 111  * omitted. If only the class name is specified, the trailing hash mark is
 112  * optional.
 113  * <p>
 114  * If the provider class is specified, and it can be successfully retrieved from
 115  * the installed providers, the list of {@code MidiDevice.Info} objects is
 116  * retrieved from the provider. Otherwise, or when these devices do not provide
 117  * a subsequent match, the list is retrieved from {@link #getMidiDeviceInfo} to
 118  * contain all available {@code MidiDevice.Info} objects.
 119  * <p>
 120  * If a device name is specified, the resulting list of {@code MidiDevice.Info}
 121  * objects is searched: the first one with a matching name, and whose
 122  * {@code MidiDevice} implements the respective interface, will be returned. If
 123  * no matching {@code MidiDevice.Info} object is found, or the device name is
 124  * not specified, the first suitable device from the resulting list will be
 125  * returned. For Sequencer and Synthesizer, a device is suitable if it
 126  * implements the respective interface; whereas for Receiver and Transmitter, a


< prev index next >