From 5606479f9ef49f11a39c52cbad925edbb8709c76 Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 9 Sep 2013 22:21:24 +0100 Subject: change load order --- rotord/src/libavwrapper.cpp | 0 rotord/src/libavwrapper.h | 0 rotord/src/rendercontext.cpp | 39 ++++++++++++++++++--------------------- rotord/src/rotor.cpp | 0 rotord/src/rotor.h | 0 rotord/src/rotord.cpp | 0 rotord/src/rotord.h | 0 rotord/src/tinyxml.cpp | 0 rotord/src/tinyxml.h | 0 rotord/src/tinyxmlerror.cpp | 0 rotord/src/tinyxmlparser.cpp | 0 rotord/src/xmlIO.cpp | 0 rotord/src/xmlIO.h | 0 13 files changed, 18 insertions(+), 21 deletions(-) mode change 100755 => 100644 rotord/src/libavwrapper.cpp mode change 100755 => 100644 rotord/src/libavwrapper.h mode change 100755 => 100644 rotord/src/rotor.cpp mode change 100755 => 100644 rotord/src/rotor.h mode change 100755 => 100644 rotord/src/rotord.cpp mode change 100755 => 100644 rotord/src/rotord.h mode change 100755 => 100644 rotord/src/tinyxml.cpp mode change 100755 => 100644 rotord/src/tinyxml.h mode change 100755 => 100644 rotord/src/tinyxmlerror.cpp mode change 100755 => 100644 rotord/src/tinyxmlparser.cpp mode change 100755 => 100644 rotord/src/xmlIO.cpp mode change 100755 => 100644 rotord/src/xmlIO.h diff --git a/rotord/src/libavwrapper.cpp b/rotord/src/libavwrapper.cpp old mode 100755 new mode 100644 diff --git a/rotord/src/libavwrapper.h b/rotord/src/libavwrapper.h old mode 100755 new mode 100644 diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp index 8b4053f..aacc692 100644 --- a/rotord/src/rendercontext.cpp +++ b/rotord/src/rendercontext.cpp @@ -175,21 +175,8 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H //should interrupt whatever is happening? //before begining to load from xml if (state==IDLE) { //eventually not like this - if (graph.load(command.body,media_dir)) { - status=HTTPResponse::HTTP_OK; - logger.information("Loaded graph from http PUT body"); - XML.addValue("status","Loaded graph from PUT body"); - if (graph.audio_loaded) { - add_queue(Session_task(command.uid,ANALYSE_AUDIO)); - status=HTTPResponse::HTTP_OK; - logger.information("Starting audio analysis for graph: "+command.commands[0]); - XML.addValue("status","Starting audio analysis for graph: "+command.commands[0]); - } - } - else { - string graph_filename=graph_dir+command.body; - Poco::File f=Poco::File(graph_filename); - if (f.exists()) { + if (Poco::File(graph_dir+command.body).exists()) { + string graph_filename=graph_dir+command.body; if (graph.loadFile(graph_filename,media_dir)) { status=HTTPResponse::HTTP_OK; //XML.addValue("patchbay",graph.toString()); @@ -208,16 +195,26 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H } else { status=HTTPResponse::HTTP_INTERNAL_SERVER_ERROR; //~/sources/poco-1.4.6-all/Net/include/Poco/Net/HTTPResponse.h - logger.error("ERROR: graph not loaded: check XML"); - XML.addValue("error","graph not loaded: check XML"); + logger.error("ERROR: graph not loaded: check file"); + XML.addValue("error","graph not loaded: check file"); } } - else { - status=HTTPResponse::HTTP_NOT_FOUND; - logger.error("ERROR: "+command.body+" not found"); - XML.addValue("error",command.body+" not found"); + else if (graph.load(command.body,media_dir)) { + status=HTTPResponse::HTTP_OK; + logger.information("Loaded graph from http PUT body"); + XML.addValue("status","Loaded graph from PUT body"); + if (graph.audio_loaded) { + add_queue(Session_task(command.uid,ANALYSE_AUDIO)); + status=HTTPResponse::HTTP_OK; + logger.information("Starting audio analysis for graph: "+command.commands[0]); + XML.addValue("status","Starting audio analysis for graph: "+command.commands[0]); } } + else { + status=HTTPResponse::HTTP_INTERNAL_SERVER_ERROR; //~/sources/poco-1.4.6-all/Net/include/Poco/Net/HTTPResponse.h + logger.error("ERROR: graph unreadable"); + XML.addValue("error","graph unreadable"); + } } else { logger.error("ERROR: Session busy"); diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp old mode 100755 new mode 100644 diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h old mode 100755 new mode 100644 diff --git a/rotord/src/rotord.cpp b/rotord/src/rotord.cpp old mode 100755 new mode 100644 diff --git a/rotord/src/rotord.h b/rotord/src/rotord.h old mode 100755 new mode 100644 diff --git a/rotord/src/tinyxml.cpp b/rotord/src/tinyxml.cpp old mode 100755 new mode 100644 diff --git a/rotord/src/tinyxml.h b/rotord/src/tinyxml.h old mode 100755 new mode 100644 diff --git a/rotord/src/tinyxmlerror.cpp b/rotord/src/tinyxmlerror.cpp old mode 100755 new mode 100644 diff --git a/rotord/src/tinyxmlparser.cpp b/rotord/src/tinyxmlparser.cpp old mode 100755 new mode 100644 diff --git a/rotord/src/xmlIO.cpp b/rotord/src/xmlIO.cpp old mode 100755 new mode 100644 diff --git a/rotord/src/xmlIO.h b/rotord/src/xmlIO.h old mode 100755 new mode 100644 -- cgit v1.2.3