badvision / jace

Java Apple Computer Emulator
Apache License 2.0
66 stars 19 forks source link

[FIX] MIDI device without receivers #32

Closed Lutepatious closed 7 years ago

Lutepatious commented 7 years ago

Please add 3 lines in PassportMidiInterface.java for ignore MIDI device without receivers.

In Java, several MIDI devices are recognized as multiple devices with the same name only as receivers or transmitters. Ignoring devices without receivers can avoid problems.

public void resume() {
    if (isRunning() && midiOut != null) {
        return;
    }
    try {
        MidiDevice selectedDevice = MidiSystem.getSynthesizer();
        MidiDevice.Info[] devices = MidiSystem.getMidiDeviceInfo();
        if (devices.length == 0) {
            System.out.println("No MIDI devices found");
        } else {
            for (MidiDevice.Info dev : devices) {
badvision commented 7 years ago

Cool! Consider it done!

badvision commented 7 years ago

Thanks for the suggestion @Lutepatious! Feel free to send me pull requests any time.