From ec82de75b64acc29fb779fc226a72fa9bf472a88 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 29 Apr 2012 13:00:45 +0000 Subject: Handle update of crossfades on explicit relayer more efficiently. git-svn-id: svn://localhost/ardour2/branches/3.0@12119 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/playlist.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'libs') diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 3b29842aeb..076c4f27ca 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -32,6 +32,7 @@ #include "pbd/failed_constructor.h" #include "pbd/stateful_diff_command.h" #include "pbd/xml++.h" +#include "pbd/stacktrace.h" #include "ardour/debug.h" #include "ardour/playlist.h" @@ -2279,14 +2280,7 @@ Playlist::setup_layering_indices (RegionList const & regions) 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 @@ -2404,7 +2398,7 @@ Playlist::relayer () notify_layering_changed (); /* This relayer() may have been called as a result of a region removal, in which - case we need to setup layering indices so account for the one that has just + case we need to setup layering indices to account for the one that has just gone away. */ setup_layering_indices (copy); @@ -2415,6 +2409,7 @@ Playlist::raise_region (boost::shared_ptr region) { set_layer (region, region->layer() + 1.5); relayer (); + check_crossfades (region->range ()); } void @@ -2422,6 +2417,7 @@ Playlist::lower_region (boost::shared_ptr region) { set_layer (region, region->layer() - 1.5); relayer (); + check_crossfades (region->range ()); } void @@ -2429,6 +2425,7 @@ Playlist::raise_region_to_top (boost::shared_ptr region) { set_layer (region, DBL_MAX); relayer (); + check_crossfades (region->range ()); } void @@ -2436,6 +2433,7 @@ Playlist::lower_region_to_bottom (boost::shared_ptr region) { set_layer (region, -0.5); relayer (); + check_crossfades (region->range ()); } void @@ -3076,6 +3074,9 @@ Playlist::set_orig_track_id (const PBD::ID& id) _orig_track_id = id; } +/** Take a list of ranges, coalesce any that can be coalesced, then call + * check_crossfades for each one. + */ void Playlist::coalesce_and_check_crossfades (list > ranges) { -- cgit v1.2.3