From 1b6d9aa4305895bfbfb0f73f24e6d9a1850e1cc6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 30 Nov 2012 15:51:08 +0000 Subject: fix x-fades (part one) The data from the lower layer(s) was not faded out because the reversed gain curve was incorrect because ControlList:add() inserts anchor points. a call to reverse_curve() for a linear fade produced: INPUT: [when,val] {[0.0, 0.0], [300.0, 1.0]} OUTPUT: (reversed) {[0.0, 0.0], [0.0, 1.0], [1.0, 0,0], [300.0, 0.0]} solution: use fast_simple_add() instead. git-svn-id: svn://localhost/ardour2/branches/3.0@13572 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audioregion.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libs') diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 577f12c78e..a02eb3720b 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -82,9 +82,8 @@ static void reverse_curve (boost::shared_ptr dst, boost::shared_ptr src) { size_t len = src->back()->when; - - for (Evoral::ControlList::const_iterator it = src->begin(); it!=src->end(); it++) { - dst->add (len - (*it)->when, (*it)->value); + for (Evoral::ControlList::const_reverse_iterator it = src->rbegin(); it!=src->rend(); it++) { + dst->fast_simple_add (len - (*it)->when, (*it)->value); } } @@ -141,7 +140,7 @@ merge_curves (boost::shared_ptr dst, interp += v2 * ( (double)count / (double)size ); interp = dB_to_coefficient(interp); - dst->add ( (*c1)->when, interp ); + dst->fast_simple_add ( (*c1)->when, interp ); c1++; count++; } -- cgit v1.2.3