summaryrefslogtreecommitdiff
path: root/rotord/rendercontext.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-07-01 16:04:34 +0100
committerTim Redfern <tim@herge.(none)>2013-07-01 16:04:34 +0100
commit0d867b8b615add6e1a5aaa300c5a39b87614d906 (patch)
tree27134dc08b34782a4d62da8671cfa181eecdeca9 /rotord/rendercontext.cpp
parent3710ee5ea32841d3f62e52834aa2a55f026c6620 (diff)
generating output xml
Diffstat (limited to 'rotord/rendercontext.cpp')
-rw-r--r--rotord/rendercontext.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/rotord/rendercontext.cpp b/rotord/rendercontext.cpp
index 422ef08..4be54f1 100644
--- a/rotord/rendercontext.cpp
+++ b/rotord/rendercontext.cpp
@@ -48,6 +48,9 @@ void Render_context::add_queue(int item) {
work_queue.push_back(item);
mutex.unlock();
}
+void Render_context::session_command(const std::vector<std::string>& command,xmlIO& XML,HTTPResponse::HTTPStatus& status){
+
+}
Command_response Render_context::session_command(const std::vector<std::string>& command){
//method,id,command1,{command2,}{body}
//here we allow the controlling server to communicate with running tasks
@@ -58,6 +61,31 @@ Command_response Render_context::session_command(const std::vector<std::string>&
Command_response response;
response.status=HTTPResponse::HTTP_BAD_REQUEST;
+ if (command[2]=="resolution") {
+ if (command[0]=="PUT") {
+ if (command.size()>2) {
+ if (state==IDLE) {
+ Poco::StringTokenizer t1(command[3],",");
+ if (t1.count()>1){
+ int w=ofToInt(t1[0]);
+ int h=ofToInt(t1[1]);
+ if (graph.set_resolution(w,h)){
+ response.description="<status context='"+command[1]+"'>Rotor: resolution set to "+t1[0]+"x"+t1[1]+"</status>\n";
+ response.status=HTTPResponse::HTTP_OK;
+ }
+ else {
+ response.status=HTTPResponse::HTTP_BAD_REQUEST;
+ response.description="<status context='"+command[1]+"'>Rotor: invalid resolution request: "+t1[0]+"x"+t1[1]+"</status>\n";
+ }
+ }
+ }
+ else {
+ response.status=HTTPResponse::HTTP_BAD_REQUEST;
+ response.description="<status context='"+command[1]+"'>Rotor: session busy</status>\n";
+ }
+ }
+ }
+ }
if (command[2]=="audio") {
if (command[0]=="PUT") { //get audio file location and initiate analysis
if (command.size()>2) {