Have GroovePlayer init music db on creation. Make fields correctly be fk.

This commit is contained in:
Kevin Whitaker
2017-01-28 14:41:08 -05:00
parent c8637f2af6
commit 93e095d46e
3 changed files with 27 additions and 8 deletions

View File

@@ -20,17 +20,22 @@
#ifndef GROOVEPLAYER_H
#define GROOVEPLAYER_H
#include <Wt/Dbo/Session>
#include <Wt/Dbo/backend/Sqlite3>
class GroovePlayer
{
public:
static GroovePlayer* getInstance() {
static GroovePlayer instance;
static GroovePlayer instance("music.db");
return &instance;
};
GroovePlayer(GroovePlayer const&) = delete;
void operator=(GroovePlayer const&) = delete;
private:
GroovePlayer();
GroovePlayer(std::string dbFile);
Wt::Dbo::backend::Sqlite3 sqliteConnection;
Wt::Dbo::Session sqlSession;
};
#endif // GROOVEPLAYER_H