05bd44a354
- Replace `Tag` class with utility helpers for hashing and file type parsing - Change `Track.artwork` from `std::string` to `TagLib::VariantMap` - Add `importArtwork`, rename `importFolder` to `scanFolder` - Add `scanLibrary`, `updateLibrary`, `editMetadata`, and `seek` methods to `Player` hierarchy - Remove obsolete `Tag.h`/`Tag.cpp` files
68 lines
1.5 KiB
C++
68 lines
1.5 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 );
|
|
virtual void scanLibrary();
|
|
virtual void updateLibrary();
|
|
virtual void editMetadata();
|
|
|
|
// Transport Control
|
|
virtual void play ();
|
|
virtual void stop ();
|
|
virtual void pause ();
|
|
virtual void previous ();
|
|
virtual void next ();
|
|
virtual void seek();
|
|
|
|
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_;
|
|
std::vector<Track> library;
|
|
|
|
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;
|
|
};
|