Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
Jellyfin::ViewModel::PlaybackManager Class Reference

The PlaybackManager class manages the playback of Jellyfin items. More...

#include <playbackmanager.h>

Inheritance diagram for Jellyfin::ViewModel::PlaybackManager:

Public Slots

void playItem (Item *item)
 playItem Replaces the current queue and plays the given item.
 
void playItem (QSharedPointer< Model::Item > item)
 
void playItemId (const QString &itemId)
 playItem Replaces the current queue and plays the item with the given id.
 
void playItemInList (ItemModel *itemList, int index)
 
void skipToItemIndex (int index)
 skipToItemIndex Skips to an item in the current playlist
 
void play ()
 
void pause ()
 
void seek (qint64 pos)
 
void stop ()
 
void previous ()
 previous Play the previous track in the current playlist.
 
void next ()
 next Play the next track in the current playlist.
 
void handlePlaystateRequest (const DTO::PlaystateRequest &request)
 

Signals

void itemChanged ()
 
void controllingSessionChanged ()
 
void controllingSessionIdChanged ()
 
void controllingSessionNameChanged ()
 
void controllingSessionLocalChanged ()
 
void streamUrlChanged (const QString &newStreamUrl)
 
void autoOpenChanged (bool autoOpen)
 
void audioIndexChanged (int audioIndex)
 
void subtitleIndexChanged (int subtitleIndex)
 
void mediaPlayerChanged (QObject *newMediaPlayer)
 
void resumePlaybackChanged (bool newResumePlayback)
 
void playMethodChanged (PlayMethod newPlayMethod)
 
void seeked (qint64 newPosition)
 
void hasNextChanged (bool newHasNext)
 
void hasPreviousChanged (bool newHasPrevious)
 
void mediaObjectChanged (QObject *newPlayer)
 
void positionChanged (qint64 newPosition)
 
void durationChanged (qint64 newDuration)
 
void queueChanged (QAbstractItemModel *newQueue)
 
void queueIndexChanged (int newIndex)
 
void playbackStateChanged (Jellyfin::Model::PlayerStateClass::Value newState)
 
void mediaStatusChanged (Jellyfin::Model::MediaStatusClass::Value newMediaStatus)
 
void hasVideoChanged (bool newHasVideo)
 
void seekableChanged (bool newSeekable)
 
void errorChanged (QMediaPlayer::Error newError)
 
void errorStringChanged (const QString &newErrorString)
 
void handlePlaystateCommandsChanged (bool newHandlePlaystateCommands)
 

Public Member Functions

 PlaybackManager (QObject *parent=nullptr)
 
virtual ~PlaybackManager ()
 
ApiClientapiClient () const
 
void setApiClient (ApiClient *apiClient)
 
bool resumePlayback () const
 
void setResumePlayback (bool newResumePlayback)
 
int audioIndex () const
 
void setAudioIndex (int newAudioIndex)
 
int subtitleIndex () const
 
void setSubtitleIndex (int newAudioIndex)
 
ViewModel::Itemitem () const
 
QSharedPointer< Model::ItemdataItem () const
 
QSharedPointer< Model::ControllableSessioncontrollingSession () const
 
void setControllingSession (QSharedPointer< Model::ControllableSession > session)
 
QString controllingSessionId () const
 
QString controllingSessionName () const
 
bool controllingSessionLocal () const
 
QString streamUrl () const
 
PlayMethod playMethod () const
 
qint64 position () const
 
qint64 duration () const
 
ViewModel::Playlistqueue () const
 
int queueIndex () const
 
bool hasNext () const
 
bool hasPrevious () const
 
QObject * mediaObject () const
 
Model::PlayerState playbackState () const
 
Model::MediaStatus mediaStatus () const
 
bool hasVideo () const
 
bool seekable () const
 
QMediaPlayer::Error error () const
 
QString errorString () const
 
bool handlePlaystateCommands () const
 
void setHandlePlaystateCommands (bool newHandlePlaystateCommands)
 

Properties

ApiClientapiClient
 
QString controllingSessionId
 
QString controllingSessionName
 
bool controllingSessionLocal
 
int audioIndex
 
int subtitleIndex
 
QString streamUrl
 
bool resumePlayback
 
Jellyfin::DTO::PlayMethodClass::Value playMethod
 
QObject * item
 
int queueIndex
 
Jellyfin::ViewModel::Playlistqueue
 
qint64 duration
 
QMediaPlayer::Error error
 
QString errorString
 
bool hasVideo
 
