bool NativePlayer::PrevTrack() { BYTE track = GetTrack() - 1; if ( track < 1 ) track = GetNumberOfTracks(); if ( GetMode() == MCI_MODE_PLAY ) return PlayTrack( track ); else return SeekTrack( track ); }
bool NativePlayer::NextTrack() { BYTE track = GetTrack() + 1; BYTE total = GetNumberOfTracks(); if ( track > total ) track = 1; if ( GetMode() == MCI_MODE_PLAY ) return PlayTrack( track ); else return SeekTrack( track ); }
void BL_CDEngine::Play(int32 aTrackNumber) { if (IsDeviceOpened()) { if (GetState() == STATE_NO_DISC) { return; } scsi_play_track lTrack; if (aTrackNumber < 1) { lTrack.start_track = 1; } else if (aTrackNumber > 99) { lTrack.start_track = 99; } else { lTrack.start_track = aTrackNumber; } // If first track is data track, we skip it. GetContents(); if ((lTrack.start_track == 1) && (IsDataTrack(0))) { // If this CD doesn't contain any audio tracks, then we don't play. if (GetNumberOfTracks() <= 1) { return; } lTrack.start_track = 2; } lTrack.start_index = 1; lTrack.end_track = 99; lTrack.end_index = 1; status_t lResult = ioctl(mCurrentDevice, B_SCSI_PLAY_TRACK, &lTrack); if (lResult != B_OK) { } } }