[mythtv] music playbackbox
Andy Davidoff
dert at pobox.com
Sun Feb 23 17:02:21 EST 2003
This has the 3.0.5 check, a slight fix so that the keyboard accelerator
rebinding doesn't query the database to check for settings each time the
user hits a button, and the shuffle-play-after-editing-playlist-is-linear
fix. I'll test 3.0.7 and the visualization crash bug separately.
-------------- next part --------------
Index: playbackbox.cpp
===================================================================
RCS file: /var/lib/cvs/mythmusic/mythmusic/playbackbox.cpp,v
retrieving revision 1.25
diff -d -u -b -r1.25 playbackbox.cpp
--- playbackbox.cpp 23 Feb 2003 14:52:35 -0000 1.25
+++ playbackbox.cpp 23 Feb 2003 21:52:49 -0000
@@ -166,7 +166,7 @@
secondcontrol->addWidget(vis);
connect(vis, SIGNAL(clicked()), this, SLOT(visEnable()));
- QString keyboard_accelerator_flag = gContext->GetSetting("KeyboardAccelerators");
+ keyboard_accelerator_flag = gContext->GetSetting("KeyboardAccelerators");
if(keyboard_accelerator_flag.lower() == "true")
{
// There may be a better key press
@@ -223,7 +223,7 @@
playview->setAllColumnsShowFocus(true);
plist = playlist;
- playlistindex = 0;
+ shuffleindex = 0;
setupListView();
vbox->addWidget(playview, 1);
@@ -239,17 +239,19 @@
shufflemode = false;
repeatmode = false;
- curMeta = ((*plist)[playlistindex]);
-
QString playmode = gContext->GetSetting("PlayMode");
if (playmode.lower() == "random")
toggleShuffle();
else
setupPlaylist();
+ playlistindex = playlistorder[shuffleindex];
+ curMeta = (*plist)[playlistindex];
+#if QT_VERSION == 0x030005
// this is a hack to fix the playlist's refusal to update w/o a SIG
playlist_timer = new QTimer();
connect(playlist_timer, SIGNAL(timeout()), this, SLOT(jumpToItem()));
+#endif
isplaying = false;
@@ -360,8 +362,10 @@
void PlaybackBox::jumpToItem(void)
{
+#if QT_VERSION == 0x030005
if (playlist_timer->isActive())
playlist_timer->stop();
+#endif
jumpToItem(listlist.at(playlistindex));
}
@@ -384,12 +388,10 @@
if (playlistorder.size() > 0)
playlistorder.clear();
- playlistindex = 0;
- shuffleindex = 0;
-
if (plist->size() == 0)
{
curMeta = Metadata("dummy.music");
+ shuffleindex = 0;
return;
}
@@ -537,7 +539,9 @@
isplaying = true;
+#if QT_VERSION == 0x030005
playlist_timer->start(1, true);
+#endif
gContext->LCDswitchToChannel(curMeta.Artist(), curMeta.Title(), "");
}
@@ -766,9 +770,10 @@
else
randomize->setText("Shuffle: Normal");
- QString accelerator_flag = gContext->GetSetting("KeyboardAccelerators");
- if (accelerator_flag.lower() == "true")
+#if QT_VERSION == 0x030005
+ if(keyboard_accelerator_flag.lower() == "true")
randomize->setAccel(Key_1);
+#endif
}
void PlaybackBox::toggleRepeat()
@@ -780,9 +785,10 @@
else
repeat->setText("Repeat: Playlist");
- QString accelerator_flag = gContext->GetSetting("KeyboardAccelerators");
- if (accelerator_flag.lower() == "true")
+#if QT_VERSION == 0x030005
+ if(keyboard_accelerator_flag.lower() == "true")
repeat->setAccel(Key_2);
+#endif
}
void PlaybackBox::editPlaylist()
Index: playbackbox.h
===================================================================
RCS file: /var/lib/cvs/mythmusic/mythmusic/playbackbox.h,v
retrieving revision 1.14
diff -d -u -b -r1.14 playbackbox.h
--- playbackbox.h 23 Feb 2003 14:52:35 -0000 1.14
+++ playbackbox.h 23 Feb 2003 21:52:49 -0000
@@ -118,7 +118,10 @@
int visual_mode_delay;
QTimer *visual_mode_timer;
QTimer *lcd_update_timer;
+ QString keyboard_accelerator_flag;
+#if QT_VERSION == 0x030005
QTimer *playlist_timer;
+#endif
bool visualizer_is_active;
};
More information about the mythtv-dev
mailing list