goodbye toggle buttons for autoplay, autoinput, click and autoreturn; move nudge...
[ardour.git] / gtk2_ardour / strip_silence_dialog.cc
index 3e62e4247a9ee17fd910597d332f29c2cae0803f..6a591c08b9eb2afb382e515ed3d675d17451ae39 100644 (file)
@@ -133,24 +133,20 @@ StripSilenceDialog::~StripSilenceDialog ()
        delete _peaks_ready_connection;
 }
 
-AudioIntervalMap
-StripSilenceDialog::silences ()
+void
+StripSilenceDialog::silences (AudioIntervalMap& m)
 {
-        AudioIntervalMap m;
-
         for (list<ViewInterval>::iterator v = views.begin(); v != views.end(); ++v) {
-                pair<boost::shared_ptr<Region>,AudioIntervalResult> newpair ((*v).view->region(), (*v).intervals);
+                pair<boost::shared_ptr<Region>,AudioIntervalResult> newpair (v->view->region(), v->intervals);
                 m.insert (newpair);
         }
-
-        return m;
 }
 
 void
 StripSilenceDialog::drop_rects ()
 {
         for (list<ViewInterval>::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<ViewInterval>::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<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> ((*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