19#ifndef JELLYFIN_VIEWMODEL_PLAYBACKMANAGER_H
20#define JELLYFIN_VIEWMODEL_PLAYBACKMANAGER_H
22#include <QAbstractItemModel>
26#include <QLoggingCategory>
28#include <QSharedPointer>
33#include <QtMultimedia/QMediaPlayer>
34#include <QtMultimedia/QMediaPlaylist>
79 Q_INTERFACES(QQmlParserStatus)
156 QMediaPlayer::Error
error () const;
222 void seek(qint64 pos);
238 void mediaPlayerItemChanged();
241 const static
int MS_TICK_FACTOR = 10000;
245 QMediaPlayer::Error m_error = QMediaPlayer::NoError;
248 void classBegin()
override { m_qmlIsParsingComponent =
true; }
249 void componentComplete()
override;
250 bool m_qmlIsParsingComponent =
false;
252 QScopedPointer<PlaybackManagerPrivate> d_ptr;
An Api client for Jellyfin. Handles requests and authentication.
Definition apiclient.h:90
Definition playmethod.h:46
Value
Definition playmethod.h:49
Definition playstaterequest.h:49
Base class for each model that works with items.
Definition itemmodel.h:360
Definition playbackmanager.cpp:46
The PlaybackManager class manages the playback of Jellyfin items.
Definition playbackmanager.h:76
void skipToItemIndex(int index)
skipToItemIndex Skips to an item in the current playlist
Definition playbackmanager.cpp:368
Jellyfin::Model::PlayerStateClass::Value playbackState
Definition playbackmanager.h:116
void controllingSessionNameChanged()
bool hasNext
Definition playbackmanager.h:118
QObject * mediaObject
Definition playbackmanager.h:114
void playItemId(const QString &itemId)
playItem Replaces the current queue and plays the item with the given id.
Definition playbackmanager.cpp:358
QString streamUrl
Definition playbackmanager.h:95
void playItemInList(ItemModel *itemList, int index)
Definition playbackmanager.cpp:363
void mediaPlayerChanged(QObject *newMediaPlayer)
void resumePlaybackChanged(bool newResumePlayback)
void seek(qint64 pos)
Definition playbackmanager.cpp:383
void mediaObjectChanged(QObject *newPlayer)
void seekableChanged(bool newSeekable)
void setControllingSession(QSharedPointer< Model::ControllableSession > session)
Definition playbackmanager.cpp:154
bool handlePlaystateCommands
Whether playstate commands received over the websocket should be handled.
Definition playbackmanager.h:121
int queueIndex
Definition playbackmanager.h:105
qint64 duration
Definition playbackmanager.h:109
bool controllingSessionLocal
Definition playbackmanager.h:91
void setApiClient(ApiClient *apiClient)
Definition playbackmanager.cpp:84
void positionChanged(qint64 newPosition)
void queueChanged(QAbstractItemModel *newQueue)
void stop()
Definition playbackmanager.cpp:389
QObject * item
Definition playbackmanager.h:104
void setHandlePlaystateCommands(bool newHandlePlaystateCommands)
Definition playbackmanager.cpp:327
bool seekable
Definition playbackmanager.h:113
bool resumePlayback
Definition playbackmanager.h:100
void durationChanged(qint64 newDuration)
void audioIndexChanged(int audioIndex)
void controllingSessionChanged()
void hasPreviousChanged(bool newHasPrevious)
PlaybackManager(QObject *parent=nullptr)
Definition playbackmanager.cpp:74
bool hasVideo
Definition playbackmanager.h:112
Jellyfin::DTO::PlayMethodClass::Value playMethod
Definition playbackmanager.h:101
void queueIndexChanged(int newIndex)
virtual ~PlaybackManager()
Definition playbackmanager.cpp:80
void errorChanged(QMediaPlayer::Error newError)
void playItem(Item *item)
playItem Replaces the current queue and plays the given item.
Definition playbackmanager.cpp:348
qint64 position
Definition playbackmanager.h:117
void previous()
previous Play the previous track in the current playlist.
Definition playbackmanager.cpp:399
void play()
Definition playbackmanager.cpp:373
void playbackStateChanged(Jellyfin::Model::PlayerStateClass::Value newState)
QString controllingSessionId
Definition playbackmanager.h:86
void playMethodChanged(PlayMethod newPlayMethod)
void controllingSessionLocalChanged()
QString controllingSessionName
Definition playbackmanager.h:87
void pause()
Definition playbackmanager.cpp:378
void hasVideoChanged(bool newHasVideo)
bool hasPrevious
Definition playbackmanager.h:119
void setResumePlayback(bool newResumePlayback)
Definition playbackmanager.cpp:110
ApiClient * apiClient
Definition playbackmanager.h:85
void setSubtitleIndex(int newAudioIndex)
Definition playbackmanager.cpp:130
void handlePlaystateCommandsChanged(bool newHandlePlaystateCommands)
QString errorString
Definition playbackmanager.h:111
Jellyfin::ViewModel::Playlist * queue
Definition playbackmanager.h:106
void setAudioIndex(int newAudioIndex)
Definition playbackmanager.cpp:120
void streamUrlChanged(const QString &newStreamUrl)
QSharedPointer< Model::Item > dataItem() const
Definition playbackmanager.cpp:139
void hasNextChanged(bool newHasNext)
void controllingSessionIdChanged()
int audioIndex
Definition playbackmanager.h:93
void errorStringChanged(const QString &newErrorString)
void handlePlaystateRequest(const DTO::PlaystateRequest &request)
Definition playbackmanager.cpp:404
Jellyfin::Model::MediaStatusClass::Value mediaStatus
Definition playbackmanager.h:115
void subtitleIndexChanged(int subtitleIndex)
void seeked(qint64 newPosition)
void autoOpenChanged(bool autoOpen)
QSharedPointer< Model::ControllableSession > controllingSession() const
Definition playbackmanager.cpp:149
void mediaStatusChanged(Jellyfin::Model::MediaStatusClass::Value newMediaStatus)
void next()
next Play the next track in the current playlist.
Definition playbackmanager.cpp:394
int subtitleIndex
Definition playbackmanager.h:94
QMediaPlayer::Error error
Definition playbackmanager.h:110
Playlist/queue that can be exposed to QML.
Definition playlist.h:54
Jellyfin::DTO::PlaystateRequest PlaystateRequest
Definition playstaterequest.h:106
Q_DECLARE_LOGGING_CATEGORY(playbackManager)