- /* TODO: This should be more generic (use ParameterDescriptor)
- * or better yet: Controllable -> set_interface();
- */
- if ( alist->parameter().type() == GainAutomation
- || alist->parameter().type() == EnvelopeAutomation
- || (_desc.logarithmic && _desc.lower == 0. && _desc.upper > _desc.lower)) {
- y = slider_position_to_gain_with_max (y, _desc.upper);
- y = max ((double)_desc.lower, y);
- y = min ((double)_desc.upper, y);
- } else if (alist->parameter().type() == TrimAutomation
- || (_desc.logarithmic && _desc.lower * _desc.upper > 0 && _desc.upper > _desc.lower)) {
- const double lower_db = accurate_coefficient_to_dB (_desc.lower);
- const double range_db = accurate_coefficient_to_dB (_desc.upper) - lower_db;
- y = max (0.0, y);
- y = min (1.0, y);
- y = dB_to_coefficient (lower_db + y * range_db);
- } else if (alist->parameter().type() == PanAzimuthAutomation ||
- alist->parameter().type() == PanElevationAutomation) {
- y = 1.0 - y;
- } else if (alist->parameter().type() == PanWidthAutomation) {
- y = 2.0 * y - 1.0;
- } else {
- y = y * (double)(alist->get_max_y() - alist->get_min_y()) + alist->get_min_y();
- if (_desc.integer_step) {
- y = round(y);
- } else if (_desc.toggled) {
- y = (y > 0.5) ? 1.0 : 0.0;
+#ifdef XXX_NEW_INTERPOLATON__BREAK_SESSION_FORMAT_XXX
+ if (alist->default_interpolation () != alist->interpolation()) {
+ switch (alist->interpolation()) {
+ case AutomationList::Linear:
+ y = y * (_desc.upper - _desc.lower) + _desc.lower;
+ return;
+ default:
+ assert (0);
+ break;