Fix music dir being set in bad place again. Update web calls that backend calls to match const requirements. Have playlist and player part of backend class now for better handling. Set up getting first vote list and sending.

This commit is contained in:
Kevin Whitaker
2017-02-04 14:15:18 -05:00
parent 9b2783238e
commit dff7fa145d
4 changed files with 36 additions and 21 deletions

View File

@@ -37,13 +37,16 @@ class GroovePlayerMgr
public:
static std::filesystem::path musicScanDir;
static GroovePlayerMgr* getInstance() {
musicScanDir = std::filesystem::current_path()/"music";
static GroovePlayerMgr instance("music.db");
return &instance;
};
GroovePlayerMgr ( GroovePlayerMgr const&) = delete;
void operator=( GroovePlayerMgr const&) = delete;
void shutdown();
struct GroovePlaylist* currentPlaylist;
struct GroovePlayer* currentPlayer;
std::list<const AudioTrack*> currentVoteBatch;
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};
@@ -54,7 +57,6 @@ private:
std::list<const AudioTrack*> requestQueue;
std::list<PlayerEvents> lastInternalEvents;
GroovePlaylistItem* currentItem;
std::thread* grooveEvents;