summaryrefslogtreecommitdiff
path: root/rotord/rendercontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/rendercontext.cpp')
-rw-r--r--rotord/rendercontext.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/rotord/rendercontext.cpp b/rotord/rendercontext.cpp
index 1e0fe1e..1da5725 100644
--- a/rotord/rendercontext.cpp
+++ b/rotord/rendercontext.cpp
@@ -144,28 +144,34 @@ void Render_context::session_command(const std::vector<std::string>& command,xml
//should interrupt whatever is happening?
//before begining to load from xml
if (state==IDLE) { //eventually not like this
- string graph_filename=graph_dir+command[3];
- Poco::File f=Poco::File(graph_filename);
- if (f.exists()) {
- if (graph.load(graph_filename)) {
- status=HTTPResponse::HTTP_OK;
- //XML.addValue("patchbay",graph.toString());
- //XML.loadFromBuffer(graph.toString());
- XML=graph.xml;
- //the graph could actually contain an xml object and we could just print it here?
- //or could our nodes even be subclassed from xml nodes?
- //the graph or the audio could load first- have to analyse the audio with vamp after the graph is loaded
- //for now the graph must load 1st
+ if (graph.load(command[3])) {
+ status=HTTPResponse::HTTP_OK;
+ XML.addValue("status","Loaded graph from PUT body");
+ }
+ else {
+ string graph_filename=graph_dir+command[3];
+ Poco::File f=Poco::File(graph_filename);
+ if (f.exists()) {
+ if (graph.loadFile(graph_filename)) {
+ status=HTTPResponse::HTTP_OK;
+ //XML.addValue("patchbay",graph.toString());
+ //XML.loadFromBuffer(graph.toString());
+ XML=graph.xml;
+ //the graph could actually contain an xml object and we could just print it here?
+ //or could our nodes even be subclassed from xml nodes?
+ //the graph or the audio could load first- have to analyse the audio with vamp after the graph is loaded
+ //for now the graph must load 1st
+ }
+ else {
+ status=HTTPResponse::HTTP_INTERNAL_SERVER_ERROR; //~/sources/poco-1.4.6-all/Net/include/Poco/Net/HTTPResponse.h
+ XML.addValue("error","graph not loaded: check XML");
+ }
}
else {
- status=HTTPResponse::HTTP_INTERNAL_SERVER_ERROR; //~/sources/poco-1.4.6-all/Net/include/Poco/Net/HTTPResponse.h
- XML.addValue("error","graph not loaded: check XML");
+ status=HTTPResponse::HTTP_NOT_FOUND;
+ XML.addValue("error",command[3]+" not found");
}
}
- else {
- status=HTTPResponse::HTTP_NOT_FOUND;
- XML.addValue("error",command[3]+" not found");
- }
}
}
}