List of usage examples for javax.sound.midi MidiDevice getMaxReceivers
int getMaxReceivers();
From source file:org.monome.pages.configuration.Configuration.java
/** * Enables or disables a MIDI output device * /*from w w w . j a v a 2s . c om*/ * @param sMidiDevice The MIDI output device to enable or disable */ public void actionAddMidiOutput(String sMidiDevice) { Info[] midiInfo = MidiSystem.getMidiDeviceInfo(); MidiDevice midiDevice; for (int i = 0; i < midiInfo.length; i++) { try { midiDevice = MidiSystem.getMidiDevice(midiInfo[i]); if (sMidiDevice.compareTo(midiDevice.getDeviceInfo().toString()) == 0) { if (midiDevice.getMaxReceivers() != 0) { MidiDeviceFactory.toggleMidiOutDevice(midiDevice); } } } catch (MidiUnavailableException e) { e.printStackTrace(); } } }