summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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("");
}
}