Restore fade option to strip silence.
authorCarl Hetherington <carl@carlh.net>
Mon, 28 Feb 2011 18:57:43 +0000 (18:57 +0000)
committerCarl Hetherington <carl@carlh.net>
Mon, 28 Feb 2011 18:57:43 +0000 (18:57 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8992 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/strip_silence_dialog.cc
libs/ardour/strip_silence.cc

index 3e68f0dd0607259854c98ff5f55f3f48902179d2..6a591c08b9eb2afb382e515ed3d675d17451ae39 100644 (file)
@@ -84,12 +84,9 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
         _minimum_length.set_mode (AudioClock::Frames);
         _minimum_length.set (1000, true);
 
-        /* Add this back when we finally do something with it */
-        /*
        table->attach (*Gtk::manage (new Gtk::Label (_("Fade length"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
         table->attach (_fade_length, 1, 2, n, n + 1, Gtk::FILL);
        ++n;
-        */
 
         _fade_length.set_session (s);
         _fade_length.set_mode (AudioClock::Frames);
@@ -282,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
index d04612f6044ec1c38a51711fc40ce9d1858fb028..ee6bfb7a5e46bea740a21802696a2a44caec7811 100644 (file)
@@ -123,9 +123,12 @@ StripSilence::run (boost::shared_ptr<Region> r, Progress* progress)
                        );
                
                copy->set_name (RegionFactory::new_region_name (region->name ()));
+
+               framecnt_t const f = std::min (_fade_length, (i->second - i->first));
                
                copy->set_fade_in_active (true);
-               copy->set_fade_in (FadeLinear, _fade_length);
+               copy->set_fade_in (FadeLinear, f);
+               copy->set_fade_out (FadeLinear, f);
                results.push_back (copy);
        
                if (progress && (n <= N)) {