//============================================================================= // Move to the previous track //============================================================================= MCIERROR CCDAudio::Backward() { TCHAR szBuff2[128], szBuff3[32]; int nCurrTrack = GetCurrentTrack(); const int nLastTrack = GetTracksCount(); if( (nCurrTrack == 0) || (nLastTrack == 0) || (nCurrTrack == 1) ) return 0; nCurrTrack--; _stprintf( szBuff2, _T("status cdaudio position track %d"), nCurrTrack ); m_nErrorCode = mciSendString( szBuff2, szBuff3, sizeof(szBuff3), NULL ); if( m_nErrorCode != 0 ){ MCIError( m_nErrorCode ); return m_nErrorCode; } memset(szBuff2, 0, sizeof(szBuff2)); _stprintf( szBuff2, _T("play cdaudio from %s"), szBuff3 ); m_nErrorCode = mciSendString( szBuff2, NULL, 0, NULL ); if( m_nErrorCode != 0 ){ MCIError( m_nErrorCode ); return m_nErrorCode; } return m_nErrorCode; }
//_____________________________________________________________________________ Int_t amsvmc_MCStack::GetCurrentParentTrackNumber() const { /// \return The current track parent ID. TParticle* current = GetCurrentTrack(); if (current) return current->GetFirstMother(); else return -1; }
void BL_CDEngine::Previous() { if (IsDeviceOpened()) { tCdState lState = GetState(); if (lState == STATE_NO_DISC) { return; } Play(GetCurrentTrack() - 1); // Make sure we don't start playing if we were paused before. if (lState == STATE_PAUSED) { Pause(); } } }
//============================================================================= // Move to the next track //============================================================================= MCIERROR CCDAudio::Forward() { TCHAR szBuff2[128], szBuff3[32]; int nCurrTrack = GetCurrentTrack(); const int nLastTrack = GetTracksCount(); // now the current track is the last track if( (nCurrTrack == nLastTrack) || (nLastTrack == 0) ) return 0; // increment track position nCurrTrack++; // form the command string _stprintf( szBuff2, _T("status cdaudio position track %d"), nCurrTrack ); // send the command string m_nErrorCode = mciSendString( szBuff2, szBuff3, sizeof(szBuff3), NULL ); if( m_nErrorCode != 0 ){ MCIError( m_nErrorCode ); return m_nErrorCode; } memset(szBuff2, 0, sizeof(szBuff2)); // form the command string _stprintf( szBuff2, _T("play cdaudio from %s"), szBuff3 ); // send the command string m_nErrorCode = mciSendString( szBuff2, NULL, 0, NULL ); if( m_nErrorCode != 0 ){ MCIError( m_nErrorCode ); return m_nErrorCode; } return m_nErrorCode; }