summaryrefslogtreecommitdiff
path: root/NT/src/rendercontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NT/src/rendercontext.cpp')
-rw-r--r--NT/src/rendercontext.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/NT/src/rendercontext.cpp b/NT/src/rendercontext.cpp
index 631f4b8..28e722d 100644
--- a/NT/src/rendercontext.cpp
+++ b/NT/src/rendercontext.cpp
@@ -35,15 +35,15 @@ void Render_context::runTask() {
renders[cmd.uid].status=FAILED;
}
}
- if(cmd.task==LOAD_GRAPH) {
+ if(cmd.task==LOAD_GRAPH_FILE||cmd.task==LOAD_GRAPH_STRING) {
state=LOADING_GRAPH;
- if (graph_filename!="") {
- if (!graph.loadFile(cmd.message,media_path)){
- cerr<<"Rotor: failed to load graph from "<<graph_filename<<endl;
+ if(cmd.task==LOAD_GRAPH_FILE) {
+ if (!graph.load_file(cmd.message,media_path)){
+ cerr<<"Rotor: failed to load graph from "<<cmd.message<<endl;
}
}
- else if (graph_body!="") {
- if (!graph.load(graph_body,media_dir)) {
+ if(cmd.task==LOAD_GRAPH_STRING) {
+ if (!graph.parse_json(cmd.message,media_path)) {
cerr<<"Rotor: failed to load graph from body request"<<endl;
}
}
@@ -126,7 +126,7 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H
if (command.method=="PUT") { //get audio file location and initiate analysis
if (command.body!="") {
if (state==IDLE) {
- graph.audio_filename=media_dir+command.body; //for now, store session variables in memory //check file exists
+ graph.audio_filename=media_path+command.body; //for now, store session variables in memory //check file exists
Poco::File f=Poco::File(graph.audio_filename);
if (f.exists()) {
add_queue(Session_task(command.uid,ANALYSE_AUDIO));
@@ -211,7 +211,7 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H
//before begining to load from xml
if (state==IDLE) { //eventually not like this
if (command.body!="") {
- string graph_filename=graph_dir+command.body;
+ string graph_filename=graph_path+command.body;
string graph_body="";
if (Poco::File(graph_filename).exists()) {;
add_queue(Session_task(command.uid,LOAD_GRAPH,graph_filename));
@@ -295,7 +295,7 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H
if (command.body!="") { //there should be a filename + a destination node
if (state!=RENDERING) {
if (command.commands.size()>2) {
- string video_filename=media_dir+command.body;
+ string video_filename=media_path+command.body;
//check file exists
Poco::File f=Poco::File(video_filename);
if (f.exists()) {