/*
- Copyright (C) 2001-2003 Paul Davis
+ Copyright (C) 2001-2007 Paul Davis
Contains ideas derived from "Constrained Cubic Spline Interpolation"
by CJC Kruger (www.korf.co.uk/spline.pdf).
using namespace PBD;
Curve::Curve (const AutomationList& al)
- : _list (al)
- , _dirty (true)
+ : _dirty (true)
+ , _list (al)
{
_list.Dirty.connect(mem_fun(*this, &Curve::on_list_dirty));
}
-Curve::Curve (const Curve& other)
- : _list (other._list)
- , _dirty (true)
-{
- _list.Dirty.connect(mem_fun(*this, &Curve::on_list_dirty));
-}
-#if 0
-Curve::Curve (const Curve& other, double start, double end)
- : _list (other._list)
-{
- _min_yval = other._min_yval;
- _max_yval = other._max_yval;
-}
-
-/** \a id is used for legacy sessions where the type is not present
- * in or below the <AutomationList> node. It is used if \a id is non-null.
- */
-Curve::Curve (const XMLNode& node, ParamID id)
- : AutomationList (node, id)
-{
-}
-#endif
-
-Curve::~Curve ()
-{
-}
-
void
Curve::solve ()
{
double lp0, lp1, fpone;
- lp0 =(x[1] - x[0])/(y[1] - y[0]);
+ lp0 = (x[1] - x[0])/(y[1] - y[0]);
lp1 = (x[2] - x[1])/(y[2] - y[1]);
if (lp0*lp1 < 0) {
/* store */
+ (*xx)->create_coeffs();
(*xx)->coeff[0] = y[i-1] - (b * x[i-1]) - (c * xim12) - (d * xim13);
(*xx)->coeff[1] = b;
(*xx)->coeff[2] = c;
(lookup_cache.range.first == _list.events().end()) ||
((*lookup_cache.range.second)->when < x))) {
- AutomationList::TimeComparator cmp;
ControlEvent cp (x, 0.0);
- lookup_cache.range = equal_range (_list.events().begin(), _list.events().end(), &cp, cmp);
+ lookup_cache.range = equal_range (_list.events().begin(), _list.events().end(), &cp, AutomationList::time_comparator);
}
range = lookup_cache.range;