Changeset View
Changeset View
Standalone View
Standalone View
plugins/mpriscontrol/mpriscontrolplugin.h
Show All 22 Lines | |||||
23 | 23 | | |||
24 | #include <QString> | 24 | #include <QString> | ||
25 | #include <QHash> | 25 | #include <QHash> | ||
26 | #include <QLoggingCategory> | 26 | #include <QLoggingCategory> | ||
27 | #include <QDBusServiceWatcher> | 27 | #include <QDBusServiceWatcher> | ||
28 | 28 | | |||
29 | #include <core/kdeconnectplugin.h> | 29 | #include <core/kdeconnectplugin.h> | ||
30 | 30 | | |||
31 | #define PACKAGE_TYPE_MPRIS QStringLiteral("kdeconnect.mpris") | 31 | #define PACKET_TYPE_MPRIS QStringLiteral("kdeconnect.mpris") | ||
32 | 32 | | |||
33 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRIS) | 33 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRIS) | ||
34 | 34 | | |||
35 | class MprisControlPlugin | 35 | class MprisControlPlugin | ||
36 | : public KdeConnectPlugin | 36 | : public KdeConnectPlugin | ||
37 | { | 37 | { | ||
38 | Q_OBJECT | 38 | Q_OBJECT | ||
39 | 39 | | |||
40 | public: | 40 | public: | ||
41 | explicit MprisControlPlugin(QObject* parent, const QVariantList& args); | 41 | explicit MprisControlPlugin(QObject* parent, const QVariantList& args); | ||
42 | 42 | | |||
43 | bool receivePackage(const NetworkPackage& np) override; | 43 | bool receivePacket(const NetworkPacket& np) override; | ||
44 | void connected() override { } | 44 | void connected() override { } | ||
45 | 45 | | |||
46 | private Q_SLOTS: | 46 | private Q_SLOTS: | ||
47 | void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties); | 47 | void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties); | ||
48 | void seeked(qlonglong); | 48 | void seeked(qlonglong); | ||
49 | 49 | | |||
50 | private: | 50 | private: | ||
51 | void serviceOwnerChanged(const QString& serviceName, const QString& oldOwner, const QString& newOwner); | 51 | void serviceOwnerChanged(const QString& serviceName, const QString& oldOwner, const QString& newOwner); | ||
52 | void addPlayer(const QString& ifaceName); | 52 | void addPlayer(const QString& ifaceName); | ||
53 | void removePlayer(const QString& ifaceName); | 53 | void removePlayer(const QString& ifaceName); | ||
54 | void sendPlayerList(); | 54 | void sendPlayerList(); | ||
55 | void mprisPlayerMetadataToNetworkPackage(NetworkPackage& np, const QVariantMap& nowPlayingMap) const; | 55 | void mprisPlayerMetadataToNetworkPacket(NetworkPacket& np, const QVariantMap& nowPlayingMap) const; | ||
56 | 56 | | |||
57 | QHash<QString, QString> playerList; | 57 | QHash<QString, QString> playerList; | ||
58 | int prevVolume; | 58 | int prevVolume; | ||
59 | QDBusServiceWatcher* m_watcher; | 59 | QDBusServiceWatcher* m_watcher; | ||
60 | 60 | | |||
61 | }; | 61 | }; | ||
62 | 62 | | |||
63 | #endif | 63 | #endif |