Add shutdown path for audio layer. Add basic event loop after setting up groove objects. Fix race condition bug by not setting path first.
This commit is contained in:
@@ -37,18 +37,20 @@ class GroovePlayerMgr
|
||||
public:
|
||||
static std::filesystem::path musicScanDir;
|
||||
static GroovePlayerMgr* getInstance() {
|
||||
musicScanDir = std::filesystem::current_path()/"music";
|
||||
static GroovePlayerMgr instance("music.db");
|
||||
musicScanDir = std::filesystem::path("music");
|
||||
return &instance;
|
||||
};
|
||||
GroovePlayerMgr ( GroovePlayerMgr const&) = delete;
|
||||
GroovePlayerMgr ( GroovePlayerMgr const&) = delete;
|
||||
void operator=( GroovePlayerMgr const&) = delete;
|
||||
void shutdown();
|
||||
private:
|
||||
enum PlayerEvents {NOTHING, GROOVE_NOWPLAYING, VOTING_ENDED, VOTE_CAST, PLAYING_PAUSED, PLAYING_RESUMED, SKIP_REQUESTED, SKIP_VOTE_CAST, SKIP_VOTING_ENDED, ADMIN_FORCE_SKIP};
|
||||
|
||||
GroovePlayerMgr (std::string dbFile);
|
||||
Wt::Dbo::backend::Sqlite3 sqliteConnection;
|
||||
Wt::Dbo::Session sqlSession;
|
||||
bool continueEventLoop = true;
|
||||
|
||||
std::list<const AudioTrack*> requestQueue;
|
||||
std::list<PlayerEvents> lastInternalEvents;
|
||||
|
||||
Reference in New Issue
Block a user