Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
mediaplayer2player.h
Go to the documentation of this file.
1/*
2 * This file was generated by qdbusxml2cpp version 0.8
3 * Command line was: qdbusxml2cpp org.mpris.MediaPlayer2.Player.xml -a ../include/JellyfinQt/platform/freedesktop/mediaplayer2player.h:../src/platform/freedesktop/mediaplayer2player.cpp
4 *
5 * qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
6 *
7 * This is an auto-generated file.
8 * This file may have been hand-edited. Look for HAND-EDIT comments
9 * before re-generating it.
10 */
11
12//HAND-EDIT: include-guard
13#ifndef JELLYFIN_PLATFORM_FREEDESKTOP_MEDIAPLAYER2PLAYER_H
14#define JELLYFIN_PLATFORM_FREEDESKTOP_MEDIAPLAYER2PLAYER_H
15
16#include <QtCore/QObject>
17#include <QtDBus/QtDBus>
18#include <QMediaPlayer>
20
21QT_BEGIN_NAMESPACE
22class QByteArray;
23template<class T> class QList;
24template<class Key, class Value> class QMap;
25class QString;
26class QStringList;
27class QVariant;
28QT_END_NAMESPACE
29
30//HAND-EDIT: added namespaces
31namespace Jellyfin {
32namespace ViewModel {
33 class Item;
34 class PlatformMediaControl;
35 class PlaybackManager;
36}
37
38namespace Platform {
39namespace FreeDesktop {
40/*
41 * Adaptor class for interface org.mpris.MediaPlayer2.Player
42 */
43class PlayerAdaptor: public QDBusAbstractAdaptor
44{
45 Q_OBJECT
46 Q_CLASSINFO("D-Bus Interface", "org.mpris.MediaPlayer2.Player")
47 Q_CLASSINFO("D-Bus Introspection", ""
48" <interface name=\"org.mpris.MediaPlayer2.Player\">\n"
49" <method name=\"Next\">\n"
50" </method>\n"
51" <method name=\"Previous\">\n"
52" </method>\n"
53" <method name=\"Pause\">\n"
54" </method>\n"
55" <method name=\"PlayPause\">\n"
56" </method>\n"
57" <method name=\"Stop\">\n"
58" </method>\n"
59" <method name=\"Play\">\n"
60" </method>\n"
61" <method name=\"Seek\">\n"
62" <arg direction=\"in\" type=\"x\" name=\"Offset\"/>\n"
63" </method>\n"
64" <method name=\"SetPosition\">\n"
65" <arg direction=\"in\" type=\"o\" name=\"TrackId\"/>\n"
66" <arg direction=\"in\" type=\"x\" name=\"Position\"/>\n"
67" </method>\n"
68" <method name=\"OpenUri\">\n"
69" <arg direction=\"in\" type=\"s\" name=\"Uri\"/>\n"
70" </method>\n"
71" <property access=\"read\" type=\"s\" name=\"PlaybackStatus\">\n"
72" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
73" </property>\n"
74" <property access=\"readwrite\" type=\"s\" name=\"LoopStatus\">\n"
75" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
76" <annotation value=\"true\" name=\"org.mpris.MediaPlayer2.property.optional\"/>\n"
77" </property>\n"
78" <property access=\"readwrite\" type=\"d\" name=\"Rate\">\n"
79" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
80" </property>\n"
81" <property access=\"readwrite\" type=\"b\" name=\"Shuffle\">\n"
82" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
83" <annotation value=\"true\" name=\"org.mpris.MediaPlayer2.property.optional\"/>\n"
84" </property>\n"
85" <property access=\"read\" type=\"a{sv}\" name=\"Metadata\">\n"
86" <annotation value=\"QVariantMap\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
87" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
88" </property>\n"
89" <property access=\"readwrite\" type=\"d\" name=\"Volume\">\n"
90" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
91" </property>\n"
92" <property access=\"read\" type=\"x\" name=\"Position\">\n"
93" <annotation value=\"false\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
94" </property>\n"
95" <property access=\"read\" type=\"d\" name=\"MinimumRate\">\n"
96" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
97" </property>\n"
98" <property access=\"read\" type=\"d\" name=\"MaximumRate\">\n"
99" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
100" </property>\n"
101" <property access=\"read\" type=\"b\" name=\"CanGoNext\">\n"
102" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
103" </property>\n"
104" <property access=\"read\" type=\"b\" name=\"CanGoPrevious\">\n"
105" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
106" </property>\n"
107" <property access=\"read\" type=\"b\" name=\"CanPlay\">\n"
108" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
109" </property>\n"
110" <property access=\"read\" type=\"b\" name=\"CanPause\">\n"
111" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
112" </property>\n"
113" <property access=\"read\" type=\"b\" name=\"CanSeek\">\n"
114" <annotation value=\"true\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
115" </property>\n"
116" <property access=\"read\" type=\"b\" name=\"CanControl\">\n"
117" <annotation value=\"false\" name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\"/>\n"
118" </property>\n"
119" <signal name=\"Seeked\">\n"
120" <arg type=\"x\" name=\"Position\"/>\n"
121" </signal>\n"
122" </interface>\n"
123 "")
124public:
126 virtual ~PlayerAdaptor();
127
128public: // PROPERTIES
129 Q_PROPERTY(bool CanControl READ canControl)
130 bool canControl() const;
131
132 Q_PROPERTY(bool CanGoNext READ canGoNext)
133 bool canGoNext() const;
134
135 Q_PROPERTY(bool CanGoPrevious READ canGoPrevious)
136 bool canGoPrevious() const;
137
138 Q_PROPERTY(bool CanPause READ canPause)
139 bool canPause() const;
140
141 Q_PROPERTY(bool CanPlay READ canPlay)
142 bool canPlay() const;
143
144 Q_PROPERTY(bool CanSeek READ canSeek)
145 bool canSeek() const;
146
147 Q_PROPERTY(QString LoopStatus READ loopStatus WRITE setLoopStatus)
148 QString loopStatus() const;
149 void setLoopStatus(const QString &value);
150
151 Q_PROPERTY(double MaximumRate READ maximumRate)
152 double maximumRate() const;
153
154 Q_PROPERTY(QVariantMap Metadata READ metadata)
155 QVariantMap metadata() const;
156
157 Q_PROPERTY(double MinimumRate READ minimumRate)
158 double minimumRate() const;
159
160 Q_PROPERTY(QString PlaybackStatus READ playbackStatus)
161 QString playbackStatus() const;
162
163 Q_PROPERTY(qlonglong Position READ position)
164 qlonglong position() const;
165
166 Q_PROPERTY(double Rate READ rate WRITE setRate)
167 double rate() const;
168 void setRate(double value);
169
170 Q_PROPERTY(bool Shuffle READ shuffle WRITE setShuffle)
171 bool shuffle() const;
172 void setShuffle(bool value);
173
174 Q_PROPERTY(double Volume READ volume WRITE setVolume)
175 double volume() const;
176 void setVolume(double value);
177
178public Q_SLOTS: // METHODS
179 void Next();
180 void OpenUri(const QString &Uri);
181 void Pause();
182 void Play();
183 void PlayPause();
184 void Previous();
185 void Seek(qlonglong Offset);
186 void SetPosition(const QDBusObjectPath &TrackId, qlonglong Position);
187 void Stop();
188Q_SIGNALS: // SIGNALS
189 void Seeked(qlonglong Position);
190
191private:
192 ViewModel::PlatformMediaControl *m_mediaControl;
193 void notifyPropertiesChanged(QStringList properties);
194private slots:
195 void onCurrentItemChanged();
196 void onPlaybackStateChanged(Jellyfin::Model::PlayerStateClass::Value state);
197 void onMediaStatusChanged(Jellyfin::Model::MediaStatusClass::Value status);
198 void onPositionChanged(qint64 position);
199 void onSeekableChanged(bool seekable);
200 void onPlaybackManagerChanged(ViewModel::PlaybackManager *newPlaybackManager);
201 void onSeeked(qint64 newPosition);
202};
203
204} // NS FreeDesktop
205} // NS Platform
206} // NS Jellyfin
207
208#endif
Value
Definition player.h:48
Value
Definition player.h:35
Definition mediaplayer2player.h:44
double MaximumRate
Definition mediaplayer2player.h:151
double MinimumRate
Definition mediaplayer2player.h:157
double Volume
Definition mediaplayer2player.h:174
QString LoopStatus
Definition mediaplayer2player.h:147
double volume() const
Definition mediaplayer2player.cpp:214
QVariantMap Metadata
Definition mediaplayer2player.h:154
double rate() const
Definition mediaplayer2player.cpp:190
bool CanSeek
Definition mediaplayer2player.h:144
QString playbackStatus() const
Definition mediaplayer2player.cpp:165
void Next()
Definition mediaplayer2player.cpp:226
void setRate(double value)
Definition mediaplayer2player.cpp:196
void Stop()
Definition mediaplayer2player.cpp:281
bool canSeek() const
Definition mediaplayer2player.cpp:76
void Pause()
Definition mediaplayer2player.cpp:238
bool CanPlay
Definition mediaplayer2player.h:141
bool shuffle() const
Definition mediaplayer2player.cpp:202
void OpenUri(const QString &Uri)
Definition mediaplayer2player.cpp:232
void Previous()
Definition mediaplayer2player.cpp:261
bool canGoPrevious() const
Definition mediaplayer2player.cpp:58
bool canGoNext() const
Definition mediaplayer2player.cpp:52
bool canPlay() const
Definition mediaplayer2player.cpp:70
void Seek(qlonglong Offset)
Definition mediaplayer2player.cpp:267
double Rate
Definition mediaplayer2player.h:166
qlonglong position() const
Definition mediaplayer2player.cpp:184
double maximumRate() const
Definition mediaplayer2player.cpp:94
void Play()
Definition mediaplayer2player.cpp:244
double minimumRate() const
Definition mediaplayer2player.cpp:159
void SetPosition(const QDBusObjectPath &TrackId, qlonglong Position)
Definition mediaplayer2player.cpp:273
bool CanGoNext
Definition mediaplayer2player.h:132
QString loopStatus() const
Definition mediaplayer2player.cpp:82
void setShuffle(bool value)
Definition mediaplayer2player.cpp:208
QString PlaybackStatus
Definition mediaplayer2player.h:160
void PlayPause()
Definition mediaplayer2player.cpp:250
void setLoopStatus(const QString &value)
Definition mediaplayer2player.cpp:88
void setVolume(double value)
Definition mediaplayer2player.cpp:220
bool CanPause
Definition mediaplayer2player.h:138
bool CanControl
Definition mediaplayer2player.h:129
bool Shuffle
Definition mediaplayer2player.h:170
bool CanGoPrevious
Definition mediaplayer2player.h:135
bool canPause() const
Definition mediaplayer2player.cpp:64
bool canControl() const
Definition mediaplayer2player.cpp:46
QVariantMap metadata() const
Definition mediaplayer2player.cpp:100
qlonglong Position
Definition mediaplayer2player.h:163
Exposes media control and information to the OS. Uses MPRIS on FreeDesktop-enabled systems.
Definition platformmediacontrol.h:35
The PlaybackManager class manages the playback of Jellyfin items.
Definition playbackmanager.h:76
Definition mediaplayer2.h:20
Definition mediaplayer2.h:21