Index: mythmusic/mythmusic/playbackbox.cpp
===================================================================
--- mythmusic/mythmusic/playbackbox.cpp (revision 12552)
+++ mythmusic/mythmusic/playbackbox.cpp (working copy)
@@ -1057,8 +1052,11 @@
visual_mode_timer->changeInterval(visual_mode_delay * 1000);
}
-void PlaybackBoxMusic::play()
+void PlaybackBoxMusic::play(bool state)
{
+ if (!state && play_button)
+ play_button->setState(!state);
+
if (isplaying)
stop();
@@ -1132,8 +1130,14 @@
bannerEnable(curMeta);
isplaying = true;
+ if (play_button)
+ play_button->setState(true);
+ if (pause_button)
+ pause_button->setState(false);
+ if (stop_button)
+ stop_button->setState(false);
curMeta->setLastPlay();
- curMeta->incPlayCount();
+ curMeta->incPlayCount();
}
}
@@ -1247,21 +1229,29 @@
mdata->Title());
}
-void PlaybackBoxMusic::pause(void)
+void PlaybackBoxMusic::pause(bool state)
{
if (output)
{
isplaying = !isplaying;
+ if (play_button)
+ play_button->setState(isplaying);
+ if (pause_button)
+ pause_button->setState(!isplaying);
output->Pause(!isplaying); //Note pause doesn't take effet instantly
+
+ // wake up threads
+ if (decoder)
+ {
+ decoder->lock();
+ decoder->cond()->wakeAll();
+ decoder->unlock();
+ }
}
- // wake up threads
- if (decoder)
+ else if (pause_button)
{
- decoder->lock();
- decoder->cond()->wakeAll();
- decoder->unlock();
+ pause_button->setState(false);
}
-
}
void PlaybackBoxMusic::stopDecoder(void)
@@ -1284,8 +1274,11 @@
decoder->wait();
}
-void PlaybackBoxMusic::stop(void)
+void PlaybackBoxMusic::stop(bool state)
{
+ if (!state && stop_button)
+ stop_button->setState(!state);
+
stopDecoder();
if (output)
@@ -1315,6 +1308,12 @@
info_text->SetText("");
isplaying = false;
+ if (play_button)
+ play_button->setState(false);
+ if (pause_button)
+ pause_button->setState(false);
+ if (stop_button)
+ stop_button->setState(true);
}
void PlaybackBoxMusic::stopAll()
@@ -1379,6 +1378,10 @@
stopDecoder();
isplaying = false;
+ if (play_button)
+ play_button->setState(false);
+ if (stop_button)
+ stop_button->setState(true);
if (repeatmode == REPEAT_TRACK)
play();
@@ -1971,6 +1976,8 @@
void PlaybackBoxMusic::end()
{
+ stop();
+
if (class LCD *lcd = LCD::Get())
lcd->switchToTime ();
}
@@ -2015,17 +2020,20 @@
if (rew_button)
connect(rew_button, SIGNAL(pushed()), this, SLOT(seekback()));
- pause_button = getUIPushButtonType("pause_button");
+ pause_button = getUICheckBoxType("pause_button");
if (pause_button)
- connect(pause_button, SIGNAL(pushed()), this, SLOT(pause()));
+ connect(pause_button, SIGNAL(pushed(bool)), this, SLOT(pause(bool)));
- play_button = getUIPushButtonType("play_button");
+ play_button = getUICheckBoxType("play_button");
if (play_button)
- connect(play_button, SIGNAL(pushed()), this, SLOT(play()));
+ connect(play_button, SIGNAL(pushed(bool)), this, SLOT(play(bool)));
- stop_button = getUIPushButtonType("stop_button");
+ stop_button = getUICheckBoxType("stop_button");
if (stop_button)
- connect(stop_button, SIGNAL(pushed()), this, SLOT(stop()));
+ {
+ connect(stop_button, SIGNAL(pushed(bool)), this, SLOT(stop(bool)));
+ stop_button->setState(true);
+ }
ff_button = getUIPushButtonType("ff_button");
if (ff_button)
Index: mythmusic/mythmusic/music-ui.xml
===================================================================
--- mythmusic/mythmusic/music-ui.xml (revision 12552)
+++ mythmusic/mythmusic/music-ui.xml (working copy)
@@ -369,26 +369,29 @@
-
+
240,40
-
-
-
-
+
+
+
+
+
-
+
355,40
-
-
-
-
+
+
+
+
+
-
+
470,40
-
-
-
-
+
+
+
+
+
585,40
Index: mythmusic/mythmusic/playbackbox.h
===================================================================
--- mythmusic/mythmusic/playbackbox.h (revision 12552)
+++ mythmusic/mythmusic/playbackbox.h (working copy)
@@ -45,9 +45,9 @@
public slots:
- void play();
- void pause();
- void stop();
+ void play(bool state = true);
+ void pause(bool state = true);
+ void stop(bool state = true);
void stopDecoder();
void previous();
void next();
@@ -205,9 +208,9 @@
UIPushButtonType *prev_button;
UIPushButtonType *rew_button;
- UIPushButtonType *pause_button;
- UIPushButtonType *play_button;
- UIPushButtonType *stop_button;
+ UICheckBoxType *pause_button;
+ UICheckBoxType *play_button;
+ UICheckBoxType *stop_button;
UIPushButtonType *ff_button;
UIPushButtonType *next_button;