Merge with 2.0-ongoing R3082.
[ardour.git] / libs / ardour / audioregion.cc
index 20115ff944049911338da9d5cc89e33b12b15137..5e0cd136ff17c40aa7eb691cbb4e393af543dbb4 100644 (file)
@@ -1022,7 +1022,7 @@ AudioRegion::read_raw_internal (Sample* buf, nframes_t pos, nframes_t cnt) const
 
 
 int
-AudioRegion::exportme (Session& session, AudioExportSpecification& spec)
+AudioRegion::exportme (Session& session, ARDOUR::ExportSpecification& spec)
 {
        const nframes_t blocksize = 4096;
        nframes_t to_read;
@@ -1316,6 +1316,8 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
                return 0;
        }
 
+       cerr << "startup analysis of " << _name << endl;
+
        TransientDetector t (pl->session().frame_rate());
        bool existing_results = !results.empty();
 
@@ -1328,10 +1330,14 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
 
                t.reset ();
 
+               cerr << "working on channel " << i << endl;
+
                if (t.run ("", this, i, these_results)) {
                        return -1;
                }
 
+               cerr << "done\n";
+
                /* translate all transients to give absolute position */
                
                for (AnalysisFeatureList::iterator i = these_results.begin(); i != these_results.end(); ++i) {
@@ -1357,6 +1363,11 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
                /* make sure ours are clean too */
 
                TransientDetector::cleanup_transients (_transients, pl->session().frame_rate(), 3.0);
+
+       } else {
+
+               TransientDetector::cleanup_transients (_transients, pl->session().frame_rate(), 3.0);
+               results = _transients;
        }
 
        _valid_transients = true;