filesystem support works in c++11, but needs another lib linked. Add some namespacing to make easier to transition to official filesystem lib release. Move static var in wrong place. Add first method ot handle scanning.
This commit is contained in:
@@ -26,12 +26,18 @@
|
||||
#include <thread>
|
||||
#include "db/User.h"
|
||||
#include "db/AudioTrack.h"
|
||||
#include <experimental/filesystem> //TODO:Change to non-gcc way when officially using c++17
|
||||
namespace std {
|
||||
namespace filesystem = experimental::filesystem;
|
||||
}
|
||||
|
||||
class GroovePlayer
|
||||
{
|
||||
public:
|
||||
static std::filesystem::path musicScanDir;
|
||||
static GroovePlayer* getInstance() {
|
||||
static GroovePlayer instance("music.db");
|
||||
musicScanDir = std::filesystem::current_path().string()+"/music";
|
||||
return &instance;
|
||||
};
|
||||
GroovePlayer(GroovePlayer const&) = delete;
|
||||
@@ -47,6 +53,7 @@ private:
|
||||
std::vector<AudioTrack*> getNextVoteBatch();
|
||||
std::thread* grooveAudioScanner;
|
||||
static void grooveAudioScannerLoop();
|
||||
static bool addFileToTrackDBIfTagged(std::filesystem::path file);
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user