diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-07-17 11:23:13 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-07-17 11:23:13 +0100 |
| commit | 1e63c7c3b554fbf4030a75a51ee8ad3d0fc05d94 (patch) | |
| tree | 00ff1da720f093d8581c8eb3b06bce5c6cc17d6c | |
| parent | 0b9a43ff5d4ba544e7645b429cff6956421eddc0 (diff) | |
analyse audio where graph is loaded later
| -rw-r--r-- | rotord/rendercontext.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/rotord/rendercontext.cpp b/rotord/rendercontext.cpp index 7a76a70..fc410b2 100644 --- a/rotord/rendercontext.cpp +++ b/rotord/rendercontext.cpp @@ -147,6 +147,11 @@ void Render_context::session_command(const std::vector<std::string>& command,xml if (graph.load(command[3])) { status=HTTPResponse::HTTP_OK; XML.addValue("status","Loaded graph from PUT body"); + if (audio_loaded) { + add_queue(ANALYSE_AUDIO); + status=HTTPResponse::HTTP_OK; + XML.addValue("status","Starting audio analysis for graph: "+command[3]); + } } else { string graph_filename=graph_dir+command[3]; @@ -161,6 +166,11 @@ void Render_context::session_command(const std::vector<std::string>& command,xml //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 (audio_loaded) { + add_queue(ANALYSE_AUDIO); + status=HTTPResponse::HTTP_OK; + XML.addValue("status","Starting audio analysis for graph: "+command[3]); + } } else { status=HTTPResponse::HTTP_INTERNAL_SERVER_ERROR; //~/sources/poco-1.4.6-all/Net/include/Poco/Net/HTTPResponse.h @@ -316,7 +326,7 @@ bool Render_context::load_audio(const string &filename,vector<Base_audio_process } sample_processed+=frame->nb_samples; //mutex.lock(); - progress=((float)sample_processed)/samples; + progress=((float)sample_processed)/samples; //atomic on 64 bit? //mutex.unlock(); frame=loader.get_frame(); |
