From 1e63c7c3b554fbf4030a75a51ee8ad3d0fc05d94 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 17 Jul 2013 11:23:13 +0100 Subject: analyse audio where graph is loaded later --- rotord/rendercontext.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'rotord') 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& 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& 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,vectornb_samples; //mutex.lock(); - progress=((float)sample_processed)/samples; + progress=((float)sample_processed)/samples; //atomic on 64 bit? //mutex.unlock(); frame=loader.get_frame(); -- cgit v1.2.3