diff options
Diffstat (limited to 'src/qmmpui/mediaplayer.cpp')
| -rw-r--r-- | src/qmmpui/mediaplayer.cpp | 22 |
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); +} |
