aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-06-26 14:08:17 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-06-26 14:08:17 +0000
commitcd09ad84c0ee44a0cb34b4d9efb7bb244070a25c (patch)
treeb76936164c015155e15e96eff6dd832c618409b3 /src/qmmpui
parent810d7042df700ce8d8e01e788708c4008ce44af2 (diff)
downloadqmmp-cd09ad84c0ee44a0cb34b4d9efb7bb244070a25c.tar.gz
qmmp-cd09ad84c0ee44a0cb34b4d9efb7bb244070a25c.tar.bz2
qmmp-cd09ad84c0ee44a0cb34b4d9efb7bb244070a25c.zip
using events instead of some signals
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2235 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui')
-rw-r--r--src/qmmpui/mediaplayer.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/qmmpui/mediaplayer.cpp b/src/qmmpui/mediaplayer.cpp
index 04bddf6a2..c4dc178e0 100644
--- a/src/qmmpui/mediaplayer.cpp
+++ b/src/qmmpui/mediaplayer.cpp
@@ -22,6 +22,8 @@
#include <QString>
#include <QTranslator>
#include <QLocale>
+#include <qmmp/statechangedevent.h>
+#include <qmmp/metadatachangedevent.h>
#include "playlistitem.h"
#include "mediaplayer.h"
@@ -115,32 +117,18 @@ void MediaPlayer::stop()
void MediaPlayer::next()
{
- if (!m_pl_manager->currentPlayList()->next())
- {
- stop();
- return;
- }
- if (m_core->state() != Qmmp::Stopped)
- {
- stop();
+ bool playNext = m_core->state() != Qmmp::Stopped;
+ stop();
+ if (m_pl_manager->currentPlayList()->next() && playNext)
play();
- }
}
void MediaPlayer::previous()
{
- if (!m_pl_manager->currentPlayList()->previous())
- {
- stop();
- return;
- }
-
- if (m_core->state() != Qmmp::Stopped)
- {
- if (m_core->state() == Qmmp::Paused)
- stop();
+ bool playNext = m_core->state() != Qmmp::Stopped;
+ stop();
+ if (m_pl_manager->currentPlayList()->next() && playNext)
play();
- }
}
void MediaPlayer::setRepeatable(bool r)