diff options
| author | Comment <tim@gray.(none)> | 2014-01-29 23:58:55 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2014-01-29 23:58:55 +0000 |
| commit | 89961817f408e921de2c1be6197e2b1ee0f5df98 (patch) | |
| tree | 983f41082fbe2877d9eed913d07784f157d5ced4 /NT/src/rendercontext.h | |
| parent | 90a237397507bda5a8194b9a7c9982454cc79718 (diff) | |
NT audio framework
Diffstat (limited to 'NT/src/rendercontext.h')
| -rw-r--r-- | NT/src/rendercontext.h | 33 |
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; }; }; |
