diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-08-21 13:27:22 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-08-21 13:27:22 +0100 |
| commit | cbf03a315657fc9e388e78dd39e9daf4fd0a9718 (patch) | |
| tree | 9c89dac59bfa0dc185623d4225e28037d452a8d7 /rotord/src/rotord.cpp | |
| parent | 393c70c5fc67fff87d189e77dffc5a22ed94a628 (diff) | |
remove division by zero log
Diffstat (limited to 'rotord/src/rotord.cpp')
| -rwxr-xr-x | rotord/src/rotord.cpp | 24 |
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 |
