aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/mpris/playerobject.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-25 22:24:48 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-25 22:24:48 +0000
commitc55ed6ab2a2839be7f4bbd490268948d103d8a4a (patch)
tree8636626395b4e5fc5b06b54e906f44c8b03b8fb5 /src/plugins/General/mpris/playerobject.h
parentb232de14d10f6c09c7c15410fa468054695baaa6 (diff)
downloadqmmp-c55ed6ab2a2839be7f4bbd490268948d103d8a4a.tar.gz
qmmp-c55ed6ab2a2839be7f4bbd490268948d103d8a4a.tar.bz2
qmmp-c55ed6ab2a2839be7f4bbd490268948d103d8a4a.zip
some mpris plugin improvements
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@638 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/mpris/playerobject.h')
-rw-r--r--src/plugins/General/mpris/playerobject.h44
1 files changed, 32 insertions, 12 deletions
diff --git a/src/plugins/General/mpris/playerobject.h b/src/plugins/General/mpris/playerobject.h
index 09f112728..0f60c85c9 100644
--- a/src/plugins/General/mpris/playerobject.h
+++ b/src/plugins/General/mpris/playerobject.h
@@ -20,14 +20,13 @@
#ifndef PLAYEROBJECT_H
#define PLAYEROBJECT_H
-#include <QtDBus>
-#include <QString>
-#include <QVariant>
+#include <QObject>
+#include <QVariantMap>
class SoundCore;
/**
- @author Ilya Kotov <forkotov02@hotmail.ru>
+ @author Ilya Kotov <forkotov02@hotmail.ru>
*/
struct PlayerStatus
@@ -38,17 +37,33 @@ struct PlayerStatus
int repeatPlayList; // 0 = Stop playing once the last element has been played, 1 = Never give up playing
};
+Q_DECLARE_METATYPE(PlayerStatus);
-class PlayerObject : public QDBusAbstractAdaptor
+class PlayerObject : public QObject
{
-Q_OBJECT
-Q_CLASSINFO("D-Bus Interface", "org.freedesktop.MediaPlayer")
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.freedesktop.MediaPlayer")
public:
PlayerObject(QObject *parent = 0);
~PlayerObject();
+
+ enum PlayerCaps
+ {
+
+ NONE = 0,
+ CAN_GO_NEXT = 1 << 0,
+ CAN_GO_PREV = 1 << 1,
+ CAN_PAUSE = 1 << 2,
+ CAN_PLAY = 1 << 3,
+ CAN_SEEK = 1 << 4,
+ CAN_PROVIDE_METADATA = 1 << 5,
+ CAN_HAS_TRACKLIST = 1 << 6
+ };
+
+
public slots:
void Next();
void Prev();
@@ -58,16 +73,21 @@ public slots:
//void Repeat();
PlayerStatus GetStatus();
QVariantMap GetMetadata();
- //GetCaps
+ int GetCaps();
void VolumeSet(int in0);
int VolumeGet();
void PositionSet(int in0);
- qint64 PositionGet();
+ int PositionGet();
signals:
- //TrackChange
- //StatusChange
- //CapsChange
+ void CapsChange(int);
+ void TrackChange(QVariantMap);
+ void StatusChange(PlayerStatus);
+
+private slots:
+ void updateCaps();
+ void updateTrack();
+ void updateStatus();
private:
SoundCore *m_core;