diff --git a/src/wellen/Wellen.java b/src/wellen/Wellen.java index 457d0d6..c06544f 100644 --- a/src/wellen/Wellen.java +++ b/src/wellen/Wellen.java @@ -449,6 +449,22 @@ public static void dumpAudioInputAndOutputDevices() { queryAudioInputAndOutputDevices(null, true, false); } + public static boolean isMidiDeviceAvailable(String pDeviceName) { + final String[] mInputNames = MidiIn.availableInputs(); + for (String mInputName : mInputNames) { + if (mInputName.equals(pDeviceName)) { + return true; + } + } + final String[] mOutputNames = MidiOut.availableOutputs(); + for (String mOutputName : mOutputNames) { + if (mOutputName.equals(pDeviceName)) { + return true; + } + } + return false; + } + public static String[] dumpMidiInputDevices() { final String[] mInputNames = MidiIn.availableInputs(); System.out.println("+-------------------------------------------------------+");