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 | |
| parent | 393c70c5fc67fff87d189e77dffc5a22ed94a628 (diff) | |
remove division by zero log
| -rw-r--r-- | rotord/src/nodes_maths.h | 14 | ||||
| -rwxr-xr-x | rotord/src/rotor.cpp | 2 | ||||
| -rwxr-xr-x | rotord/src/rotord.cpp | 24 |
3 files changed, 26 insertions, 14 deletions
diff --git a/rotord/src/nodes_maths.h b/rotord/src/nodes_maths.h index 617ca76..d083c72 100644 --- a/rotord/src/nodes_maths.h +++ b/rotord/src/nodes_maths.h @@ -74,13 +74,13 @@ namespace Rotor { }; Arithmetic* clone(map<string,string> &_settings) { return new Arithmetic(_settings);}; const float output(const Time_spec &time) { - if (attributes["operator"]->intVal==ARITHMETIC_divide||attributes["operator"]->intVal==ARITHMETIC_modulo){ - if (value==0.0f) { - Poco::Logger& logger = Poco::Logger::get("Rotor"); - logger.error("Arithmetic node: caught division by zero, frame "+time.frame()); - return 0.0f; - } - } + //if (attributes["operator"]->intVal==ARITHMETIC_divide||attributes["operator"]->intVal==ARITHMETIC_modulo){ + // if (value==0.0f) { + // Poco::Logger& logger = Poco::Logger::get("Rotor"); + // logger.error("Arithmetic node: caught division by zero, frame "+time.frame()); + // return 0.0f; + // } + //} if (inputs.size()) { //there should there be a way to specify number of inputs in the code rather than in xml if (inputs[0]->connection) { float in= inputs[0]->get(time); diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp index 0a1207b..c45ce5e 100755 --- a/rotord/src/rotor.cpp +++ b/rotord/src/rotor.cpp @@ -275,7 +275,7 @@ bool Video_output::render(const float duration, const float framerate,const stri //Assertion ff_avcodec_locked failed at libavcodec/utils.c:2967 //cerr<<"videoloader: "<<vf<<" seconds, vstep "<<vstep<<" ,asking for frame "<<((int)((vf*framerate)+0.5))<<endl - + Image* i; if (usingaudio) { i=get_output(Frame_spec(vf,framerate,duration,outW,outH,a)); 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 |
