From b643511ff513aadbd0485afc6b264702aac41021 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 23 May 2013 16:00:24 +0100 Subject: portability --- rotord/rendercontext.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'rotord/rendercontext.cpp') diff --git a/rotord/rendercontext.cpp b/rotord/rendercontext.cpp index dec9f34..4d49b72 100644 --- a/rotord/rendercontext.cpp +++ b/rotord/rendercontext.cpp @@ -61,11 +61,10 @@ Command_response Render_context::session_command(const std::vector& if (command[0]=="PUT") { //get audio file location and initiate analysis if (command.size()>2) { if (state==IDLE) { - //check file exists - Poco::File f=Poco::File(command[3]); + audio_filename=media_dir+command[3]; //for now, store session variables in memory //check file exists + Poco::File f=Poco::File(audio_filename); if (f.exists()) { //pass to worker thread ??if engine is ready?? ??what if engine has finished but results aren't read?? - audio_filename=command[3]; //for now, store session variables in memory add_queue(ANALYSE_AUDIO); response.status=HTTPResponse::HTTP_OK; response.description="Starting audio analysis: "+command[3]+"\n"; @@ -127,9 +126,9 @@ Command_response Render_context::session_command(const std::vector& //should interrupt whatever is happening? //before begining to load from xml if (state==IDLE) { //eventually not like this - Poco::File f=Poco::File(command[3]); + string graph_filename=graph_dir+command[3]; + Poco::File f=Poco::File(graph_filename); if (f.exists()) { - string graph_filename=command[3]; if (graph.load(graph_filename)) { response.status=HTTPResponse::HTTP_OK; //response.description="Rotor: loaded graph "+command[3]+"\n"; @@ -196,10 +195,11 @@ Command_response Render_context::session_command(const std::vector& if (command[0]=="PUT") { //get vide file location and initiate analysis if (command.size()>4) { //there should be a filename + a destination node if (state==IDLE) { + string video_filename=media_dir+command[4]; //check file exists - Poco::File f=Poco::File(command[4]); + Poco::File f=Poco::File(video_filename); if (f.exists()) { - if (load_video(command[3],command[4])) { + if (load_video(command[3],video_filename)) { //pass to worker thread ??if engine is ready?? ??what if engine has finished but results aren't read?? //DUMMY RESPONSE response.description="Rotor: succesfully loaded "+command[4]+" into video node "+command[3]+"\n"; @@ -241,7 +241,7 @@ Command_response Render_context::session_command(const std::vector& if (command[0]=="PUT") { if (command.size()>2) { if (state==IDLE) { - output_filename=command[3]; + output_filename=output_dir+command[3]; if (command.size()>3) { // output_framerate=ofToFloat(command[4]); } @@ -365,9 +365,8 @@ bool Render_context::load_audio(const string &filename,vectorsample_rate=codecContext->sample_rate; - map params; for (auto p: processors) { - if(!p->init(codecContext->channels,16,samples,codecContext->sample_rate,params) ){ + if(!p->init(codecContext->channels,16,samples,codecContext->sample_rate) ){ cerr<<"Plugin failed to initialse"<