X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fstrip_silence_dialog.cc;h=6a591c08b9eb2afb382e515ed3d675d17451ae39;hb=b691ba816f3080d0f8029beac6d0ff4c4c3a1900;hp=3e62e4247a9ee17fd910597d332f29c2cae0803f;hpb=0a62044c2c51b38c900ed75d4037e6093901f387;p=ardour.git diff --git a/gtk2_ardour/strip_silence_dialog.cc b/gtk2_ardour/strip_silence_dialog.cc index 3e62e4247a..6a591c08b9 100644 --- a/gtk2_ardour/strip_silence_dialog.cc +++ b/gtk2_ardour/strip_silence_dialog.cc @@ -133,24 +133,20 @@ StripSilenceDialog::~StripSilenceDialog () delete _peaks_ready_connection; } -AudioIntervalMap -StripSilenceDialog::silences () +void +StripSilenceDialog::silences (AudioIntervalMap& m) { - AudioIntervalMap m; - for (list::iterator v = views.begin(); v != views.end(); ++v) { - pair,AudioIntervalResult> newpair ((*v).view->region(), (*v).intervals); + pair,AudioIntervalResult> newpair (v->view->region(), v->intervals); m.insert (newpair); } - - return m; } void StripSilenceDialog::drop_rects () { for (list::iterator v = views.begin(); v != views.end(); ++v) { - (*v).view->drop_silent_frames (); + v->view->drop_silent_frames (); } } @@ -188,8 +184,10 @@ StripSilenceDialog::update_silence_rects () { /* Lock so that we don't contend with the detection thread for access to the silence regions */ Glib::Mutex::Lock lm (_lock); + double const y = _threshold.get_value(); + for (list::iterator v = views.begin(); v != views.end(); ++v) { - (*v).view->set_silent_frames ((*v).intervals); + v->view->set_silent_frames (v->intervals, y); } } @@ -214,7 +212,7 @@ StripSilenceDialog::detection_thread_work () boost::shared_ptr ar = boost::dynamic_pointer_cast ((*i).view->region()); if (ar) { - (*i).intervals = ar->find_silence (dB_to_coefficient (threshold ()), minimum_length (), _interthread_info); + i->intervals = ar->find_silence (dB_to_coefficient (threshold ()), minimum_length (), _interthread_info); } if (_interthread_info.cancel) { @@ -281,7 +279,7 @@ StripSilenceDialog::minimum_length () const framecnt_t StripSilenceDialog::fade_length () const { - return _minimum_length.current_duration (views.front().view->region()->position()); + return _fade_length.current_duration (views.front().view->region()->position()); } void