now I actually implemented the shuffle button

This commit is contained in:
Crylia
2024-03-27 02:42:29 +01:00
parent 8070db4d5f
commit 067c339fc9
5 changed files with 11 additions and 9 deletions

View File

@@ -1,7 +1,5 @@
#include "ConditionalCircularLinkedList.h"
ConditionalCircularLinkedList::ConditionalCircularLinkedList( ) { }
void ConditionalCircularLinkedList::Append(Song* song) {
Node* newNode = new Node(song);
if (head == nullptr) {

View File

@@ -22,8 +22,8 @@ private:
// Variable to either link or unlink the list
bool isLinked;
public:
ConditionalCircularLinkedList( );
ConditionalCircularLinkedList(bool isLinked) : head(nullptr), isLinked(isLinked) { }
ConditionalCircularLinkedList( ) : head(nullptr), isLinked(false), current(nullptr) { }
ConditionalCircularLinkedList(bool isLinked) : head(nullptr), isLinked(isLinked), current(nullptr) { }
/**
* @brief Append a new song to the queue

View File

@@ -1,7 +1,7 @@
#include "SongQueue.h"
SongQueue::SongQueue( ) {
queue = new ConditionalCircularLinkedList( );
queue = new ConditionalCircularLinkedList(false);
// Its never going to be linked, I'm just too lazy to make a new implementation thats almost the same
priorityQueue = new ConditionalCircularLinkedList(false);
@@ -77,6 +77,7 @@ void SongQueue::MoveSongInPriorityQueue(Song* songToMove, Song* otherSong, bool
}
void SongQueue::ShufflePlaylist( ) {
if (queue && queue->IsEmpty( )) return;
//First backup the original list state
queue_original = new ConditionalCircularLinkedList(queue);