aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/mediaplayer.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-01 11:09:30 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-01 11:09:30 +0000
commit92f19e1416b0c93fb36801665583eab463145b56 (patch)
treed428c574dcfaee3d3384d1179c685b453dd8eee2 /src/qmmpui/mediaplayer.cpp
parent41303220017c0d03a4d5f92ef316f49fd5931c0a (diff)
downloadqmmp-92f19e1416b0c93fb36801665583eab463145b56.tar.gz
qmmp-92f19e1416b0c93fb36801665583eab463145b56.tar.bz2
qmmp-92f19e1416b0c93fb36801665583eab463145b56.zip
fixed problem with next track
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1413 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/mediaplayer.cpp')
-rw-r--r--src/qmmpui/mediaplayer.cpp17
1 files changed, 15 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())