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:
parent
f66f06160a
commit
53960be31f
@ -148,8 +148,16 @@ TrackState::UpdateState()
|
||||
}
|
||||
|
||||
// If we're not playing, just monitor the current track in the playlist
|
||||
cdTrack = sPlayList.GetCurrentTrack();
|
||||
count = gCDDevice.CountTracks();
|
||||
if(count>0)
|
||||
{
|
||||
cdTrack = sPlayList.GetCurrentTrack();
|
||||
}
|
||||
else
|
||||
{
|
||||
sPlayList.SetTrackCount(0);
|
||||
cdTrack=-1;
|
||||
}
|
||||
return CurrentState(cdTrack,count);
|
||||
}
|
||||
|
||||
|
@ -498,7 +498,11 @@ CDPlayer::UpdateCDInfo(void)
|
||||
bool trackresult = engine->ContentWatcher()->GetContent(&CDName,&trackNames);
|
||||
|
||||
if(currentTrack < 0)
|
||||
{
|
||||
fCDTitle->SetText("");
|
||||
fCurrentTrack->SetText("");
|
||||
return;
|
||||
}
|
||||
|
||||
if(currentTrack == 0)
|
||||
currentTrack++;
|
||||
|
@ -48,7 +48,10 @@ PlayList::SetTrackCount(const int16 &count)
|
||||
STRACE(("PlayList::SetTrackCount(%d)\n",count));
|
||||
|
||||
if(count < 0)
|
||||
{
|
||||
fTrackCount = 0;
|
||||
fTrackIndex = 0;
|
||||
}
|
||||
else
|
||||
if(count > 500)
|
||||
fTrackCount = 500;
|
||||
@ -145,7 +148,7 @@ PlayList::GetCurrentTrack(void)
|
||||
fLocker.Lock();
|
||||
|
||||
int16 value = fTrackList[fTrackIndex];
|
||||
STRACE(("PlayList::GetCurrentTrack()=%d\n",value));
|
||||
// STRACE(("PlayList::GetCurrentTrack()=%d\n",value));
|
||||
|
||||
fLocker.Unlock();
|
||||
return value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user