From 148f2ab8e560fa5f794c5f578b7e5fdb9d568157 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Wed, 10 Feb 2016 12:08:32 +1000 Subject: [PATCH] Add debugging output for WinMME midi device names --- libs/backends/portaudio/winmmemidi_io.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/backends/portaudio/winmmemidi_io.cc b/libs/backends/portaudio/winmmemidi_io.cc index 00e3eb0182..c7e465e715 100644 --- a/libs/backends/portaudio/winmmemidi_io.cc +++ b/libs/backends/portaudio/winmmemidi_io.cc @@ -216,9 +216,17 @@ WinMMEMidiIO::get_input_name_from_index (int index, std::string& name) { MIDIINCAPS capabilities; MMRESULT result = midiInGetDevCaps(index, &capabilities, sizeof(capabilities)); + if (result == MMSYSERR_NOERROR) { + DEBUG_MIDI(string_compose("Input Device: name : %1, mid : %2, pid : %3\n", + capabilities.szPname, + capabilities.wMid, + capabilities.wPid)); + name = capabilities.szPname; return true; + } else { + DEBUG_MIDI ("Unable to get WinMME input device capabilities\n"); } return false; } @@ -229,8 +237,14 @@ WinMMEMidiIO::get_output_name_from_index (int index, std::string& name) MIDIOUTCAPS capabilities; MMRESULT result = midiOutGetDevCaps(index, &capabilities, sizeof(capabilities)); if (result == MMSYSERR_NOERROR) { + DEBUG_MIDI(string_compose("Output Device: name : %1, mid : %2, pid : %3\n", + capabilities.szPname, + capabilities.wMid, + capabilities.wPid)); name = capabilities.szPname; return true; + } else { + DEBUG_MIDI ("Unable to get WinMME output device capabilities\n"); } return false; }