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

Controls playback whithin this app. More...

#include <playbackmanager.h>

Inheritance diagram for Jellyfin::Model::LocalPlaybackManager:
Jellyfin::Model::PlaybackManager

Public Slots

void pause () override
 
void play () override
 
void playItem (QSharedPointer< Model::Item > item) override
 
void playItemId (const QString &itemId) override
 
void next () override
 
void previous () override
 
void stop () override
 
void seek (qint64 pos) override
 
void goTo (int index) override
 
- Public Slots inherited from Jellyfin::Model::PlaybackManager
virtual void pause ()=0
 
virtual void play ()=0
 
virtual void playItemId (const QString &id)=0
 
virtual void previous ()=0
 
virtual void next ()=0
 
virtual void goTo (int index)=0
 Play the item at the index in the current playlist.
 
virtual void stop ()=0
 
virtual void seek (qint64 pos)=0
 

Signals

void playerChanged (Jellyfin::Model::Player *newPlayer)
 
void playMethodChanged (Jellyfin::DTO::PlayMethodClass::Value newPlayMethod)
 
void streamUrlChanged (const QUrl &newStreamUrl)
 
- Signals inherited from Jellyfin::Model::PlaybackManager
void playbackStateChanged (Jellyfin::Model::PlayerStateClass::Value newPlaybackState)
 
void mediaStatusChanged (Jellyfin::Model::MediaStatusClass::Value newMediaStatus)
 
void queueChanged (Jellyfin::Model::Playlist *newPlaylist)
 
void hasNextChanged (bool newHasNext)
 
void hasPreviousChanged (bool newHasPrevious)
 
void itemChanged ()
 
void queueIndexChanged (int index)
 
void errorChanged (Jellyfin::Model::PlaybackManagerErrorClass::Value newError)
 
void errorStringChanged (const QString &newErrorString)
 
void positionChanged (qint64 newPosition)
 
void durationChanged (qint64 newDuration)
 
void seekableChanged (bool newSeekable)
 
void hasAudioChanged ()
 
void hasVideoChanged ()
 
void resumePlaybackChanged (bool newPlaybackChanged)
 
void audioIndexChanged (int newAudioIndex)
 
void subtitleIndexChanged (int newSubtitleIndex)
 

Public Member Functions

 LocalPlaybackManager (QObject *parent=nullptr)
 
Playerplayer () const
 
QString sessionId () const
 
DTO::PlayMethod playMethod () const
 
const QUrl & streamUrl () const
 
PlayerState playbackState () const override
 
MediaStatus mediaStatus () const override
 
PlaybackManagerError error () const override
 
const QString & errorString () const override
 
qint64 position () const override
 
qint64 duration () const override
 
bool seekable () const override
 
bool hasAudio () const override
 
bool hasVideo () const override
 
bool hasNext () const override
 
bool hasPrevious () const override
 
void playItemInList (const QList< QSharedPointer< Model::Item > > &items, int index) override
 Set the playlist to the given playlist and start playing the item at the given index.
 
- Public Member Functions inherited from Jellyfin::Model::PlaybackManager
 PlaybackManager (QObject *parent=nullptr)
 
virtual ~PlaybackManager ()
 
void swap (PlaybackManager &other)
 
ApiClientapiClient () const
 
void setApiClient (ApiClient *apiClient)
 
QSharedPointer< ItemcurrentItem () const
 
Playlistqueue () const
 
int queueIndex () const
 
bool resumePlayback () const
 
void setResumePlayback (bool newResumePlayback)
 
int audioIndex () const
 
void setAudioIndex (int newAudioIndex)
 
int subtitleIndex () const
 
void setSubtitleIndex (int newSubtitleIndex)
 
virtual void playItem (QSharedPointer< Model::Item > item)=0
 Start playing the given item.
 

Properties

Jellyfin::Model::Playerplayer
 
Jellyfin::DTO::PlayMethodClass::Value playMethod
 
QUrl streamUrl
 
- Properties inherited from Jellyfin::Model::PlaybackManager
bool resumePlayback
 
int audioIndex
 
int subtitleIndex
 
qint64 position
 The position in ticks in the currently playing item.
 
qint64 duration
 The duration in ticks of the currently playing item.
 
bool seekable
 Whether the playbackmanager is currently able to seek.
 
bool hasAudio
 Whether the currently playing item has audio.
 
bool hasVideo
 Whether the currently playing item has video.
 
Jellyfin::Model::PlayerStateClass::Value playbackState
 
Jellyfin::Model::MediaStatusClass::Value mediaStatus
 
int queueIndex
 

Additional Inherited Members

- Static Public Attributes inherited from Jellyfin::Model::PlaybackManager
static const qint64 MS_TICK_FACTOR = 10000
 
- Protected Member Functions inherited from Jellyfin::Model::PlaybackManager
void setItem (QSharedPointer< Item > item)
 
void setQueueIndex (int index)
 
 PlaybackManager (PlaybackManagerPrivate *d, QObject *parent=nullptr)
 
- Protected Attributes inherited from Jellyfin::Model::PlaybackManager
QScopedPointer< PlaybackManagerPrivated_ptr
 

Detailed Description

Controls playback whithin this app.

This class mostly consists of bookkeeping between the actual media player implementation (which is abstracted into yet another class) and the ViewModel.

It does things like:

  • Fetching the actual media URL of an item and deciding which playback method to use
  • Managing the current playlist state and instructing the media player which item to play next
  • Keeping track of the playback state that the user would expect from a media player, instead of what the media player implementation reports.

Constructor & Destructor Documentation

◆ LocalPlaybackManager()

Jellyfin::Model::LocalPlaybackManager::LocalPlaybackManager ( QObject * parent = nullptr)
explicit

Member Function Documentation

◆ duration()

qint64 Jellyfin::Model::LocalPlaybackManager::duration ( ) const
overridevirtual

◆ error()

PlaybackManagerError Jellyfin::Model::LocalPlaybackManager::error ( ) const
overridevirtual

◆ errorString()

const QString & Jellyfin::Model::LocalPlaybackManager::errorString ( ) const
overridevirtual

◆ goTo

void Jellyfin::Model::LocalPlaybackManager::goTo ( int index)
overrideslot

◆ hasAudio()

bool Jellyfin::Model::LocalPlaybackManager::hasAudio ( ) const
overridevirtual

◆ hasNext()

bool Jellyfin::Model::LocalPlaybackManager::hasNext ( ) const
overridevirtual

◆ hasPrevious()

bool Jellyfin::Model::LocalPlaybackManager::hasPrevious ( ) const
overridevirtual

◆ hasVideo()

bool Jellyfin::Model::LocalPlaybackManager::hasVideo ( ) const
overridevirtual

◆ mediaStatus()

MediaStatus Jellyfin::Model::LocalPlaybackManager::mediaStatus ( ) const
overridevirtual

◆ next

void Jellyfin::Model::LocalPlaybackManager::next ( )
overrideslot

◆ pause

void Jellyfin::Model::LocalPlaybackManager::pause ( )
overrideslot

◆ play

void Jellyfin::Model::LocalPlaybackManager::play ( )
overrideslot

◆ playbackState()

PlayerState Jellyfin::Model::LocalPlaybackManager::playbackState ( ) const
overridevirtual

◆ player()

Player * Jellyfin::Model::LocalPlaybackManager::player ( ) const

◆ playerChanged

void Jellyfin::Model::LocalPlaybackManager::playerChanged ( Jellyfin::Model::Player * newPlayer)
signal

◆ playItem

void Jellyfin::Model::LocalPlaybackManager::playItem ( QSharedPointer< Model::Item > item)
overrideslot

◆ playItemId

void Jellyfin::Model::LocalPlaybackManager::playItemId ( const QString & itemId)
overrideslot

◆ playItemInList()

void Jellyfin::Model::LocalPlaybackManager::playItemInList ( const QList< QSharedPointer< Model::Item > > & items,
int index )
overridevirtual

Set the playlist to the given playlist and start playing the item at the given index.

Parameters
itemsThe list of items to play
indexIndex of the item to play

Implements Jellyfin::Model::PlaybackManager.

◆ playMethod()

DTO::PlayMethod Jellyfin::Model::LocalPlaybackManager::playMethod ( ) const

◆ playMethodChanged

void Jellyfin::Model::LocalPlaybackManager::playMethodChanged ( Jellyfin::DTO::PlayMethodClass::Value newPlayMethod)
signal

◆ position()

qint64 Jellyfin::Model::LocalPlaybackManager::position ( ) const
overridevirtual

◆ previous

void Jellyfin::Model::LocalPlaybackManager::previous ( )
overrideslot

◆ seek

void Jellyfin::Model::LocalPlaybackManager::seek ( qint64 pos)
overrideslot

◆ seekable()

bool Jellyfin::Model::LocalPlaybackManager::seekable ( ) const
overridevirtual

◆ sessionId()

QString Jellyfin::Model::LocalPlaybackManager::sessionId ( ) const

◆ stop

void Jellyfin::Model::LocalPlaybackManager::stop ( )
overrideslot

◆ streamUrl()

const QUrl & Jellyfin::Model::LocalPlaybackManager::streamUrl ( ) const

◆ streamUrlChanged

void Jellyfin::Model::LocalPlaybackManager::streamUrlChanged ( const QUrl & newStreamUrl)
signal

Property Documentation

◆ player

Jellyfin::Model::Player * Jellyfin::Model::LocalPlaybackManager::player
read

◆ playMethod

Jellyfin::DTO::PlayMethodClass::Value Jellyfin::Model::LocalPlaybackManager::playMethod
read

◆ streamUrl

QUrl Jellyfin::Model::LocalPlaybackManager::streamUrl
read

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