Applying suggestion from issue #32 - Thanks Lutepatious!

This commit is contained in:
Brendan Robert 2017-05-03 02:45:06 -05:00 committed by GitHub
parent 3b9d6a232e
commit d4e6724bf0

View File

@ -548,6 +548,9 @@ public class PassportMidiInterface extends Card {
System.out.println("No MIDI devices found");
} else {
for (MidiDevice.Info dev : devices) {
if (MidiSystem.getMidiDevice(dev).getMaxReceivers() == 0) {
continue;
}
System.out.println("MIDI Device found: " + dev);
if ((preferredMidiDevice.getValue() == null && dev.getName().contains("Java Sound") && dev instanceof Synthesizer) ||
preferredMidiDevice.getValue().equalsIgnoreCase(dev.getName())