/** * Stop current playback. */ void SrvStop( void ) { int loc_going; int loc_fileIdx; int loc_everPlayed; int loc_playtype; LOCK_PLAYMUTEX(); loc_going = going; loc_fileIdx = fileIdx; loc_playtype = playtype; UNLOCK_PLAYMUTEX(); if (loc_going) // if playing, set history before shutdown. { char * path = NULL; char buf[PATH_MAX]; DBGMSG("Stop server playback."); switch (loc_playtype) { case NPT_FILE: LOCK_PLAYMUTEX(); path = strcpy(buf, trackName); UNLOCK_PLAYMUTEX(); break; case NPT_DIR: path = nextFileFromDir(loc_fileIdx,buf,PATH_MAX); break; default: //history not supported. WPRINT("play history not supported."); break; } LOCK_PLAYMUTEX(); loc_fileIdx = fileIdx; loc_everPlayed = everPlayed; UNLOCK_PLAYMUTEX(); if (path) { int mark; LOCK_PLAYMUTEX(); mark = playtime; UNLOCK_PLAYMUTEX(); if (loc_everPlayed) SetPlayHistory(loc_playtype, loc_fileIdx, mark, path); } } stopServer(); LOCK_PLAYMUTEX(); // player has been stop upon user request. errorStatus = NMS_STATUS_PLAYER_STOPPED; UNLOCK_PLAYMUTEX(); }
BOOL CHistoryWnd::OnCommand(WPARAM wParam, LPARAM lParam) { switch (wParam) { case WMS_SETTEXT: if (lParam == 0) SetBiddingHistory((LPCTSTR) lParam); else SetPlayHistory((LPCTSTR) lParam); return TRUE; } // return CCJControlBar::OnCommand(wParam, lParam); }