Refactor metadata and internal data structures
Replace Metadata.h with Containers.h, introducing a HashTable implementation with SIMD acceleration and specialized track tracking. Cleanup PlayerEngine logic by merging it into the playback flow and refactoring several internal API signatures.
This commit is contained in:
+14
-8
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../include/Metadata.h"
|
||||
#include "../include/Containers.h"
|
||||
#include "../include/PlaybackEngine.h"
|
||||
#include "../include/miniaudio.h"
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using Queue = std::vector<Track>;
|
||||
using trackVec = std::vector<Track>;
|
||||
using ht = HashTable;
|
||||
|
||||
class Player {
|
||||
public:
|
||||
@@ -33,16 +34,16 @@ class Player {
|
||||
virtual std::string &getAlbum () const;
|
||||
virtual unsigned int getTrackNr () const;
|
||||
|
||||
// Player Queue
|
||||
Queue getQueue () const;
|
||||
Queue clearQueue ();
|
||||
// Player trackVec
|
||||
trackVec getQueue () const;
|
||||
trackVec clearQueue ();
|
||||
void addToQueue ( Track &track );
|
||||
Queue rempveFromQueue ( Track &track );
|
||||
Queue shuffleQueue ();
|
||||
trackVec rempveFromQueue ( Track &track );
|
||||
trackVec shuffleQueue ();
|
||||
|
||||
protected:
|
||||
PlaybackEngine PE_;
|
||||
Queue queue_;
|
||||
trackVec queue_;
|
||||
|
||||
private:
|
||||
std::string artist_;
|
||||
@@ -53,4 +54,9 @@ class Player {
|
||||
|
||||
unsigned int samplerate_ = 48000;
|
||||
unsigned int channels_ = 2;
|
||||
|
||||
trackVec tracks;
|
||||
ht songs;
|
||||
ht artists;
|
||||
ht albums;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user