Carries the instrument across a device change.

This commit is contained in:
Quantum 2014-04-18 20:01:15 -04:00
parent b0634dcd28
commit b6c31d578f

View file

@ -554,7 +554,8 @@ LRESULT MainWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
currentDevice = SendMessage((HWND) lParam, CB_GETCURSEL, 0, 0);
midiOutClose(m_midi);
if (midiOutOpen(&m_midi, currentDevice, 0, 0, CALLBACK_NULL) != MMSYSERR_NOERROR)
MessageBox(m_hwnd, L"Failed to open MIDI device!", L"Fatal Error", MB_ICONERROR);
return MessageBox(m_hwnd, L"Failed to open MIDI device!", L"Fatal Error", MB_ICONERROR), 0;
MIDI_MESSAGE(m_midi, 0xC0, m_instrument, 0);
return 0;
}
break;