now I actually implemented the shuffle button
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#include "ConditionalCircularLinkedList.h"
|
||||
|
||||
ConditionalCircularLinkedList::ConditionalCircularLinkedList( ) { }
|
||||
|
||||
void ConditionalCircularLinkedList::Append(Song* song) {
|
||||
Node* newNode = new Node(song);
|
||||
if (head == nullptr) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user