diff options
Diffstat (limited to 'rotord/rendercontext.cpp')
| -rw-r--r-- | rotord/rendercontext.cpp | 28 |
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) { |
