diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-05-23 16:00:24 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-05-23 16:00:24 +0100 |
| commit | b643511ff513aadbd0485afc6b264702aac41021 (patch) | |
| tree | 1aad48b38f8aa7c4eb0b7aacac69b23e794f4510 /rotord/rendercontext.cpp | |
| parent | 55513473ca37841b40662e1a0221d7dd260a59b7 (diff) | |
portability
Diffstat (limited to 'rotord/rendercontext.cpp')
| -rw-r--r-- | rotord/rendercontext.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
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<std::string>& 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="<status context='"+command[1]+"'>Starting audio analysis: "+command[3]+"</status>\n"; @@ -127,9 +126,9 @@ Command_response Render_context::session_command(const std::vector<std::string>& //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="<status context='"+command[1]+"'>Rotor: loaded graph "+command[3]+"</status>\n"; @@ -196,10 +195,11 @@ Command_response Render_context::session_command(const std::vector<std::string>& 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="<status context='"+command[1]+"'>Rotor: succesfully loaded "+command[4]+" into video node "+command[3]+"</status>\n"; @@ -241,7 +241,7 @@ Command_response Render_context::session_command(const std::vector<std::string>& 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,vector<Base_audio_process //frame->sample_rate=codecContext->sample_rate; - map <std::string,float> 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"<<endl; return false; } |
