From 286a97ac6127dba81bea9864530920f806eff5a4 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Tue, 27 Sep 2005 00:52:17 +0000 Subject: [PATCH] Fix for skipping over tracks when playing through a disc in sequential mode git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14247 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/cdplayer/CDPlayer.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/apps/cdplayer/CDPlayer.cpp b/src/apps/cdplayer/CDPlayer.cpp index 7bdb10ec0d..0798f61a76 100644 --- a/src/apps/cdplayer/CDPlayer.cpp +++ b/src/apps/cdplayer/CDPlayer.cpp @@ -507,6 +507,7 @@ void CDPlayer::WatchCDState(void) // Second, establish whether or not we have a CD in the drive CDState playstate = fCDDrive.GetState(); + bool internal_track_change=false; if(playstate == kNoCD) { @@ -549,6 +550,8 @@ void CDPlayer::WatchCDState(void) { if(fWindowState == kPlaying) { + internal_track_change=true; + // This means that the drive finished playing the song, so get the next one // from the list and play it int16 next = fPlayList.GetNextTrack(); @@ -623,16 +626,21 @@ void CDPlayer::WatchCDState(void) if(playstate == kPlaying) { - // The main thing is that we need to make sure that the playlist and the drive's track - // stay in sync. The CD's track may have been changed by an outside source, so if - // the drive is playing, check for playlist sync. if(playlisttrack != drivetrack) { playlisttrack = drivetrack; - fPlayList.SetTrackCount(drivecount); - fPlayList.SetCurrentTrack(drivetrack); + + if(!internal_track_change) + { + // The main thing is that we need to make sure that the playlist and the drive's track + // stay in sync. The CD's track may have been changed by an outside source, so if + // the drive is playing, check for playlist sync. + fPlayList.SetTrackCount(drivecount); + fPlayList.SetCurrentTrack(drivetrack); + } } update_track_gui=true; + } else {