bool seekable
 
QObject * mediaObject
 
Jellyfin::Model::MediaStatusClass::Value mediaStatus
 
Jellyfin::Model::PlayerStateClass::Value playbackState
 
qint64 position
 
bool hasNext
 
bool hasPrevious
 
bool handlePlaystateCommands
 Whether playstate commands received over the websocket should be handled.
 

Detailed Description

The PlaybackManager class manages the playback of Jellyfin items.

It is a small wrapper around an instance of Jellyfin::Model::PlaybackManager, which do the actual work. The Jellyfin::Model::PlaybackManager can be switched on the fly, allowing this class to switch between controlling the playback locally or remote.

Constructor & Destructor Documentation

◆ PlaybackManager()

Jellyfin::ViewModel::PlaybackManager::PlaybackManager ( QObject * parent = nullptr)
explicit

◆ ~PlaybackManager()

Jellyfin::ViewModel::PlaybackManager::~PlaybackManager ( )
virtual

Member Function Documentation

◆ apiClient()

ApiClient * Jellyfin::ViewModel::PlaybackManager::apiClient ( ) const

◆ audioIndex()

int Jellyfin::ViewModel::PlaybackManager::audioIndex ( ) const

◆ audioIndexChanged

void Jellyfin::ViewModel::PlaybackManager::audioIndexChanged ( int audioIndex)
signal

◆ autoOpenChanged

void Jellyfin::ViewModel::PlaybackManager::autoOpenChanged ( bool autoOpen)
signal

◆ controllingSession()

QSharedPointer< Model::ControllableSession > Jellyfin::ViewModel::PlaybackManager::controllingSession ( ) const

◆ controllingSessionChanged

void Jellyfin::ViewModel::PlaybackManager::controllingSessionChanged ( )
signal

◆ controllingSessionId()

QString Jellyfin::ViewModel::PlaybackManager::controllingSessionId ( ) const

◆ controllingSessionIdChanged

void Jellyfin::ViewModel::PlaybackManager::controllingSessionIdChanged ( )
signal

◆ controllingSessionLocal()

bool Jellyfin::ViewModel::PlaybackManager::controllingSessionLocal ( ) const

◆ controllingSessionLocalChanged

void Jellyfin::ViewModel::PlaybackManager::controllingSessionLocalChanged ( )
signal

◆ controllingSessionName()

QString Jellyfin::ViewModel::PlaybackManager::controllingSessionName ( ) const

◆ controllingSessionNameChanged

void Jellyfin::ViewModel::PlaybackManager::controllingSessionNameChanged ( )
signal

◆ dataItem()

QSharedPointer< Model::Item > Jellyfin::ViewModel::PlaybackManager::dataItem ( ) const

◆ duration()

qint64 Jellyfin::ViewModel::PlaybackManager::duration ( ) const

◆ durationChanged

void Jellyfin::ViewModel::PlaybackManager::durationChanged ( qint64 newDuration)
signal

◆ error()

QMediaPlayer::Error Jellyfin::ViewModel::PlaybackManager::error ( ) const

◆ errorChanged

void Jellyfin::ViewModel::PlaybackManager::errorChanged ( QMediaPlayer::Error newError)
signal

◆ errorString()

QString Jellyfin::ViewModel::PlaybackManager::errorString ( ) const

◆ errorStringChanged

void Jellyfin::ViewModel::PlaybackManager::errorStringChanged ( const QString & newErrorString)
signal

◆ handlePlaystateCommands()

bool Jellyfin::ViewModel::PlaybackManager::handlePlaystateCommands ( ) const

◆ handlePlaystateCommandsChanged

void Jellyfin::ViewModel::PlaybackManager::handlePlaystateCommandsChanged ( bool newHandlePlaystateCommands)
signal

◆ handlePlaystateRequest

void Jellyfin::ViewModel::PlaybackManager::handlePlaystateRequest ( const DTO::PlaystateRequest & request)
slot

◆ hasNext()

bool Jellyfin::ViewModel::PlaybackManager::hasNext ( ) const

◆ hasNextChanged

void Jellyfin::ViewModel::PlaybackManager::hasNextChanged ( bool newHasNext)
signal

◆ hasPrevious()

bool Jellyfin::ViewModel::PlaybackManager::hasPrevious ( ) const

◆ hasPreviousChanged

void Jellyfin::ViewModel::PlaybackManager::hasPreviousChanged ( bool newHasPrevious)
signal

◆ hasVideo()

