Added base of code to allow sending backend updates to connected clients.
This commit is contained in:
@@ -22,6 +22,9 @@
|
||||
#include "db/AudioTrack.h"
|
||||
#include "db/UserAction.h"
|
||||
#include <Wt/WLogger>
|
||||
#include <Wt/WServer>
|
||||
#include <Wt/WApplication>
|
||||
#include "WebInterface.h"
|
||||
|
||||
GroovePlayer::GroovePlayer(std::string dbFile) : sqliteConnection(dbFile)
|
||||
{
|
||||
@@ -37,3 +40,14 @@ GroovePlayer::GroovePlayer(std::string dbFile) : sqliteConnection(dbFile)
|
||||
Wt::log("info") << "Using Existing DB.";
|
||||
}
|
||||
}
|
||||
|
||||
//TODO:use this code when sending to UI.
|
||||
// Wt::WServer::instance()->postAll([]() {
|
||||
// Wt::WApplication* app = Wt::WApplication::instance();
|
||||
// if(app != nullptr)
|
||||
// {
|
||||
// static_cast<WebInterface*>(app)->updateUIFromServer();
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user