Add groove player to stuff linked in. Add some vars to hold player events to watch for in event loop. Implement first version of vote picking algorithm.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <Wt/Dbo/Session>
|
||||
#include <Wt/Dbo/backend/Sqlite3>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <thread>
|
||||
#include "db/User.h"
|
||||
#include "db/AudioTrack.h"
|
||||
@@ -44,19 +44,28 @@ public:
|
||||
GroovePlayer(GroovePlayer const&) = delete;
|
||||
void operator=(GroovePlayer const&) = delete;
|
||||
private:
|
||||
enum PlayerEvents {NOTHING, GROOVE_NOWPLAYING, VOTING_ENDED, VOTE_CAST, PLAYING_PAUSED, PLAYING_RESUMED, SKIP_REQUESTED, SKIP_VOTE_CAST, SKIP_VOTING_ENDED};
|
||||
|
||||
GroovePlayer(std::string dbFile);
|
||||
Wt::Dbo::backend::Sqlite3 sqliteConnection;
|
||||
Wt::Dbo::Session sqlSession;
|
||||
|
||||
std::vector<AudioTrack*> requestQueue;
|
||||
std::list<const AudioTrack*> requestQueue;
|
||||
std::list<PlayerEvents> lastInternalEvents;
|
||||
GroovePlaylistItem* currentItem;
|
||||
|
||||
|
||||
std::thread* grooveEvents;
|
||||
static void grooveEventLoop();
|
||||
std::vector<AudioTrack*> getNextVoteBatch();
|
||||
std::list<const AudioTrack*> getNextVoteBatch();
|
||||
std::thread* grooveAudioScanner;
|
||||
static void grooveAudioScannerLoop();
|
||||
PlayerEvents getNextPlayerEvent();
|
||||
static bool addFileToTrackDBIfTagged(std::filesystem::path file);
|
||||
static void removeOrphanedTracks();
|
||||
|
||||
Wt::Dbo::ptr<AudioTrack> getCurrentTrack();
|
||||
|
||||
};
|
||||
|
||||
#endif // GROOVEPLAYER_H
|
||||
|
||||
Reference in New Issue
Block a user