bool Jellyfin::ViewModel::PlaybackManager::hasVideo ( ) const

◆ hasVideoChanged

void Jellyfin::ViewModel::PlaybackManager::hasVideoChanged ( bool newHasVideo)
signal

◆ item()

ViewModel::Item * Jellyfin::ViewModel::PlaybackManager::item ( ) const

◆ itemChanged

void Jellyfin::ViewModel::PlaybackManager::itemChanged ( )
signal

◆ mediaObject()

QObject * Jellyfin::ViewModel::PlaybackManager::mediaObject ( ) const

◆ mediaObjectChanged

void Jellyfin::ViewModel::PlaybackManager::mediaObjectChanged ( QObject * newPlayer)
signal

◆ mediaPlayerChanged

void Jellyfin::ViewModel::PlaybackManager::mediaPlayerChanged ( QObject * newMediaPlayer)
signal

◆ mediaStatus()

Model::MediaStatus Jellyfin::ViewModel::PlaybackManager::mediaStatus ( ) const

◆ mediaStatusChanged

void Jellyfin::ViewModel::PlaybackManager::mediaStatusChanged ( Jellyfin::Model::MediaStatusClass::Value newMediaStatus)
signal

◆ next

void Jellyfin::ViewModel::PlaybackManager::next ( )
slot

next Play the next track in the current playlist.

◆ pause

void Jellyfin::ViewModel::PlaybackManager::pause ( )
slot

◆ play

void Jellyfin::ViewModel::PlaybackManager::play ( )
slot

◆ playbackState()

Model::PlayerState Jellyfin::ViewModel::PlaybackManager::playbackState ( ) const

◆ playbackStateChanged

void Jellyfin::ViewModel::PlaybackManager::playbackStateChanged ( Jellyfin::Model::PlayerStateClass::Value newState)
signal

◆ playItem [1/2]

void Jellyfin::ViewModel::PlaybackManager::playItem ( Item * item)
slot

playItem Replaces the current queue and plays the given item.

This will construct the Jellyfin::Item internally and delete it later.

Parameters
itemThe item to play.

◆ playItem [2/2]

void Jellyfin::ViewModel::PlaybackManager::playItem ( QSharedPointer< Model::Item > item)
slot

◆ playItemId

void Jellyfin::ViewModel::PlaybackManager::playItemId ( const QString & itemId)
slot

playItem Replaces the current queue and plays the item with the given id.

This will construct the Jellyfin::Item internally and delete it later.

Parameters
itemThe itemId to play.

◆ playItemInList

void Jellyfin::ViewModel::PlaybackManager::playItemInList ( ItemModel * itemList,
int index )
slot

◆ playMethod()

PlayMethod Jellyfin::ViewModel::PlaybackManager::playMethod ( ) const

◆ playMethodChanged

void Jellyfin::ViewModel::PlaybackManager::playMethodChanged ( PlayMethod newPlayMethod)
signal

◆ position()

qint64 Jellyfin::ViewModel::PlaybackManager::position ( ) const

◆ positionChanged

void Jellyfin::ViewModel::PlaybackManager::positionChanged ( qint64 newPosition)
signal

◆ previous

void Jellyfin::ViewModel::PlaybackManager::previous ( )
slot

previous Play the previous track in the current playlist.

◆ queue()

ViewModel::Playlist * Jellyfin::ViewModel::PlaybackManager::queue ( ) const

◆ queueChanged

void Jellyfin::ViewModel::PlaybackManager::queueChanged ( QAbstractItemModel * newQueue)
signal

◆ queueIndex()

int Jellyfin::ViewModel::PlaybackManager::queueIndex ( ) const

◆ queueIndexChanged

void Jellyfin::ViewModel::PlaybackManager::queueIndexChanged ( int newIndex)
signal

◆ resumePlayback()

bool Jellyfin::ViewModel::PlaybackManager::resumePlayback ( ) const

◆ resumePlaybackChanged

void Jellyfin::ViewModel::PlaybackManager::resumePlaybackChanged ( bool newResumePlayback)
signal

◆ seek

void Jellyfin::ViewModel::PlaybackManager::seek ( qint64 pos)
slot

◆ seekable()

bool Jellyfin::ViewModel::PlaybackManager::seekable ( ) const

◆ seekableChanged

void Jellyfin::ViewModel::PlaybackManager::seekableChanged ( bool newSeekable)
signal

◆ seeked

void Jellyfin::ViewModel::PlaybackManager::seeked ( qint64 newPosition)
signal

◆ setApiClient()

