diff --git a/ECTrainer2/ECTrainer.h b/ECTrainer2/ECTrainer.h index 2a58427..ba3cc77 100644 --- a/ECTrainer2/ECTrainer.h +++ b/ECTrainer2/ECTrainer.h @@ -37,8 +37,11 @@ MOVIE_STOP, // ����Đ���~ MOVIE_END, // ����Đ��I�� MOVIE_ERROR, // ����G���[ + FB_OK, // �t�B�[�h�o�b�N�FOK FB_GOOD, // �t�B�[�h�o�b�N�FGood FB_NICE, // �t�B�[�h�o�b�N�FNice + FB_GREAT, // �t�B�[�h�o�b�N�FGreat + FB_EXCELLENT, // �t�B�[�h�o�b�N�FExcellent }; // �A�v���P�[�V������� diff --git a/ECTrainer2/ECTrainerGUI.cpp b/ECTrainer2/ECTrainerGUI.cpp index fdcb2a5..cea1cf5 100644 --- a/ECTrainer2/ECTrainerGUI.cpp +++ b/ECTrainer2/ECTrainerGUI.cpp @@ -162,66 +162,25 @@ if (!_dsm->IsPlaying()) cv::imshow(WIN_DISP, _FullDispBuf); if (snapshot) cv::imwrite(SNAPSHOT_FILE, _MainFrame); - //int key = cv::waitKey(1); - if (_hWndMain != ::FindWindowA(NULL, WIN_MAIN.c_str())) { - mwut::DebugPrintf(_T("getWindowProperty\n")); - ((BaseProcess*)_pEct->PWorker())->PostMsg(ECTMSG::SOFTWARE_END); - - } - if (cv::getWindowProperty(WIN_MAIN, 0) < 0) { // �E�C���h�E�~�{�^���ŕ‚����� - mwut::DebugPrintf(_T("getWindowProperty\n")); + // �E�C���h�E�~�{�^���ŕ‚����� + if (_hWndMain != ::FindWindowA(NULL, WIN_MAIN.c_str())) { ((BaseProcess*)_pEct->PWorker())->PostMsg(ECTMSG::SOFTWARE_END); } - // �L�[���� - //int key = cv::waitKey(1); - //switch (key) { - //case '1': PlaySound(_T("../voices/Good_S.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //case '2': PlaySound(_T("../voices/Nice_S.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //case '3': PlaySound(_T("../voices/Great_S.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //case '4': PlaySound(_T("../voices/Excellent_S.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //case '5': PlaySound(_T("../voices/Good_L.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //case '6': PlaySound(_T("../voices/Nice_L.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //case '7': PlaySound(_T("../voices/Great_L.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //case '8': PlaySound(_T("../voices/Excellent_L.wav"), NULL, SND_FILENAME | SND_ASYNC); break; - //} - return true; } // �C�x���g���� bool ECTrainerGUI::EventProc(MSG& msg) { switch (msg.message) { - case WM_PAINT: - case WM_NCMOUSEMOVE: - case WM_NCLBUTTONDOWN: - case WM_NCMOUSELEAVE: - case WM_MOUSEMOVE: - break; - case WM_LBUTTONDOWN: - mwut::DebugPrintf(_T("-------------------------\n")); - break; - case WM_TIMER: - mwut::DebugPrintf(_T("Event Timer\n")); - break; - case WM_CHAR: - if (msg.wParam == KEY_ESC) ((BaseProcess*)_pEct->PWorker())->PostMsg(ECTMSG::SOFTWARE_END); - break; default: - mwut::DebugPrintf(_T("Event %04X\n"), msg.message); + //mwut::DebugPrintf(_T("Event %04X\n"), msg.message); break; } return true; } - -// ���b�Z�[�W�ʒm�iGUI�̓��C���X���b�h�̂��ߒ��ڏ���) -//bool ECTrainerGUI::Tell(ECTMSG msg, WPARAM wp, LPARAM lp) { -// if (msg == ECTMSG::QUIT) _AppRunning = false; -// return true; -//} - // �h���摜�o�b�t�@�ɉ摜��ݒ� void ECTrainerGUI::MakeFullDispBuffer(cv::Mat& img) { _DispImageHeight = img.rows * IMAGE_WIDTH / img.cols; diff --git a/ECTrainer2/ECTrainerGUI.h b/ECTrainer2/ECTrainerGUI.h index fdaf7b0..1a35a23 100644 --- a/ECTrainer2/ECTrainerGUI.h +++ b/ECTrainer2/ECTrainerGUI.h @@ -42,8 +42,6 @@ ECTrainerGUI(ECTrainer* pEct); // ������ bool Init(); - // GUI�X���b�h���b�Z�[�W�ʒm - //bool Tell(ECTMSG msg, WPARAM wp = 0, LPARAM lp = 0); // ���C����ʂ̃E�C���h�E�n���h����Ԃ� HWND GetMainHWnd() { return _hWndMain; } }; diff --git a/ECTrainer2/Worker.cpp b/ECTrainer2/Worker.cpp index bc7cda5..ec22e75 100644 --- a/ECTrainer2/Worker.cpp +++ b/ECTrainer2/Worker.cpp @@ -206,10 +206,30 @@ this->EventLog(_T("Movie Error")); break; + case (int)ECTMSG::FB_OK: // �t�B�[�h�o�b�N�FOK + PlaySound(SOUND_OK, NULL, SND_FILENAME | SND_ASYNC); + this->EventLog(_T("Feedback OK")); + break; + case (int)ECTMSG::FB_GOOD: // �t�B�[�h�o�b�N�FGood - PlaySound(_T("../voices/Good_S.wav"), NULL, SND_FILENAME | SND_ASYNC); + PlaySound(SOUND_GOOD, NULL, SND_FILENAME | SND_ASYNC); this->EventLog(_T("Feedback Good")); break; + + case (int)ECTMSG::FB_NICE: // �t�B�[�h�o�b�N�FNice + PlaySound(SOUND_NICE, NULL, SND_FILENAME | SND_ASYNC); + this->EventLog(_T("Feedback Nice")); + break; + + case (int)ECTMSG::FB_GREAT: // �t�B�[�h�o�b�N�FGreat + PlaySound(SOUND_GREAT, NULL, SND_FILENAME | SND_ASYNC); + this->EventLog(_T("Feedback Great")); + break; + + case (int)ECTMSG::FB_EXCELLENT: // �t�B�[�h�o�b�N�FExcellent + PlaySound(SOUND_EXCELLENT, NULL, SND_FILENAME | SND_ASYNC); + this->EventLog(_T("Feedback Excellent")); + break; } return true; } diff --git a/ECTrainer2/Worker.h b/ECTrainer2/Worker.h index 83ee08c..cbda379 100644 --- a/ECTrainer2/Worker.h +++ b/ECTrainer2/Worker.h @@ -20,6 +20,11 @@ // ���O�o�� class Worker : public BaseProcess { + const TCHAR* SOUND_OK = _T("../voices/OK_S.wav"); + const TCHAR* SOUND_GOOD = _T("../voices/Good_S.wav"); + const TCHAR* SOUND_NICE = _T("../voices/Nice_S.wav"); + const TCHAR* SOUND_GREAT = _T("../voices/Great_S.wav"); + const TCHAR* SOUND_EXCELLENT = _T("../voices/Excellent_S.wav"); const TCHAR* DATA_LOG_FILE = _T("LogData.csv"); const TCHAR* EVENT_LOG_FILE = _T("LogEvent.txt"); APP_STATUS _AppStatus; // �A�v���P�[�V�������