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

A shuffler that is pretty random. Does not care about repeating items in a list. More...

#include <shuffle.h>

Inheritance diagram for Jellyfin::Model::RandomShuffle:
Jellyfin::Model::Shuffle

Public Member Functions

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

Protected Attributes

int m_previous
 
int m_current
 
int m_next = -1
 
- 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 is pretty random. Does not care about repeating items in a list.

Constructor & Destructor Documentation

◆ RandomShuffle()

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

Member Function Documentation

◆ canShuffleInAdvance()

bool Jellyfin::Model::RandomShuffle::canShuffleInAdvance ( )
overridevirtual

If this Shuffle implementation shuffles the entire list in advance.

Returns
True if this shuffle class shuffles the entire list in advance

Some shuffle implementations may only shuffle the next item as they go.

Reimplemented from Jellyfin::Model::Shuffle.

◆ currentItem()

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

Reimplemented from Jellyfin::Model::Shuffle.

◆ hasNext()

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

Reimplemented from Jellyfin::Model::Shuffle.

◆ hasPrevious()

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

Reimplemented from Jellyfin::Model::Shuffle.

◆ next()

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

The shuffle should determine the next item.

Reimplemented from Jellyfin::Model::Shuffle.

◆ nextItem()

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

Reimplemented from Jellyfin::Model::Shuffle.

◆ previous()

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

The shuffle should determine the previous item.

Reimplemented from Jellyfin::Model::Shuffle.

Member Data Documentation

◆ m_current

int Jellyfin::Model::RandomShuffle::m_current
protected

◆ m_next

int Jellyfin::Model::RandomShuffle::m_next = -1
protected

◆ m_previous

int Jellyfin::Model::RandomShuffle::m_previous
protected

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