Skip to content

Commit

Permalink
added test for Midi devices
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisppaul committed Jul 7, 2024
1 parent 74fcaf6 commit 03996e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/wellen/Wellen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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("+-------------------------------------------------------+");
Expand Down

0 comments on commit 03996e8

Please sign in to comment.