root->set_property ("automation-id", EventTypeMap::instance().to_symbol(_parameter));
root->set_property ("id", id());
- root->set_property ("default", _default_value);
- root->set_property ("min-yval", _min_yval);
- root->set_property ("max-yval", _max_yval);
root->set_property ("interpolation-style", _interpolation);
if (full) {
_interpolation = Linear;
}
- if (!node.get_property (X_("default"), _default_value)) {
- _default_value = 0.0;
- }
-
if (node.get_property (X_("state"), _state)) {
if (_state == Write) {
_state = Off;
_state = Off;
}
- if (!node.get_property (X_("min-yval"), _min_yval)) {
- _min_yval = FLT_MIN;
- }
-
- if (!node.get_property (X_("max-yval"), _max_yval)) {
- _max_yval = FLT_MAX;
- }
-
bool have_events = false;
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if (c && c->alist()) {
if (!child->children().empty()) {
c->alist()->set_state (*child->children().front(), version);
-
- /* In some cases 2.X saves lists with min_yval and max_yval
- being FLT_MIN and FLT_MAX respectively. This causes problems
- in A3 because these min/max values are used to compute
- where GUI control points should be drawn. If we see such
- values, `correct' them to the min/max of the appropriate
- parameter.
- */
-
- float min_y = c->alist()->get_min_y ();
- float max_y = c->alist()->get_max_y ();
-
- ParameterDescriptor desc;
- _plugins.front()->get_parameter_descriptor (port_id, desc);
-
- if (min_y == FLT_MIN) {
- min_y = desc.lower;
- }
-
- if (max_y == FLT_MAX) {
- max_y = desc.upper;
- }
-
- c->alist()->set_yrange (min_y, max_y);
}
} else {
error << string_compose (_("PluginInsert: automatable control %1 not found - ignored"), port_id) << endmsg;
, _plugin (p)
{
if (alist()) {
- alist()->reset_default (desc.normal);
if (desc.toggled) {
list->set_interpolation(Evoral::ControlList::Discrete);
}
: AutomationControl (p->session(), param, desc, list)
, _plugin (p)
{
- if (alist()) {
- alist()->set_yrange (desc.lower, desc.upper);
- alist()->reset_default (desc.normal);
- }
}
void
}
bool empty() const { return _events.empty(); }
- void reset_default (double val) {
- _default_value = val;
- }
-
void clear ();
void x_scale (double factor);
bool extend_to (double);
bool paste (const ControlList&, double position);
- void set_yrange (double min, double max) {
- _min_yval = min;
- _max_yval = max;
- }
-
- double get_max_y() const { return _max_yval; }
- double get_min_y() const { return _min_yval; }
-
/** truncate the event list after the given time
* @param last_coordinate last event to include
*/
};
const EventList& events() const { return _events; }
- double default_value() const { return _default_value; }
// FIXME: const violations for Curve
Glib::Threads::RWLock& lock() const { return _lock; }
EventList _events;
int8_t _frozen;
bool _changed_when_thawed;
- double _min_yval;
- double _max_yval;
- double _default_value;
bool _sort_pending;
Curve* _curve;
_interpolation = desc.toggled ? Discrete : Linear;
_frozen = 0;
_changed_when_thawed = false;
- _min_yval = desc.lower;
- _max_yval = desc.upper;
- _default_value = desc.normal;
_lookup_cache.left = -1;
_lookup_cache.range.first = _events.end();
_lookup_cache.range.second = _events.end();
{
_frozen = 0;
_changed_when_thawed = false;
- _min_yval = other._min_yval;
- _max_yval = other._max_yval;
- _default_value = other._default_value;
_lookup_cache.range.first = _events.end();
_lookup_cache.range.second = _events.end();
_search_cache.first = _events.end();
{
_frozen = 0;
_changed_when_thawed = false;
- _min_yval = other._min_yval;
- _max_yval = other._max_yval;
- _default_value = other._default_value;
_lookup_cache.range.first = _events.end();
_lookup_cache.range.second = _events.end();
_search_cache.first = _events.end();
{
if (this != &other) {
- _min_yval = other._min_yval;
- _max_yval = other._max_yval;
-
_interpolation = other._interpolation;
- _default_value = other._default_value;
copy_events (other);
}
/* clamp new value to allowed range */
- value = max (_min_yval, value);
- value = min (_max_yval, value);
+ value = max ((double)_desc.lower, value);
+ value = min ((double)_desc.upper, value);
iterator result;
DEBUG_TRACE (DEBUG::ControlList, string_compose ("editor_add: actually add when= %1 value= %2\n", when, value));
} else {
_events.insert (_events.end(), new ControlEvent (0, value));
- DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added default value %2 at zero\n", this, _default_value));
+ DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added default value %2 at zero\n", this, _desc.normal));
}
}
}
/* shortening end */
last_val = unlocked_eval (last_coordinate);
- last_val = max ((double) _min_yval, last_val);
- last_val = min ((double) _max_yval, last_val);
+ last_val = max ((double) _desc.lower, last_val);
+ last_val = min ((double) _desc.upper, last_val);
i = _events.rbegin();
first_legal_coordinate = _events.back()->when - overall_length;
first_legal_value = unlocked_eval (first_legal_coordinate);
- first_legal_value = max (_min_yval, first_legal_value);
- first_legal_value = min (_max_yval, first_legal_value);
+ first_legal_value = max ((double)_desc.lower, first_legal_value);
+ first_legal_value = min ((double)_desc.upper, first_legal_value);
/* remove all events earlier than the new "front" */
switch (npoints) {
case 0:
- return _default_value;
+ return _desc.normal;
case 1:
return _events.front()->value;
}
abort(); /*NOTREACHED*/ /* stupid gcc */
- return _default_value;
+ return _desc.normal;
}
double
return (
_parameter != other._parameter ||
_interpolation != other._interpolation ||
- _min_yval != other._min_yval ||
- _max_yval != other._max_yval ||
- _default_value != other._default_value
+ _desc.lower != other._desc.lower ||
+ _desc.upper != other._desc.upper ||
+ _desc.normal != other._desc.normal
);
}