Fixed a couple of bugs related to changing CDs
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14236 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -148,8 +148,16 @@ TrackState::UpdateState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we're not playing, just monitor the current track in the playlist
|
// If we're not playing, just monitor the current track in the playlist
|
||||||
cdTrack = sPlayList.GetCurrentTrack();
|
|
||||||
count = gCDDevice.CountTracks();
|
count = gCDDevice.CountTracks();
|
||||||
|
if(count>0)
|
||||||
|
{
|
||||||
|
cdTrack = sPlayList.GetCurrentTrack();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sPlayList.SetTrackCount(0);
|
||||||
|
cdTrack=-1;
|
||||||
|
}
|
||||||
return CurrentState(cdTrack,count);
|
return CurrentState(cdTrack,count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -498,7 +498,11 @@ CDPlayer::UpdateCDInfo(void)
|
|||||||
bool trackresult = engine->ContentWatcher()->GetContent(&CDName,&trackNames);
|
bool trackresult = engine->ContentWatcher()->GetContent(&CDName,&trackNames);
|
||||||
|
|
||||||
if(currentTrack < 0)
|
if(currentTrack < 0)
|
||||||
|
{
|
||||||
|
fCDTitle->SetText("");
|
||||||
|
fCurrentTrack->SetText("");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(currentTrack == 0)
|
if(currentTrack == 0)
|
||||||
currentTrack++;
|
currentTrack++;
|
||||||
|
|||||||
@@ -48,7 +48,10 @@ PlayList::SetTrackCount(const int16 &count)
|
|||||||
STRACE(("PlayList::SetTrackCount(%d)\n",count));
|
STRACE(("PlayList::SetTrackCount(%d)\n",count));
|
||||||
|
|
||||||
if(count < 0)
|
if(count < 0)
|
||||||
|
{
|
||||||
fTrackCount = 0;
|
fTrackCount = 0;
|
||||||
|
fTrackIndex = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if(count > 500)
|
if(count > 500)
|
||||||
fTrackCount = 500;
|
fTrackCount = 500;
|
||||||
@@ -145,7 +148,7 @@ PlayList::GetCurrentTrack(void)
|
|||||||
fLocker.Lock();
|
fLocker.Lock();
|
||||||
|
|
||||||
int16 value = fTrackList[fTrackIndex];
|
int16 value = fTrackList[fTrackIndex];
|
||||||
STRACE(("PlayList::GetCurrentTrack()=%d\n",value));
|
// STRACE(("PlayList::GetCurrentTrack()=%d\n",value));
|
||||||
|
|
||||||
fLocker.Unlock();
|
fLocker.Unlock();
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
Reference in New Issue
Block a user