List of usage examples for javax.sound.midi MidiDevice getMaxTransmitters
int getMaxTransmitters();
From source file:org.monome.pages.configuration.Configuration.java
/** * Enables or disables a MIDI input device * /*from www . j a v a 2 s .co m*/ * @param sMidiDevice The name of the MIDI device to toggle */ public void actionAddMidiInput(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.getMaxTransmitters() != 0) { MidiDeviceFactory.toggleMidiInDevice(midiDevice); } } } catch (MidiUnavailableException e) { e.printStackTrace(); } } }