diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-03 23:39:26 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-03 23:39:26 +0000 |
commit | c2c224727eee4c16bd64ca4a5b5bb2d276f5afe3 (patch) | |
tree | f0d6a62a67a7ac435c27bf84ebfe217e77a76b29 /libs/ardour/strip_silence.cc | |
parent | a7eb8f47335904c6b9c30b86d6a7be3946d13655 (diff) |
changes to help strp silence
git-svn-id: svn://localhost/ardour2/branches/3.0@6725 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/strip_silence.cc')
-rw-r--r-- | libs/ardour/strip_silence.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/ardour/strip_silence.cc b/libs/ardour/strip_silence.cc index 0f58ccf9a3..ae35eebd8f 100644 --- a/libs/ardour/strip_silence.cc +++ b/libs/ardour/strip_silence.cc @@ -46,14 +46,25 @@ StripSilence::run (boost::shared_ptr<Region> r) /* we only operate on AudioRegions, for now, though this could be adapted to MIDI as well I guess */ boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion> (r); + InterThreadInfo itt; + if (!region) { results.push_back (r); return -1; } + /* we don't care about this but we need to fill out the fields + anyway. XXX should really be a default constructor for ITT + */ + + itt.done = false; + itt.cancel = false; + itt.progress = 0.0; + itt.thread = 0; + /* find periods of silence in the region */ std::list<std::pair<frameoffset_t, framecnt_t> > const silence = - region->find_silence (dB_to_coefficient (_threshold), _minimum_length); + region->find_silence (dB_to_coefficient (_threshold), _minimum_length, itt); if (silence.size () == 1 && silence.front().first == 0 && silence.front().second == region->length() - 1) { /* the region is all silence, so just return with nothing */ |