19#ifndef JELLYFIN_MODEL_PLAYLIST_H
20#define JELLYFIN_MODEL_PLAYLIST_H
23#include <QSharedPointer>
50 explicit Playlist(QObject *parent =
nullptr);
81 int listSize()
const {
return m_list.size(); };
82 int totalSize()
const {
return m_queue.size() + m_list.size(); }
89 QSharedPointer<const Item>
listAt(
int index)
const;
96 QSharedPointer<const Item>
queueAt(
int index)
const;
118 void play(
int index = 0);
142 QSharedPointer<Item> m_currentItem;
143 bool m_currentItemFromQueue =
false;
144 QSharedPointer<Item> m_nextItem;
145 bool m_nextItemFromQueue =
false;
148 QVector<QSharedPointer<Item>> m_queue;
150 QVector<QSharedPointer<Item>> m_list;
Model of a playlist, a list of items that can be played.
Definition playlist.h:47
int currentItemIndexInList() const
Definition playlist.cpp:131
void previous()
Determine the previous item to be played.
Definition playlist.cpp:42
QSharedPointer< const Item > listAt(int index) const
Returns the item at the given index of the currently selected playlist, excluding the queue.
Definition playlist.cpp:115
void next()
Determine the next item to be played.
Definition playlist.cpp:65
bool hasNext()
Definition playlist.cpp:61
void clearList()
Removes all the items from the playlist, but not from the queue.
Definition playlist.cpp:30
void itemsRemovedFromQueue()
void beforeItemsAddedToList(int index, int count)
QSharedPointer< const Item > queueAt(int index) const
Returns the item at the given index of the currently queue, excluding the playlist.
Definition playlist.cpp:123
void beforeItemsRemovedFromQueue(int index, int count)
bool hasPrevious()
Definition playlist.cpp:38
void beforeItemsRemovedFromList(int index, int count)
void itemsRemovedFromList()
void currentItemChanged()
QSharedPointer< Item > currentItem()
Returns the current item in the queue.
Definition playlist.cpp:127
Playlist(QObject *parent=nullptr)
Definition playlist.cpp:26
QList< QSharedPointer< Item > > queueAndList() const
Returns all items in the queue.
Definition playlist.cpp:107
QSharedPointer< Item > nextItem()
Definition playlist.cpp:139
int listSize() const
Definition playlist.h:81
void beforeItemsAddedToQueue(int index, int count)
int totalSize() const
Definition playlist.h:82
bool playingFromQueue() const
playingFromQueue
Definition playlist.cpp:207
void play(int index=0)
Start playing this playlist.
Definition playlist.cpp:182
int queueSize()
Definition playlist.h:80
void appendToList(const QList< QSharedPointer< Item > > &model)
Appends all items from the given item list to this list.
Interface for an algorithm shuffling a playlist.
Definition shuffle.h:32
Definition mediaplayer2.h:20