aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/mediaplayer.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-12-23 21:13:34 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-12-23 21:13:34 +0000
commitfedd13511bbf91914a0250b43c440f43e6d1e8c5 (patch)
tree03cca77aab98ce8c8c2b261f345655d64ae8e172 /src/qmmpui/mediaplayer.cpp
parentac7a7dffc31afe8a20a51db4ab7749bf4fdea67c (diff)
downloadqmmp-fedd13511bbf91914a0250b43c440f43e6d1e8c5.tar.gz
qmmp-fedd13511bbf91914a0250b43c440f43e6d1e8c5.tar.bz2
qmmp-fedd13511bbf91914a0250b43c440f43e6d1e8c5.zip
full mpris support; new options: "repeat track", "show protocol"
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@698 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/mediaplayer.cpp')
-rw-r--r--src/qmmpui/mediaplayer.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/qmmpui/mediaplayer.cpp b/src/qmmpui/mediaplayer.cpp
index 311b195b9..f0e7c54ae 100644
--- a/src/qmmpui/mediaplayer.cpp
+++ b/src/qmmpui/mediaplayer.cpp
@@ -35,6 +35,7 @@ MediaPlayer::MediaPlayer(QObject *parent)
m_instance = this;
m_model = 0;
m_core = 0;
+ m_repeat = FALSE;
}
@@ -53,6 +54,7 @@ void MediaPlayer::initialize(SoundCore *core, PlayListModel *model)
Q_CHECK_PTR(model);
m_core = core;
m_model = model;
+ m_repeat = FALSE;
connect(m_core, SIGNAL(finished()), SLOT(next()));
}
@@ -61,6 +63,11 @@ PlayListModel *MediaPlayer::playListModel()
return m_model;
}
+bool MediaPlayer::isRepeatable() const
+{
+ return m_repeat;
+}
+
void MediaPlayer::play()
{
m_model->doCurrentVisibleRequest();
@@ -155,3 +162,18 @@ void MediaPlayer::previous()
display->hideTimeDisplay();*/
}
+void MediaPlayer::setRepeatable(bool r)
+{
+ if (r != m_repeat && !r)
+ {
+ disconnect(m_core, SIGNAL(finished()), this, SLOT(play()));
+ connect(m_core, SIGNAL(finished()), SLOT(next()));
+ }
+ else if (r != m_repeat && r)
+ {
+ disconnect(m_core, SIGNAL(finished()), this, SLOT(next()));
+ connect(m_core, SIGNAL(finished()), SLOT(play()));
+ }
+ m_repeat = r;
+ emit repeatableChanged(r);
+}