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

A shuffler that does not shuffle. More...

#include <shuffle.h>

Inheritance diagram for Jellyfin::Model::NoShuffle:
Jellyfin::Model::Shuffle Jellyfin::Model::ListShuffleBase Jellyfin::Model::SimpleListShuffle

Public Member Functions

 NoShuffle (const Playlist *parent)
 
virtual int currentItem () const override
 
virtual int nextItem () const override
 
virtual int itemAt (int index) const override
 Determine the item index at at the shuffled index.
 
virtual void previous () override
 The shuffle should determine the previous item.
 
virtual void next () override
 The shuffle should determine the next item.
 
virtual void setIndex (int i) override
 Set the index of the now playing item.
 
virtual bool hasPrevious () const override
 
virtual bool hasNext () const override
 
- Public Member Functions inherited from Jellyfin::Model::Shuffle
 Shuffle (const Playlist *parent)
 
virtual bool canShuffleInAdvance ()
 If this Shuffle implementation shuffles the entire list in advance.
 
virtual void shuffleInAdvance ()
 Shuffle the list in advance. Should only be called if canShuffleInAdvance() is called.
 
void setRepeatAll (bool repeatAll)
 Sets whether the shuffler to loop over the list if all items are played.
 

Protected Member Functions

int nextIndex () const
 
int previousIndex () const
 

Protected Attributes

int m_index = 0
 
- Protected Attributes inherited from Jellyfin::Model::Shuffle
const Playlistm_playlist
 Playlist that can be used to gather information about the songs if needed for the algorithm.
 
bool m_repeatAll = false
 

Additional Inherited Members

- Static Protected Member Functions inherited from Jellyfin::Model::Shuffle
static int random (int max, int min=0)
 

Detailed Description

A shuffler that does not shuffle.

Constructor & Destructor Documentation

◆ NoShuffle()

Jellyfin::Model::NoShuffle::NoShuffle ( const Playlist * parent)

Member Function Documentation

◆ currentItem()

int Jellyfin::Model::NoShuffle::currentItem ( ) const
overridevirtual
Returns
the index of the currently playing item

Reimplemented from Jellyfin::Model::Shuffle.

Reimplemented in Jellyfin::Model::ListShuffleBase.

◆ hasNext()

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

Reimplemented from Jellyfin::Model::Shuffle.

◆ hasPrevious()

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

Reimplemented from Jellyfin::Model::Shuffle.

◆ itemAt()

int Jellyfin::Model::NoShuffle::itemAt ( int index) const
overridevirtual

Determine the item index at at the shuffled index.

Parameters
indexThe shuffled index
Returns
The actual index

If canShuffleInAdvance() returns false, a new implemention is not needed or -1 may be returned. This function should not even be called in that case.

Reimplemented from Jellyfin::Model::Shuffle.

Reimplemented in Jellyfin::Model::ListShuffleBase.

◆ next()

void Jellyfin::Model::NoShuffle::next ( )
overridevirtual

The shuffle should determine the next item.

Reimplemented from Jellyfin::Model::Shuffle.

◆ nextIndex()

int Jellyfin::Model::NoShuffle::nextIndex ( ) const
protected

◆ nextItem()

int Jellyfin::Model::NoShuffle::nextItem ( ) const
overridevirtual
Returns
the index of the next item

Reimplemented from Jellyfin::Model::Shuffle.

Reimplemented in Jellyfin::Model::ListShuffleBase.

◆ previous()

void Jellyfin::Model::NoShuffle::previous ( )
overridevirtual

The shuffle should determine the previous item.

Reimplemented from Jellyfin::Model::Shuffle.

◆ previousIndex()

int Jellyfin::Model::NoShuffle::previousIndex ( ) const
protected

◆ setIndex()

void Jellyfin::Model::NoShuffle::setIndex ( int i)
overridevirtual

Set the index of the now playing item.

Parameters
i

Reimplemented from Jellyfin::Model::Shuffle.

Member Data Documentation

◆ m_index

int Jellyfin::Model::NoShuffle::m_index = 0
protected

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