summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-09-29 22:21:20 -0700
committerKaz Kylheku <kaz@kylheku.com>2013-09-29 22:21:20 -0700
commitc44e1141e340c80ded8524e99c683a1efb2e780e (patch)
tree65863013aee6b8aec736c9d85082b142320d4d88
parent99e8373566820a2c06f9dcb0e933dc3e9c7ecfb7 (diff)
downloadsekaiju-master.tar.gz
sekaiju-master.tar.bz2
sekaiju-master.zip
Changing the message box for failure to open MIDI.HEADmaster
When Sekaiju cannot open a MIDI device; if you click OK on the dialog box, it will just forget the device. The new behavior is not great, but better: an Abort, Retry, Ignore error dialog is shown instead. Abort will forget the nonworking MIDI device (same as OK) before. Ignore will keep the device in the list. Retry will try opening it again: very useful for plugging in a USB MIDI adapter and trying again.
-rw-r--r--src/SekaijuApp.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/SekaijuApp.cpp b/src/SekaijuApp.cpp
index a63ea75..12e0a3c 100644
--- a/src/SekaijuApp.cpp
+++ b/src/SekaijuApp.cpp
@@ -2528,6 +2528,7 @@ void CSekaijuApp::OpenAllMIDIInDevice () {
CString strMsg2;
m_theCriticalSection.Lock ();
for (i = 0; i < MAXMIDIINDEVICENUM; i++) {
+ retry:
MIDIStatus_Delete (m_pMIDIInStatus[i]);
m_pMIDIInStatus[i] = NULL;
m_pMIDIIn[i] = MIDIIn_Reopen (m_pMIDIIn[i], m_strMIDIInName[i]);
@@ -2545,8 +2546,17 @@ void CSekaijuApp::OpenAllMIDIInDevice () {
strMsg.LoadString (IDS_S_N_MIDIINDEVICE_D_OPEN_FAILED);
strMsg2.Format (strMsg, m_strMIDIInName[i], i + 1);
m_theCriticalSection.Unlock ();
- AfxMessageBox (strMsg2, MB_OK | MB_ICONEXCLAMATION);
+ int boxresult = AfxMessageBox (strMsg2, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION);
m_theCriticalSection.Lock ();
+ switch (boxresult) {
+ case IDRETRY:
+ goto retry;
+ case IDIGNORE:
+ continue; // m_strMIDIInName[i]を消さない
+ case IDABORT:
+ default:
+ break;
+ }
}
m_strMIDIInName[i] = _T("");
}
@@ -2561,6 +2571,7 @@ void CSekaijuApp::OpenAllMIDIOutDevice () {
CString strMsg2;
m_theCriticalSection.Lock ();
for (i = 0; i < MAXMIDIOUTDEVICENUM; i++) {
+ retry:
MIDIStatus_Delete (m_pMIDIOutStatus[i]);
m_pMIDIOutStatus[i] = NULL;
MIDIStatus_Delete (m_pTempMIDIStatus[i]);
@@ -2581,9 +2592,17 @@ void CSekaijuApp::OpenAllMIDIOutDevice () {
strMsg.LoadString (IDS_S_N_MIDIOUTDEVICE_D_OPEN_FAILED);
strMsg2.Format (strMsg, m_strMIDIOutName[i], i + 1);
m_theCriticalSection.Unlock ();
- AfxMessageBox (strMsg2, MB_OK | MB_ICONEXCLAMATION);
+ int boxresult = AfxMessageBox (strMsg2, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION);
m_theCriticalSection.Lock ();
- }
+ switch (boxresult) {
+ case IDRETRY:
+ goto retry;
+ case IDIGNORE:
+ continue; // m_strMIDIInName[i]を消さない
+ case IDABORT:
+ default:
+ break;
+ } }
m_strMIDIOutName[i] = _T("");
}
}