fix problems with files being needlessly re-analysed at startup
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 12 Feb 2008 18:12:11 +0000 (18:12 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 12 Feb 2008 18:12:11 +0000 (18:12 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3042 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/analyser.cc
libs/ardour/transient_detector.cc

index 5768ce00053c0d0ba27e22dd74648a3cf9981c7e..2e14c74b86e267016340b9d7764e5f41c33b3694 100644 (file)
@@ -95,7 +95,7 @@ Analyser::work ()
 
                boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (src);
 
-               if (afs) {
+               if (afs && afs->length()) {
                        analyse_audio_file_source (afs);
                }
        }
@@ -108,8 +108,6 @@ Analyser::analyse_audio_file_source (boost::shared_ptr<AudioFileSource> src)
 
        TransientDetector td (src->sample_rate());
 
-       cerr << "analyzing " << src->name () << endl;
-
        if (td.run (src->get_transients_path(), src.get(), 0, results) == 0) {
                src->set_been_analysed (true);
        } else {
index b92bf5fb2de61a2034154c901f79881efca0b4db..d24c4c9442f678cf1016be4ac8e2558cccc63e20 100644 (file)
@@ -6,18 +6,20 @@ using namespace Vamp;
 using namespace ARDOUR;
 using namespace std;
 
-string TransientDetector::_op_id;
+/* need a static initializer function for this */
+
+string TransientDetector::_op_id = X_("libardourvampplugins:percussiononsets:2");
 
 TransientDetector::TransientDetector (float sr)
        : AudioAnalyser (sr, X_("libardourvampplugins:percussiononsets"))
 {
-       if (_op_id.empty()) {
-               _op_id = X_("libardourvampplugins:percussiononsets");
-
-               // XXX this should load the above-named plugin and get the current version
+       /* update the op_id */
 
-               _op_id += ":2";
-       }
+       _op_id = X_("libardourvampplugins:percussiononsets");
+       
+       // XXX this should load the above-named plugin and get the current version
+       
+       _op_id += ":2";
 }
 
 TransientDetector::~TransientDetector()