X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fanalyser.cc;h=a603e29b230cee7fbdd361d90bed458388e26a34;hb=8724a9f68f2854be6c3c70f15efda8076ef5db1d;hp=fa22bd757da522d4135f4d1caafa15e58031dd1f;hpb=91fac4c96dc6210dcc056da70dc608700d7eb570;p=ardour.git diff --git a/libs/ardour/analyser.cc b/libs/ardour/analyser.cc index fa22bd757d..a603e29b23 100644 --- a/libs/ardour/analyser.cc +++ b/libs/ardour/analyser.cc @@ -19,6 +19,7 @@ #include "ardour/analyser.h" #include "ardour/audiofilesource.h" +#include "ardour/rc_configuration.h" #include "ardour/session_event.h" #include "ardour/transient_detector.h" @@ -31,6 +32,7 @@ using namespace ARDOUR; using namespace PBD; Analyser* Analyser::the_analyser = 0; +Glib::Threads::Mutex Analyser::analysis_active_lock; Glib::Threads::Mutex Analyser::analysis_queue_lock; Glib::Threads::Cond Analyser::SourcesToAnalyse; list > Analyser::analysis_queue; @@ -96,6 +98,7 @@ Analyser::work () boost::shared_ptr afs = boost::dynamic_pointer_cast (src); if (afs && afs->length(afs->timeline_position())) { + Glib::Threads::Mutex::Lock lm (analysis_active_lock); analyse_audio_file_source (afs); } } @@ -108,6 +111,7 @@ Analyser::analyse_audio_file_source (boost::shared_ptr src) try { TransientDetector td (src->sample_rate()); + td.set_sensitivity (3, Config->get_transient_sensitivity()); // "General purpose" if (td.run (src->get_transients_path(), src.get(), 0, results) == 0) { src->set_been_analysed (true); } else { @@ -119,3 +123,11 @@ Analyser::analyse_audio_file_source (boost::shared_ptr src) return; } } + +void +Analyser::flush () +{ + Glib::Threads::Mutex::Lock lq (analysis_queue_lock); + Glib::Threads::Mutex::Lock la (analysis_active_lock); + analysis_queue.clear(); +}