summaryrefslogtreecommitdiff
path: root/rotord/src/rotord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/rotord.cpp')
-rwxr-xr-xrotord/src/rotord.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/rotord/src/rotord.cpp b/rotord/src/rotord.cpp
index 64d59cd..600462c 100755
--- a/rotord/src/rotord.cpp
+++ b/rotord/src/rotord.cpp
@@ -23,7 +23,7 @@ void RenderContextHandler::handleRequest(HTTPServerRequest& request,HTTPServerRe
HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPServerRequest& request){
-
+
Poco::URI theuri=Poco::URI(request.getURI());
std::vector <std::string> command;
@@ -33,7 +33,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
logger.information(request.clientAddress().toString()+" "+request.getMethod());
HTTPResponse::HTTPStatus status=HTTPResponse::HTTP_BAD_REQUEST; //by default
-
+
std::string body;
std::ostringstream os;
os<<request.stream().rdbuf();
@@ -107,6 +107,19 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
factory.list_nodes(XML);
status=HTTPResponse::HTTP_OK;
}
+ if (command.size()>1){
+ if (command[1]=="json") {
+ string content="{\
+ title: 'Lights Down @Rotor'',\
+ audio: 'filename'',\
+ id:,\
+ type: 'patchBay',\
+ nodeDefinitions: []\
+ }";
+
+ return new RenderContextHandler(content, status);
+ }
+ }
}
else if (command[0]=="listnode") {
XML.pushTag("rotor");
@@ -123,7 +136,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
XML.addTag("render");
XML.addAttribute("render","ID",r.first,i);
bool context_found=false;
- for (auto& task: manager.taskList()) {
+ for (auto& task: manager.taskList()) {
if(task->name()==r.second) {
Render_status status=((Poco::AutoPtr<Rotor::Render_context>)task)->get_render_status(r.first);
//cerr<<"render "<<r.first<<" found, context "<<r.second<<", status: "<<status.status<<endl;
@@ -180,7 +193,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
//some commands need to return error codes
//ie where the audio file isn't found
//on the other hand, some commands need to know state of the renderer?
-
+
Session_command SC;
vector<string> sc; //uid,method,id,command1,{command2,}{body}
@@ -193,7 +206,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
}
sc.push_back(body);
SC.body=body;
-
+
((Poco::AutoPtr<Rotor::Render_context>)task)->session_command(SC,XML,status);
if (XML.tagExists("render_id")){
//cerr<<"render started: "<<SC.uid<<" in context: "<<command[0]<<endl;
@@ -288,4 +301,3 @@ int RotorServer::main(const std::vector<std::string>& args){
}
return Application::EXIT_OK;
}
- \ No newline at end of file