inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
QueueState Struct Reference

Represents the state of the song queue. More...

#include <state.hpp>

Public Member Functions

void clearQueue ()
 Clears the song queue.
 
void incrementQIndex ()
 Increments the queue index.
 
void decrementQIndex ()
 Decrements the queue index.
 
void insertSongToIndex (const Song &newSong)
 Inserts a song at the current index in the queue.
 
void qPush (const Song &song)
 Pushes a song to the end of the queue.
 
void qPopIndex ()
 Pops the song at the current screen index from the queue.
 
auto getQueueSize () -> int
 Returns the current size of the song queue.
 
auto GetCurrentSongFromQueue () -> Song *
 Retrieves the current song from the queue.
 
void UpdateSongQueueList ()
 Updates the list of song names in the queue.
 

Public Attributes

vector< Songsong_queue
 
vector< string > song_queue_names
 
int qIndex = 0
 
int qScreenIndex = 0
 

Detailed Description

Represents the state of the song queue.

This structure holds the song queue and the indices for navigating and managing the queue.

Member Function Documentation

◆ clearQueue()

void QueueState::clearQueue ( )
inline

Clears the song queue.

This method removes all songs from the queue and resets the queue index.

◆ decrementQIndex()

void QueueState::decrementQIndex ( )
inline

Decrements the queue index.

This method decrements the index to point to the previous song in the queue.

◆ GetCurrentSongFromQueue()

auto QueueState::GetCurrentSongFromQueue ( ) -> Song*
inline

Retrieves the current song from the queue.

This method returns a pointer to the song currently selected in the queue.

Returns
A pointer to the current song in the queue, or nullptr if the queue is empty.

◆ getQueueSize()

auto QueueState::getQueueSize ( ) -> int
inline

Returns the current size of the song queue.

This method returns the number of songs currently in the queue.

Returns
The size of the song queue.

◆ incrementQIndex()

void QueueState::incrementQIndex ( )
inline

Increments the queue index.

This method increments the index to point to the next song in the queue.

◆ insertSongToIndex()

void QueueState::insertSongToIndex ( const Song & newSong)
inline

Inserts a song at the current index in the queue.

This method inserts a new song at the position immediately after the current queue index.

Parameters
newSongThe song to insert into the queue.

◆ qPopIndex()

void QueueState::qPopIndex ( )
inline

Pops the song at the current screen index from the queue.

This method removes the song at the current screen index from the queue.

◆ qPush()

void QueueState::qPush ( const Song & song)
inline

Pushes a song to the end of the queue.

This method appends a song to the end of the song queue.

Parameters
songThe song to add to the queue.

◆ UpdateSongQueueList()

void QueueState::UpdateSongQueueList ( )
inline

Updates the list of song names in the queue.

This method updates the song_queue_names list with the names of the songs from the queue, marking the current song with an asterisk.

Member Data Documentation

◆ qIndex

int QueueState::qIndex = 0

Index of the current song in the queue

◆ qScreenIndex

int QueueState::qScreenIndex = 0

Index of the current song being displayed on the screen

◆ song_queue

vector<Song> QueueState::song_queue

The list of songs in the queue

◆ song_queue_names

vector<string> QueueState::song_queue_names

The list of song names in the queue


The documentation for this struct was generated from the following file: