aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qmmpui/mediaplayer.cpp17
-rw-r--r--src/qmmpui/mediaplayer.h1
2 files changed, 16 insertions, 2 deletions
diff --git a/src/qmmpui/mediaplayer.cpp b/src/qmmpui/mediaplayer.cpp
index af256c288..56621d9ee 100644
--- a/src/qmmpui/mediaplayer.cpp
+++ b/src/qmmpui/mediaplayer.cpp
@@ -59,7 +59,7 @@ void MediaPlayer::initialize(SoundCore *core, PlayListManager *pl_manager)
m_pl_manager = pl_manager;
m_repeat = FALSE;
connect(m_core, SIGNAL(aboutToFinish()), SLOT(updateNextUrl()));
- connect(m_core, SIGNAL(finished()), SLOT(next()));
+ connect(m_core, SIGNAL(finished()), SLOT(playNext()));
}
PlayListManager *MediaPlayer::playListManager()
@@ -152,7 +152,6 @@ void MediaPlayer::next()
stop();
return;
}
-
if (m_core->state() != Qmmp::Stopped)
{
if (m_core->state() == Qmmp::Paused)
@@ -193,6 +192,20 @@ void MediaPlayer::setRepeatable(bool r)
emit repeatableChanged(r);
}
+void MediaPlayer::playNext()
+{
+ if (!m_pl_manager->currentPlayList()->isEmptyQueue()) //TODO move this inside PlayListModel
+ {
+ m_pl_manager->currentPlayList()->setCurrentToQueued();
+ }
+ else if (!m_pl_manager->currentPlayList()->next())
+ {
+ stop();
+ return;
+ }
+ play();
+}
+
void MediaPlayer::updateNextUrl()
{
if(m_pl_manager->currentPlayList()->nextItem() && !isRepeatable())
diff --git a/src/qmmpui/mediaplayer.h b/src/qmmpui/mediaplayer.h
index 77969542c..afecfac1c 100644
--- a/src/qmmpui/mediaplayer.h
+++ b/src/qmmpui/mediaplayer.h
@@ -91,6 +91,7 @@ signals:
void repeatableChanged(bool enabled);
private slots:
+ void playNext();
void updateNextUrl();
private: