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

Model of a playlist, a list of items that can be played. More...

#include <playlist.h>

Inheritance diagram for Jellyfin::Model::Playlist:

Signals

void beforeListCleared ()
 
void listCleared ()
 
void beforeItemsAddedToQueue (int index, int count)
 
void beforeItemsAddedToList (int index, int count)
 
void itemsAddedToQueue ()
 
void itemsAddedToList ()
 
void beforeItemsRemovedFromQueue (int index, int count)
 
void beforeItemsRemovedFromList (int index, int count)
 
void itemsRemovedFromQueue ()
 
void itemsRemovedFromList ()
 
void listReshuffled ()
 
void currentItemChanged ()
 

Public Member Functions

 Playlist (QObject *parent=nullptr)
 
QSharedPointer< ItemcurrentItem ()
 Returns the current item in the queue.
 
QSharedPointer< ItemnextItem ()
 
int currentItemIndexInList () const
 
bool hasPrevious ()
 
void previous ()
 Determine the previous item to be played.
 
bool hasNext ()
 
void next ()
 Determine the next item to be played.
 
QList< QSharedPointer< Item > > queueAndList () const
 Returns all items in the queue.
 
int queueSize ()
 
int listSize () const
 
int totalSize () const
 
QSharedPointer< const ItemlistAt (int index) const
 Returns the item at the given index of the currently selected playlist, excluding the queue.
 
QSharedPointer< const ItemqueueAt (int index) const
 Returns the item at the given index of the currently queue, excluding the playlist.
 
void clearList ()
 Removes all the items from the playlist, but not from the queue.
 
void appendToList (const QList< QSharedPointer< Item > > &model)
 Appends all items from the given item list to this list.
 
void appendToList (QSharedPointer< Model::Item > item)
 appendToList Appends a single item to the current list
 
void play (int index=0)
 Start playing this playlist.
 
bool playingFromQueue () const
 playingFromQueue
 

Detailed Description

Model of a playlist, a list of items that can be played.

This tries to take the managing what items to play away from the PlaybackManager, which now only will be informed about the current and next item to play.

The playlist has actually two list, one named list and the other named queue. When playing, the queue has priority over the list and will not be affected by the shuffle mode. After all items of the queue are played, the items in the list are played. Items in the list may be shuffled.

Constructor & Destructor Documentation

◆ Playlist()

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

Member Function Documentation

◆ appendToList() [1/2]

void Jellyfin::Model::Playlist::appendToList ( const QList< QSharedPointer< Item > > & model)

Appends all items from the given item list to this list.

◆ appendToList() [2/2]

void Jellyfin::Model::Playlist::appendToList ( QSharedPointer< Model::Item > item)

appendToList Appends a single item to the current list

Parameters
itemThe item to append

◆ beforeItemsAddedToList

void Jellyfin::Model::Playlist::beforeItemsAddedToList ( int index,
int count )
signal

◆ beforeItemsAddedToQueue

void Jellyfin::Model::Playlist::beforeItemsAddedToQueue ( int index,
int count )
signal

◆ beforeItemsRemovedFromList

void Jellyfin::Model::Playlist::beforeItemsRemovedFromList ( int index,
int count )
signal

◆ beforeItemsRemovedFromQueue

void Jellyfin::Model::Playlist::beforeItemsRemovedFromQueue ( int index,
int count )
signal

◆ beforeListCleared

void Jellyfin::Model::Playlist::beforeListCleared ( )
signal

◆ clearList()

void Jellyfin::Model::Playlist::clearList ( )

Removes all the items from the playlist, but not from the queue.

◆ currentItem()

QSharedPointer< Item > Jellyfin::Model::Playlist::currentItem ( )

Returns the current item in the queue.

◆ currentItemChanged

void Jellyfin::Model::Playlist::currentItemChanged ( )
signal

◆ currentItemIndexInList()

int Jellyfin::Model::Playlist::currentItemIndexInList ( ) const
Returns
the current index of the playing item if it is in the list. If playing from the queue, returns -1.

◆ hasNext()

bool Jellyfin::Model::Playlist::hasNext ( )

◆ hasPrevious()

bool Jellyfin::Model::Playlist::hasPrevious ( )

◆ itemsAddedToList

void Jellyfin::Model::Playlist::itemsAddedToList ( )
signal

◆ itemsAddedToQueue

void Jellyfin::Model::Playlist::itemsAddedToQueue ( )
signal

◆ itemsRemovedFromList

void Jellyfin::Model::Playlist::itemsRemovedFromList ( )
signal

◆ itemsRemovedFromQueue

void Jellyfin::Model::Playlist::itemsRemovedFromQueue ( )
signal

◆ listAt()

QSharedPointer< const Item > Jellyfin::Model::Playlist::listAt ( int index) const

Returns the item at the given index of the currently selected playlist, excluding the queue.

Parameters
index
Returns
The given item.

◆ listCleared

void Jellyfin::Model::Playlist::listCleared ( )
signal

◆ listReshuffled

void Jellyfin::Model::Playlist::listReshuffled ( )
signal

◆ listSize()

int Jellyfin::Model::Playlist::listSize ( ) const
inline

◆ next()

void Jellyfin::Model::Playlist::next ( )

Determine the next item to be played.

◆ nextItem()

QSharedPointer< Item > Jellyfin::Model::Playlist::nextItem ( )

◆ play()

void Jellyfin::Model::Playlist::play ( int index = 0)

Start playing this playlist.

Parameters
indexThe index to start from.

◆ playingFromQueue()

bool Jellyfin::Model::Playlist::playingFromQueue ( ) const

playingFromQueue

Returns
True if the currently played item comes from the queue.

◆ previous()

void Jellyfin::Model::Playlist::previous ( )

Determine the previous item to be played.

◆ queueAndList()

QList< QSharedPointer< Item > > Jellyfin::Model::Playlist::queueAndList ( ) const

Returns all items in the queue.

◆ queueAt()

QSharedPointer< const Item > Jellyfin::Model::Playlist::queueAt ( int index) const

Returns the item at the given index of the currently queue, excluding the playlist.

Parameters
index
Returns
The given item.

◆ queueSize()

int Jellyfin::Model::Playlist::queueSize ( )
inline

◆ totalSize()

int Jellyfin::Model::Playlist::totalSize ( ) const
inline

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