void Jellyfin::ViewModel::PlaybackManager::setApiClient ( ApiClient * apiClient)

◆ setAudioIndex()

void Jellyfin::ViewModel::PlaybackManager::setAudioIndex ( int newAudioIndex)

◆ setControllingSession()

void Jellyfin::ViewModel::PlaybackManager::setControllingSession ( QSharedPointer< Model::ControllableSession > session)

◆ setHandlePlaystateCommands()

void Jellyfin::ViewModel::PlaybackManager::setHandlePlaystateCommands ( bool newHandlePlaystateCommands)

◆ setResumePlayback()

void Jellyfin::ViewModel::PlaybackManager::setResumePlayback ( bool newResumePlayback)

◆ setSubtitleIndex()

void Jellyfin::ViewModel::PlaybackManager::setSubtitleIndex ( int newAudioIndex)

◆ skipToItemIndex

void Jellyfin::ViewModel::PlaybackManager::skipToItemIndex ( int index)
slot

skipToItemIndex Skips to an item in the current playlist

Parameters
indexThe index to skip to

◆ stop

void Jellyfin::ViewModel::PlaybackManager::stop ( )
slot

◆ streamUrl()

QString Jellyfin::ViewModel::PlaybackManager::streamUrl ( ) const

◆ streamUrlChanged

void Jellyfin::ViewModel::PlaybackManager::streamUrlChanged ( const QString & newStreamUrl)
signal

◆ subtitleIndex()

int Jellyfin::ViewModel::PlaybackManager::subtitleIndex ( ) const

◆ subtitleIndexChanged

void Jellyfin::ViewModel::PlaybackManager::subtitleIndexChanged ( int subtitleIndex)
signal

Property Documentation

◆ apiClient

ApiClient * Jellyfin::ViewModel::PlaybackManager::apiClient
readwrite

◆ audioIndex

int Jellyfin::ViewModel::PlaybackManager::audioIndex
readwrite

◆ controllingSessionId

QString Jellyfin::ViewModel::PlaybackManager::controllingSessionId
read

◆ controllingSessionLocal

bool Jellyfin::ViewModel::PlaybackManager::controllingSessionLocal
read

Whether the playback is done by this client

◆ controllingSessionName

QString Jellyfin::ViewModel::PlaybackManager::controllingSessionName
read

◆ duration

qint64 Jellyfin::ViewModel::PlaybackManager::duration
read

◆ error

QMediaPlayer::Error Jellyfin::ViewModel::PlaybackManager::error
read

◆ errorString

QString Jellyfin::ViewModel::PlaybackManager::errorString
read

◆ handlePlaystateCommands

bool Jellyfin::ViewModel::PlaybackManager::handlePlaystateCommands
readwrite

Whether playstate commands received over the websocket should be handled.

◆ hasNext

bool Jellyfin::ViewModel::PlaybackManager::hasNext
read

◆ hasPrevious

bool Jellyfin::ViewModel::PlaybackManager::hasPrevious
read

◆ hasVideo

bool Jellyfin::ViewModel::PlaybackManager::hasVideo
read

◆ item

QObject * Jellyfin::ViewModel::PlaybackManager::item
read

◆ mediaObject

QObject* Jellyfin::ViewModel::PlaybackManager::mediaObject
read

◆ mediaStatus

Jellyfin::Model::MediaStatusClass::Value Jellyfin::ViewModel::PlaybackManager::mediaStatus
read

◆ playbackState

Jellyfin::Model::PlayerStateClass::Value Jellyfin::ViewModel::PlaybackManager::playbackState
read

◆ playMethod

Jellyfin::DTO::PlayMethodClass::Value Jellyfin::ViewModel::PlaybackManager::playMethod
read

◆ position

qint64 Jellyfin::ViewModel::PlaybackManager::position
read

◆ queue

Jellyfin::ViewModel::Playlist * Jellyfin::ViewModel::PlaybackManager::queue
read

◆ queueIndex

int Jellyfin::ViewModel::PlaybackManager::queueIndex
read

◆ resumePlayback

bool Jellyfin::ViewModel::PlaybackManager::resumePlayback
readwrite

Whether the player should resume playback.

◆ seekable

bool Jellyfin::ViewModel::PlaybackManager::seekable
read

◆ streamUrl

QString Jellyfin::ViewModel::PlaybackManager::streamUrl
read

◆ subtitleIndex

int Jellyfin::ViewModel::PlaybackManager::subtitleIndex
readwrite

The documentation for this class was generated from the following files: