/*------------------------------------------- window procedure ---------------------------------------------*/ LRESULT CALLBACK WndProcPlayer(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_CREATE: OnCreate(hwnd); return 0; case WM_DESTROY: OnDestroy(hwnd); return 0; case WM_TIMER: switch(wParam) { case IDTIMER_PLAYER: OnTimerPlayer(hwnd); break; } return 0; // show dialog box case PLAYERM_SHOWDLG: OnShowDialog(hwnd); return 0; // add item to tcmenu*.txt case PLAYERM_REQUESTMENU: OnRequestMenu(hwnd, FALSE); return 0; case PLAYERM_STOP: StopPlayer(hwnd); PostMessage(hwnd, WM_CLOSE, 0, 0); return 0; case PLAYERM_PAUSE: PausePlayer(hwnd); return 0; case PLAYERM_NEXT: PrevNextPlayer(hwnd, TRUE); return 0; case PLAYERM_PREV: PrevNextPlayer(hwnd, FALSE); return 0; case MM_MCINOTIFY: OnMCINotifyPlayer(hwnd, wParam, (LONG)lParam); return 0; case WM_COPYDATA: OnCopyData(hwnd, (HWND)wParam, (COPYDATASTRUCT*)lParam); return 0; } return DefWindowProc(hwnd, message, wParam, lParam); }
void PC_Pause(void){ if( ! is_playing()){ return; // There is only two threads, so its impossible to start playing // before PC_StopPause is called. } #ifdef NOPAUSEPLAY PlayStop(); #else PausePlayer(); // Will not return before the player has really paused. PC_ReturnElements_fromPlayPos(pc->playpos); (*Ptask2MtaskCallBack)(); #endif }
/*--------------------------------------------------------------------------*/ JNIEXPORT void JNICALL Java_grame_midishare_player_MidiPlayer_Pause (JNIEnv * inEnv, jclass cl, jint ref){ PausePlayer(ref); }