From f78913cc99ffd13001b4c4daf625391be77e79d0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 27 Apr 2012 20:57:48 +0000 Subject: Crossfades: default xfades are now constant-power, -3dB rule, other options are constant power(-6dB) rule or use existing region fade shape as is; provide GUI control over options; fix some inconsistent behaviour regarding xfades when relayering git-svn-id: svn://localhost/ardour2/branches/3.0@12113 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/playlist.cc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'libs/ardour/playlist.cc') diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index b146f942bd..29be9ec49d 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -608,11 +608,7 @@ Playlist::flush_notifications (bool from_undo) */ } - if ( - ((regions_changed || pending_contents_change) && !in_set_state) || - pending_layering - ) { - + if (((regions_changed || pending_contents_change) && !in_set_state) || pending_layering) { relayer (); } @@ -2276,14 +2272,22 @@ Playlist::set_layer (boost::shared_ptr region, double new_layer) } void -Playlist::setup_layering_indices (RegionList const & regions) const +Playlist::setup_layering_indices (RegionList const & regions) { uint64_t j = 0; + list > xf; + for (RegionList::const_iterator k = regions.begin(); k != regions.end(); ++k) { (*k)->set_layering_index (j++); + + Evoral::Range r ((*k)->first_frame(), (*k)->last_frame()); + xf.push_back (r); } -} + /* now recheck the entire playlist for crossfades */ + + coalesce_and_check_crossfades (xf); +} /** Take the layering indices of each of our regions, compute the layers * that they should be on, and write the layers back to the regions. @@ -2677,12 +2681,6 @@ Playlist::shuffle (boost::shared_ptr region, int dir) if (moved) { relayer (); - - list > xf; - xf.push_back (old_range); - xf.push_back (region->range ()); - coalesce_and_check_crossfades (xf); - notify_contents_changed(); } -- cgit v1.2.3