aboutsummaryrefslogtreecommitdiff
path: root/mpris-plugin/qmpmprisimpl.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2023-11-26 01:10:36 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2023-11-26 01:10:36 -0500
commit60989e52b3f3bc0a95d3e61bd8e59fa4d9b7ab83 (patch)
treeaf08e5b6f7019c6f70bf3800a419ec78db140988 /mpris-plugin/qmpmprisimpl.hpp
parent382d85b15ce9cc4580a2522b39f5dd4ce43a24b0 (diff)
downloadQMidiPlayer-60989e52b3f3bc0a95d3e61bd8e59fa4d9b7ab83.tar.xz
The 2 year constipation. (mpris plugin)
Probably buggy as hell.
Diffstat (limited to 'mpris-plugin/qmpmprisimpl.hpp')
-rw-r--r--mpris-plugin/qmpmprisimpl.hpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/mpris-plugin/qmpmprisimpl.hpp b/mpris-plugin/qmpmprisimpl.hpp
new file mode 100644
index 0000000..b9dec93
--- /dev/null
+++ b/mpris-plugin/qmpmprisimpl.hpp
@@ -0,0 +1,72 @@
+#ifndef QMPMPRISIMPL_HPP
+#define QMPMPRISIMPL_HPP
+
+#include "qmprisdbusinterface.hpp"
+
+class qmpPluginAPI;
+class qmpMainWindow;
+
+class QMPPlayer : public QMPrisPlayer
+{
+public:
+ explicit QMPPlayer(qmpPluginAPI *_api, QObject *parent=nullptr);
+
+ QString getPlaybackStatus();
+ QString getLoopStatus();
+ double getRate();
+ bool getShuffle();
+ QVariantMap getMetadata();
+ //double getVolume();
+ qlonglong getPosition();
+ //double getMinimumRate();
+ //double getMaximumRate();
+ bool getCanGoNext();
+ bool getCanGoPrevious();
+ bool getCanPlay();
+ bool getCanPause();
+ bool getCanSeek();
+ bool getCanControl();
+
+ void Pause();
+ void PlayPause();
+ void Stop();
+ void Play();
+ void Next();
+ void Previous();
+ void Seek(qlonglong t);
+ void SetPosition(QDBusObjectPath o, qlonglong t);
+private:
+ qmpPluginAPI *api;
+ qmpMainWindow *qmw;
+};
+
+class QMPTrackList : public QMPrisTrackList
+{
+public:
+ explicit QMPTrackList(qmpPluginAPI *_api, QObject *parent=nullptr);
+
+ QList<QVariantMap> GetTracksMetaData(QList<QDBusObjectPath> trackIds);
+ QList<QDBusObjectPath> getTracks();
+private:
+ qmpPluginAPI *api;
+};
+
+class QMPMediaPlayer2 : public QMPrisMediaPlayer2
+{
+public:
+ explicit QMPMediaPlayer2(qmpPluginAPI *_api, QObject *parent=nullptr);
+
+ void Raise() override;
+ void Quit() override;
+
+ bool getCanQuit() override;
+ bool getCanRaise() override;
+ QString getIdentity() override;
+ QString getDesktopEntry() override;
+ bool getHasTrackList() override;
+private:
+ qmpPluginAPI *api;
+ qmpMainWindow *qmw;
+};
+
+#endif