80bffc0fdd
Add Database class with SQLite fetch/fetchAlbum methods. Refactor PlaybackEngine (data callback, seek, getPosition, decoder lifecycle) and Player API (PlaybackEngine member, queue handling, PlayerLocal). Update Metadata::Track fields to include artist/title/album/trackNr/length.
37 lines
1018 B
C++
37 lines
1018 B
C++
#pragma once
|
|
|
|
#include "miniaudio.h"
|
|
|
|
class PlayerEngine {
|
|
private:
|
|
ma_engine engine_;
|
|
ma_engine_config engineConfig_;
|
|
ma_device device_;
|
|
ma_device_config deviceConfig_;
|
|
unsigned int sampleRate_;
|
|
unsigned int channels_ = 2;
|
|
ma_format format_ = ma_format_unknown;
|
|
ma_context context_;
|
|
|
|
|
|
public:
|
|
PlayerEngine();
|
|
PlayerEngine( unsigned int sampleRate, unsigned int channels, ma_format format );
|
|
~PlayerEngine();
|
|
ma_device getDevice() const;
|
|
unsigned int getChannels() const;
|
|
unsigned int getSampleRate() const;
|
|
ma_format getFormat() const;
|
|
|
|
void setDevice( ma_device device );
|
|
void setSampleRate( unsigned int sampleRate );
|
|
void setChannels( unsigned int channels );
|
|
void setFormat( ma_format format );
|
|
|
|
ma_device_data_proc data_callback();
|
|
void configureDevice( ma_context& context );
|
|
void initDevice ();
|
|
void initEngine();
|
|
|
|
};
|