From eb5b2ccda86469538d9be0ea7b19c167b9a6aadc Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Fri, 4 Nov 2005 11:20:18 +0000 Subject: [PATCH] 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 --- src/apps/cdplayer/CDPlayer.cpp | 22 +++++++--------------- src/apps/cdplayer/CDPlayer.h | 5 +---- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/apps/cdplayer/CDPlayer.cpp b/src/apps/cdplayer/CDPlayer.cpp index 0798f61a76..b76aea2527 100644 --- a/src/apps/cdplayer/CDPlayer.cpp +++ b/src/apps/cdplayer/CDPlayer.cpp @@ -47,9 +47,7 @@ CDPlayer::CDPlayer(BRect frame, const char *name, uint32 resizeMask, uint32 flag { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - fDiscID=-1; fVolume=255; - fUseTrackNames=false; BuildGUI(); @@ -520,7 +518,7 @@ void CDPlayer::WatchCDState(void) // Because we are changing play states, we will need to update the GUI - fDiscID=-1; + fCDData.SetDiscID(-1); fCDTitle->SetText("No CD"); fCurrentTrack->SetText(""); @@ -586,7 +584,7 @@ void CDPlayer::WatchCDState(void) int32 discid = fCDDrive.GetDiscID(); bool update_track_gui=false; - if(discid != fDiscID) + if(discid != fCDData.DiscID()) { update_track_gui = true; @@ -598,20 +596,17 @@ void CDPlayer::WatchCDState(void) if(fCDQuery.Ready()) { - fDiscID = discid; - // 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 - if(fCDQuery.GetTitles(&fCDName, &fTrackNames, 1000000)) + if(fCDQuery.GetData(&fCDData, 1000000)) { - fCDTitle->SetText(fCDName.String()); - fUseTrackNames=true; + BString display(fCDData.Artist()); + display << " - " << fCDData.Album(); + fCDTitle->SetText(display.String()); } else { - fCDName="Audio CD"; fCDTitle->SetText("Audio CD"); - fUseTrackNames=false; } } } @@ -692,10 +687,7 @@ void CDPlayer::WatchCDState(void) if(whichtrack == 0) whichtrack++; - if(fUseTrackNames && fTrackNames.size()>0) - currentTrackName << "Track " << whichtrack << ": " << fTrackNames[ whichtrack - 1]; - else - currentTrackName << "Track " << whichtrack; + currentTrackName << "Track " << whichtrack << ": " << fCDData.TrackAt(whichtrack-1); fCurrentTrack->SetText(currentTrackName.String()); diff --git a/src/apps/cdplayer/CDPlayer.h b/src/apps/cdplayer/CDPlayer.h index 5348bea243..8e7867e445 100644 --- a/src/apps/cdplayer/CDPlayer.h +++ b/src/apps/cdplayer/CDPlayer.h @@ -79,12 +79,9 @@ private: CDAudioDevice fCDDrive; PlayList fPlayList; CDState fWindowState; - int32 fDiscID; CDDBQuery fCDQuery; + CDDBData fCDData; uint8 fVolume; - bool fUseTrackNames; - vector fTrackNames; - BString fCDName; };