summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rotord/src/nodes_maths.h14
-rwxr-xr-xrotord/src/rotor.cpp2
-rwxr-xr-xrotord/src/rotord.cpp24
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