Added base of code to allow sending backend updates to connected clients.

This commit is contained in:
Kevin Whitaker
2017-01-29 17:27:27 -05:00
parent 22f1b90238
commit ab4df84657
8 changed files with 53 additions and 3 deletions

View File

@@ -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();
// }
// }
// );