20c0f9744f
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.
63 lines
1.3 KiB
C++
63 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "../include/Containers.h"
|
|
#include "../include/PlaybackEngine.h"
|
|
#include "../include/miniaudio.h"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
using trackVec = std::vector<Track>;
|
|
using ht = HashTable;
|
|
|
|
class Player {
|
|
public:
|
|
virtual ~Player ();
|
|
|
|
virtual void initPlayer ();
|
|
virtual void loadFile ( Track track );
|
|
|
|
// Transport Control
|
|
virtual void play ();
|
|
virtual void stop ();
|
|
virtual void pause ();
|
|
virtual void previous ();
|
|
virtual void next ();
|
|
|
|
virtual ma_uint64 getPlayheadPosition ();
|
|
virtual void setPlayheadPosition () const;
|
|
|
|
// get Metadat
|
|
virtual std::string &getArtist () const;
|
|
virtual std::string &getTitle () const;
|
|
virtual std::string &getAlbum () const;
|
|
virtual unsigned int getTrackNr () const;
|
|
|
|
// Player trackVec
|
|
trackVec getQueue () const;
|
|
trackVec clearQueue ();
|
|
void addToQueue ( Track &track );
|
|
trackVec rempveFromQueue ( Track &track );
|
|
trackVec shuffleQueue ();
|
|
|
|
protected:
|
|
PlaybackEngine PE_;
|
|
trackVec queue_;
|
|
|
|
private:
|
|
std::string artist_;
|
|
std::string title_;
|
|
std::string album_;
|
|
std::string trackNr_;
|
|
std::string filePath_;
|
|
|
|
unsigned int samplerate_ = 48000;
|
|
unsigned int channels_ = 2;
|
|
|
|
trackVec tracks;
|
|
ht songs;
|
|
ht artists;
|
|
ht albums;
|
|
};
|