/*------------------------------------------------------- WM_DESTROY message ---------------------------------------------------------*/ void OnDestroy(HWND hwnd) { StopPlayer(hwnd); KillTimer(hwnd, IDTIMER_PLAYER); if(g_hfontDialog) DeleteObject(g_hfontDialog); PostQuitMessage(0); }
/*------------------------------------------- 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); }
int ProjectFrame::CloseProject(int query) { if (theProject) { if (query && theProject->GetChange()) { if (QuerySaveProject() < 0) return 0; } if (CloseAllEditors() == 0) return 0; StopPlayer(); ClearPlayer(); prjTree->RemoveAll(); theProject->Release(); theProject = 0; } return 1; }
void CSoundGen::SelectChip(int Chip) { if (m_bPlaying) StopPlayer(); if (!WaitForStop()) { TRACE0("CSoundGen: Could not stop player!"); return; } m_pAPU->SetExternalSound(Chip); // Enable internal channels after reset m_pAPU->Write(0x4015, 0x0F); m_pAPU->Write(0x4017, 0x00); // MMC5 if (Chip & SNDCHIP_MMC5) m_pAPU->ExternalWrite(0x5015, 0x03); }
/*--------------------------------------------------------------------------*/ JNIEXPORT void JNICALL Java_grame_midishare_player_MidiPlayer_Stop (JNIEnv * inEnv, jclass cl, jint ref){ StopPlayer(ref); }