Reset fades on regions copied from time ranges in other regions (#4035).
authorCarl Hetherington <carl@carlh.net>
Wed, 11 May 2011 15:58:09 +0000 (15:58 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 11 May 2011 15:58:09 +0000 (15:58 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9494 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/audioregion.h
libs/ardour/audio_playlist.cc

index 8d929827c5b00a3c40ed57af0888c3df8d367f97..3ee7962bde966e681120cbde3c066521e0cc407a 100644 (file)
@@ -140,6 +140,8 @@ class AudioRegion : public Region
        void set_fade_out (FadeShape, framecnt_t);
        void set_fade_out (boost::shared_ptr<AutomationList>);
 
+       void set_default_fades ();
+       
        void set_envelope_active (bool yn);
        void set_default_envelope ();
 
@@ -201,7 +203,6 @@ class AudioRegion : public Region
        void post_set (const PBD::PropertyChange&);
 
        void init ();
-       void set_default_fades ();
        void set_default_fade_in ();
        void set_default_fade_out ();
 
index c3d4bfc8de9627b404c6f416d950a4d8a7eaba51..bb4bc9c0e3386f622b69b6145368edb2fdd17903 100644 (file)
@@ -168,6 +168,17 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, fram
        , _crossfades (*this)
 {
        add_property (_crossfades);
+
+       /* Audio regions that have been created by the Playlist constructor
+          will currently have the same fade in/out as the regions that they
+          were created from.  This is wrong, so reset the fades here.
+       */
+
+       for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
+               boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*i);
+               assert (ar);
+               ar->set_default_fades ();
+       }
        
        /* this constructor does NOT notify others (session) */
 }