Stupidly forgot these two files in r14671. Should fix build.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14678 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2005-11-04 11:20:18 +00:00
parent fa1103410f
commit eb5b2ccda8
2 changed files with 8 additions and 19 deletions
+7 -15
View File
@@ -47,9 +47,7 @@ CDPlayer::CDPlayer(BRect frame, const char *name, uint32 resizeMask, uint32 flag
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fDiscID=-1;
fVolume=255; fVolume=255;
fUseTrackNames=false;
BuildGUI(); BuildGUI();
@@ -520,7 +518,7 @@ void CDPlayer::WatchCDState(void)
// Because we are changing play states, we will need to update the GUI // Because we are changing play states, we will need to update the GUI
fDiscID=-1; fCDData.SetDiscID(-1);
fCDTitle->SetText("No CD"); fCDTitle->SetText("No CD");
fCurrentTrack->SetText(""); fCurrentTrack->SetText("");
@@ -586,7 +584,7 @@ void CDPlayer::WatchCDState(void)
int32 discid = fCDDrive.GetDiscID(); int32 discid = fCDDrive.GetDiscID();
bool update_track_gui=false; bool update_track_gui=false;
if(discid != fDiscID) if(discid != fCDData.DiscID())
{ {
update_track_gui = true; update_track_gui = true;
@@ -598,20 +596,17 @@ void CDPlayer::WatchCDState(void)
if(fCDQuery.Ready()) if(fCDQuery.Ready())
{ {
fDiscID = discid;
// Note that we only update the CD title for now. We still need a track number // Note that we only update the CD title for now. We still need a track number
// in order to update the display for the selected track // in order to update the display for the selected track
if(fCDQuery.GetTitles(&fCDName, &fTrackNames, 1000000)) if(fCDQuery.GetData(&fCDData, 1000000))
{ {
fCDTitle->SetText(fCDName.String()); BString display(fCDData.Artist());
fUseTrackNames=true; display << " - " << fCDData.Album();
fCDTitle->SetText(display.String());
} }
else else
{ {
fCDName="Audio CD";
fCDTitle->SetText("Audio CD"); fCDTitle->SetText("Audio CD");
fUseTrackNames=false;
} }
} }
} }
@@ -692,10 +687,7 @@ void CDPlayer::WatchCDState(void)
if(whichtrack == 0) if(whichtrack == 0)
whichtrack++; whichtrack++;
if(fUseTrackNames && fTrackNames.size()>0) currentTrackName << "Track " << whichtrack << ": " << fCDData.TrackAt(whichtrack-1);
currentTrackName << "Track " << whichtrack << ": " << fTrackNames[ whichtrack - 1];
else
currentTrackName << "Track " << whichtrack;
fCurrentTrack->SetText(currentTrackName.String()); fCurrentTrack->SetText(currentTrackName.String());
+1 -4
View File
@@ -79,12 +79,9 @@ private:
CDAudioDevice fCDDrive; CDAudioDevice fCDDrive;
PlayList fPlayList; PlayList fPlayList;
CDState fWindowState; CDState fWindowState;
int32 fDiscID;
CDDBQuery fCDQuery; CDDBQuery fCDQuery;
CDDBData fCDData;
uint8 fVolume; uint8 fVolume;
bool fUseTrackNames;
vector<BString> fTrackNames;
BString fCDName;
}; };