summaryrefslogtreecommitdiff
path: root/NT/src/rendercontext.h
diff options
context:
space:
mode:
Diffstat (limited to 'NT/src/rendercontext.h')
-rw-r--r--NT/src/rendercontext.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/NT/src/rendercontext.h b/NT/src/rendercontext.h
index a84cad8..d1acf55 100644
--- a/NT/src/rendercontext.h
+++ b/NT/src/rendercontext.h
@@ -11,6 +11,7 @@ TJR Jan 2014
-------------------------*/
#include "Poco/Task.h"
+#include "Poco/StringTokenizer.h"
#include "rotor.h"
#include "graph.h"
@@ -49,6 +50,12 @@ namespace Rotor {
string uid,method,id,body;
vector<string> commands;
};
+ class Session_task {
+ public:
+ Session_task(const string &_uid="",int _task=0):uid(_uid),task(_task) {};
+ string uid;
+ int task;
+ };
class Render_status {
public:
Render_status():status(0),progress(0.0){};
@@ -63,8 +70,9 @@ namespace Rotor {
};
class Render_context: public Poco::Task {
public:
- Render_context(const std::string& _id): Task(_id) {
+ Render_context(const std::string& _id,const std::string& _media_dir=""): Task(_id) {
id=_id;
+ media_dir=_media_dir;
graph.init(id);
//set up log
AutoPtr<SplitterChannel> splitterChannel(new SplitterChannel());
@@ -75,6 +83,8 @@ namespace Rotor {
AutoPtr<Formatter> formatter(new PatternFormatter("%d-%m-%Y %H:%M:%S %s: %t"));
AutoPtr<Channel> formattingChannel(new FormattingChannel(formatter, splitterChannel));
Logger& logger = Logger::create(id, formattingChannel, Message::PRIO_TRACE);
+
+ //load profiles
logger.information("started thread");
}
~Render_context(){
@@ -82,14 +92,10 @@ namespace Rotor {
cancel();
logger.information("stopped thread");
}
- void runTask() {
- while (!isCancelled()) {
- sleep(100);
- }
- }
- bool set_preset(std::string& _preset){
- if (presets.find(_preset)==presets.end()) return false;
- preset=_preset;
+ void add_queue(Session_task item);
+ bool set_profile(const std::string& _profile){
+ if (profiles.find(_profile)==profiles.end()) return false;
+ profile=_profile;
return true;
}
void session_command(const Session_command& command,xmlIO& XML,Poco::Net::HTTPResponse::HTTPStatus& status);
@@ -105,10 +111,15 @@ namespace Rotor {
std::string text_render(std::string node_id="");
Graph graph;
private:
+ int state;
std::string id;
std::unordered_map<std::string,Render_status> renders;
- std::unordered_map<std::string,Render_settings> presets;
- std::string preset;
+ std::unordered_map<std::string,Render_settings> profiles;
+ std::string profile;
+ std::string media_dir;
+
+ std::deque<Session_task> work_queue;
+ Poco::Mutex mutex;
};
};