From fedd13511bbf91914a0250b43c440f43e6d1e8c5 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 23 Dec 2008 21:13:34 +0000 Subject: 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 --- src/qmmpui/mediaplayer.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/qmmpui/mediaplayer.cpp') 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); +} -- cgit v1.2.3-13-gbd6f