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
This commit is contained in:
Robin Gareus 2012-11-30 15:51:08 +00:00
parent 8a819a80d0
commit 1b6d9aa430

View file

@ -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++;
}