diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-21 09:56:05 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-21 09:56:05 +0000 |
| commit | ac7a7dffc31afe8a20a51db4ab7749bf4fdea67c (patch) | |
| tree | 3640dfe17870fb743463b852b257ffaf9a117bb4 /src/plugins/General/mpris | |
| parent | ae5bd442b79d44b0925e0f9b0e77c3ed74483838 (diff) | |
| download | qmmp-ac7a7dffc31afe8a20a51db4ab7749bf4fdea67c.tar.gz qmmp-ac7a7dffc31afe8a20a51db4ab7749bf4fdea67c.tar.bz2 qmmp-ac7a7dffc31afe8a20a51db4ab7749bf4fdea67c.zip | |
more mpris methods support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@697 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/mpris')
| -rw-r--r-- | src/plugins/General/mpris/mpris.cpp | 13 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris.h | 16 | ||||
| -rw-r--r-- | src/plugins/General/mpris/playerobject.cpp | 9 | ||||
| -rw-r--r-- | src/plugins/General/mpris/playerobject.h | 2 | ||||
| -rw-r--r-- | src/plugins/General/mpris/tracklistobject.cpp | 10 | ||||
| -rw-r--r-- | src/plugins/General/mpris/tracklistobject.h | 4 |
6 files changed, 20 insertions, 34 deletions
diff --git a/src/plugins/General/mpris/mpris.cpp b/src/plugins/General/mpris/mpris.cpp index 40c43cf73..4c6474311 100644 --- a/src/plugins/General/mpris/mpris.cpp +++ b/src/plugins/General/mpris/mpris.cpp @@ -36,10 +36,6 @@ MPRIS::MPRIS(QObject *parent) connection.registerObject("/Player", player, QDBusConnection::ExportAllContents); connection.registerObject("/", root, QDBusConnection::ExportAllContents); connection.registerService("org.mpris.qmmp"); - m_left = 0; - m_right = 0; - m_time = 0; - //m_state = General::Stopped; } @@ -47,13 +43,4 @@ MPRIS::~MPRIS() { } -int MPRIS::leftVolume() -{ - return m_left; -} - -int MPRIS::rightVolume() -{ - return m_right; -} diff --git a/src/plugins/General/mpris/mpris.h b/src/plugins/General/mpris/mpris.h index 8b90d2881..370809da7 100644 --- a/src/plugins/General/mpris/mpris.h +++ b/src/plugins/General/mpris/mpris.h @@ -36,22 +36,6 @@ public: MPRIS(QObject *parent = 0); ~MPRIS(); - -signals: - void stateChanged(); - void timeChanged(); - void volumeChanged(); - void songChanged(); - -public slots: - int leftVolume(); - int rightVolume(); - -private: - DBUSAdaptor *m_adaptor; - int m_left, m_right; - uint m_state; - int m_time; }; #endif diff --git a/src/plugins/General/mpris/playerobject.cpp b/src/plugins/General/mpris/playerobject.cpp index 4e3cc1a10..3c9d374d1 100644 --- a/src/plugins/General/mpris/playerobject.cpp +++ b/src/plugins/General/mpris/playerobject.cpp @@ -58,9 +58,12 @@ PlayerObject::PlayerObject(QObject *parent) qDBusRegisterMetaType<PlayerStatus>(); m_core = SoundCore::instance(); m_player = MediaPlayer::instance(); + m_model = m_player->playListModel(); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateCaps())); connect(m_core, SIGNAL(metaDataChanged ()), SLOT(updateTrack())); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateStatus())); + connect(m_model, SIGNAL(repeatableListChanged(bool)), SLOT(updateStatus())); + connect(m_model, SIGNAL(shuffleChanged(bool)), SLOT(updateStatus())); } PlayerObject::~PlayerObject() @@ -108,9 +111,9 @@ PlayerStatus PlayerObject::GetStatus() case Qmmp::Paused: st.state = 1; }; - st.random = 0; //TODO playlist support - st.repeat = 0; - st.repeatPlayList = 0; + st.random = int(m_model->isShuffle()); + st.repeat = 0; //TODO add suppot for this + st.repeatPlayList = int(m_model->isRepeatableList()); return st; } diff --git a/src/plugins/General/mpris/playerobject.h b/src/plugins/General/mpris/playerobject.h index 1335b1138..ea8cbe1c1 100644 --- a/src/plugins/General/mpris/playerobject.h +++ b/src/plugins/General/mpris/playerobject.h @@ -25,6 +25,7 @@ class SoundCore; class MediaPlayer; +class PlayListModel; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -93,6 +94,7 @@ private slots: private: SoundCore *m_core; MediaPlayer *m_player; + PlayListModel *m_model; }; diff --git a/src/plugins/General/mpris/tracklistobject.cpp b/src/plugins/General/mpris/tracklistobject.cpp index ba8e2c1ba..dfce2d8af 100644 --- a/src/plugins/General/mpris/tracklistobject.cpp +++ b/src/plugins/General/mpris/tracklistobject.cpp @@ -82,6 +82,16 @@ QVariantMap TrackListObject::GetMetadata(int in0) return map; } +void TrackListObject::SetLoop(bool in0) +{ + m_model->prepareForRepeatablePlaying(in0); +} + +void TrackListObject::SetRandom(bool in0) +{ + m_model->prepareForShufflePlaying(in0); +} + void TrackListObject::updateTrackList() { emit TrackListChange(m_model->count()); diff --git a/src/plugins/General/mpris/tracklistobject.h b/src/plugins/General/mpris/tracklistobject.h index 736ef1f2b..c1ff169b1 100644 --- a/src/plugins/General/mpris/tracklistobject.h +++ b/src/plugins/General/mpris/tracklistobject.h @@ -46,8 +46,8 @@ public slots: int GetCurrentTrack(); int GetLength(); QVariantMap GetMetadata(int in0); - /*void SetLoop(bool in0); - void SetRandom(bool in0);*/ + void SetLoop(bool in0); + void SetRandom(bool in0); signals: void TrackListChange(int in0); |
