diff options
author | Robin Gareus <robin@gareus.org> | 2012-11-30 15:51:08 +0000 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2012-11-30 15:51:08 +0000 |
commit | 1b6d9aa4305895bfbfb0f73f24e6d9a1850e1cc6 (patch) | |
tree | 0facefcb3e7ad25e387b4b1661ca74c8c5011958 /libs/ardour/audioregion.cc | |
parent | 8a819a80d0cc00a2fd04b2cb090b5f4730cc3216 (diff) |
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
Diffstat (limited to 'libs/ardour/audioregion.cc')
-rw-r--r-- | libs/ardour/audioregion.cc | 7 |
1 files changed, 3 insertions, 4 deletions
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<Evoral::ControlList> dst, boost::shared_ptr<const Evoral::ControlList> 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<Evoral::ControlList> 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++; } |