Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Toggle main menu visibility
Loading...
Searching...
No Matches
platformmediacontrol.h
Go to the documentation of this file.
1
/*
2
* Sailfin: a Jellyfin client written using Qt
3
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
#ifndef JELLYFIN_VIEWMODEL_PLATFORMMEDIACONTROL_H
20
#define JELLYFIN_VIEWMODEL_PLATFORMMEDIACONTROL_H
21
22
#include <QObject>
23
#include <QQmlParserStatus>
24
#include <QScopedPointer>
25
26
namespace
Jellyfin
{
27
namespace
ViewModel
{
28
29
class
PlatformMediaControlPrivate
;
30
class
PlaybackManager
;
31
35
class
PlatformMediaControl
:
public
QObject,
public
QQmlParserStatus {
36
Q_OBJECT
37
Q_INTERFACES(QQmlParserStatus)
38
public
:
39
explicit
PlatformMediaControl
(QObject *parent =
nullptr
);
40
41
Q_PROPERTY(
Jellyfin::ViewModel::PlaybackManager
*
playbackManager
READ
playbackManager
WRITE
setPlaybackManager
NOTIFY
playbackManagerChanged
)
46
Q_PROPERTY(
bool
canQuit
READ
canQuit
WRITE
setCanQuit
NOTIFY
canQuitChanged
)
47
Q_PROPERTY(
bool
canRaise
READ
canRaise
WRITE
setCanRaise
NOTIFY
canRaiseChanged
)
48
Q_PROPERTY(QString
playerName
READ
playerName
WRITE
setPlayerName
NOTIFY
playerNameChanged
)
49
Q_PROPERTY(QString
desktopFile
READ
playerName
WRITE
setPlayerName
NOTIFY
playerNameChanged
)
50
51
PlaybackManager
*
playbackManager
()
const
{
return
m_playbackManager; };
52
53
void
setPlaybackManager
(
PlaybackManager
*newPlaybackManager) {
54
m_playbackManager = newPlaybackManager;
55
emit
playbackManagerChanged
(newPlaybackManager);
56
};
57
58
bool
canQuit
()
const
{
return
m_canQuit; };
59
void
setCanQuit
(
bool
newCanQuit) {
60
m_canQuit = newCanQuit;
61
emit
canQuitChanged
(newCanQuit);
62
}
63
64
void
requestQuit
() {
65
emit
quitRequested
();
66
}
67
68
bool
canRaise
()
const
{
return
m_canRaise; };
69
void
setCanRaise
(
bool
newCanRaise) {
70
m_canRaise = newCanRaise;
71
emit
canRaiseChanged
(newCanRaise);
72
}
73
74
void
requestRaise
() {
75
emit
raiseRequested
();
76
};;
77
78
QString
playerName
()
const
{
return
m_playerName; }
79
void
setPlayerName
(QString newPlayerName) {
80
m_playerName = newPlayerName;
81
emit
playerNameChanged
(newPlayerName);
82
}
83
84
QString
desktopFile
()
const
{
return
m_desktopFile; }
85
void
setDesktopFile
(QString newDesktopFile) {
86
m_desktopFile = newDesktopFile;
87
emit
desktopFileChanged
(newDesktopFile);
88
}
89
90
void
classBegin
()
override
{
91
m_isParsing =
true
;
92
}
93
void
componentComplete
()
override
{
94
m_isParsing =
false
;
95
setup();
96
}
97
98
99
100
signals:
101
void
playbackManagerChanged
(
PlaybackManager
*newPlaybackManager);
102
void
canQuitChanged
(
bool
newCanQuit);
103
void
canRaiseChanged
(
bool
newCanRaise);
104
void
playerNameChanged
(QString newPlayerName);
105
void
desktopFileChanged
(QString newDesktopFile);
106
107
void
quitRequested
();
108
void
raiseRequested
();
109
110
private
:
111
Q_DECLARE_PRIVATE(
PlatformMediaControl
)
112
PlatformMediaControlPrivate
* d_ptr;
113
void
setup();
114
bool
m_isParsing =
false
;
115
116
PlaybackManager
*m_playbackManager =
nullptr
;
117
bool
m_canQuit =
false
;
118
bool
m_canRaise =
false
;
119
QString m_playerName = QStringLiteral(
"JellyfinQt"
);
120
QString m_desktopFile = QStringLiteral(
"sailfin"
);
121
};
122
123
124
}
// NS ViewModel
125
}
// NS Jellyfin
126
127
#endif
// PLATFORMMEDIACONTROL_H
Jellyfin::ViewModel::PlatformMediaControlPrivate
Definition
platformmediacontrol_freedesktop.cpp:34
Jellyfin::ViewModel::PlatformMediaControl::canQuit
bool canQuit
Definition
platformmediacontrol.h:46
Jellyfin::ViewModel::PlatformMediaControl::playerName
QString playerName() const
Definition
platformmediacontrol.h:78
Jellyfin::ViewModel::PlatformMediaControl::canRaise
bool canRaise() const
Definition
platformmediacontrol.h:68
Jellyfin::ViewModel::PlatformMediaControl::raiseRequested
void raiseRequested()
Jellyfin::ViewModel::PlatformMediaControl::playbackManagerChanged
void playbackManagerChanged(PlaybackManager *newPlaybackManager)
Jellyfin::ViewModel::PlatformMediaControl::PlatformMediaControl
PlatformMediaControl(QObject *parent=nullptr)
Definition
platformmediacontrol_freedesktop.cpp:51
Jellyfin::ViewModel::PlatformMediaControl::playerName
QString playerName
Definition
platformmediacontrol.h:48
Jellyfin::ViewModel::PlatformMediaControl::requestQuit
void requestQuit()
Definition
platformmediacontrol.h:64
Jellyfin::ViewModel::PlatformMediaControl::setDesktopFile
void setDesktopFile(QString newDesktopFile)
Definition
platformmediacontrol.h:85
Jellyfin::ViewModel::PlatformMediaControl::canRaiseChanged
void canRaiseChanged(bool newCanRaise)
Jellyfin::ViewModel::PlatformMediaControl::canRaise
bool canRaise
Definition
platformmediacontrol.h:47
Jellyfin::ViewModel::PlatformMediaControl::componentComplete
void componentComplete() override
Definition
platformmediacontrol.h:93
Jellyfin::ViewModel::PlatformMediaControl::canQuit
bool canQuit() const
Definition
platformmediacontrol.h:58
Jellyfin::ViewModel::PlatformMediaControl::classBegin
void classBegin() override
Definition
platformmediacontrol.h:90
Jellyfin::ViewModel::PlatformMediaControl::requestRaise
void requestRaise()
Definition
platformmediacontrol.h:74
Jellyfin::ViewModel::PlatformMediaControl::setPlaybackManager
void setPlaybackManager(PlaybackManager *newPlaybackManager)
Definition
platformmediacontrol.h:53
Jellyfin::ViewModel::PlatformMediaControl::quitRequested
void quitRequested()
Jellyfin::ViewModel::PlatformMediaControl::canQuitChanged
void canQuitChanged(bool newCanQuit)
Jellyfin::ViewModel::PlatformMediaControl::playbackManager
Jellyfin::ViewModel::PlaybackManager * playbackManager
Definition
platformmediacontrol.h:41
Jellyfin::ViewModel::PlatformMediaControl::desktopFileChanged
void desktopFileChanged(QString newDesktopFile)
Jellyfin::ViewModel::PlatformMediaControl::desktopFile
QString desktopFile
Definition
platformmediacontrol.h:49
Jellyfin::ViewModel::PlatformMediaControl::setCanQuit
void setCanQuit(bool newCanQuit)
Definition
platformmediacontrol.h:59
Jellyfin::ViewModel::PlatformMediaControl::setPlayerName
void setPlayerName(QString newPlayerName)
Definition
platformmediacontrol.h:79
Jellyfin::ViewModel::PlatformMediaControl::setCanRaise
void setCanRaise(bool newCanRaise)
Definition
platformmediacontrol.h:69
Jellyfin::ViewModel::PlatformMediaControl::desktopFile
QString desktopFile() const
Definition
platformmediacontrol.h:84
Jellyfin::ViewModel::PlatformMediaControl::playerNameChanged
void playerNameChanged(QString newPlayerName)
Jellyfin::ViewModel::PlaybackManager
The PlaybackManager class manages the playback of Jellyfin items.
Definition
playbackmanager.h:76
Jellyfin::ViewModel
Contains all types exposed to QML.
Jellyfin
core
include
JellyfinQt
viewmodel
platformmediacontrol.h
Generated by
1.17.0