Fix MIDI Automation interpolation options
authorRobin Gareus <robin@gareus.org>
Mon, 2 Oct 2017 17:43:55 +0000 (19:43 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 3 Oct 2017 00:20:57 +0000 (02:20 +0200)
gtk2_ardour/automation_line.cc

index 2353b6c2fcacab67b6e59ad69d58b9b11976ca61..7e247044dde7b5c7ea39775d344376543406a4f0 100644 (file)
@@ -1177,10 +1177,18 @@ AutomationLine::view_to_model_coord_y (double& y) const
 {
        if (alist->default_interpolation () != alist->interpolation()) {
                switch (alist->interpolation()) {
+                       case AutomationList::Discrete:
+                               /* toggles and MIDI only -- see is_stepped() */
+                               assert (alist->default_interpolation () == AutomationList::Linear);
+                               break;
                        case AutomationList::Linear:
                                y = y * (_desc.upper - _desc.lower) + _desc.lower;
                                return;
                        default:
+                               /* types that default to linear, can't be use
+                                * Logarithmic or Exponential interpolation.
+                                * "Curved" is invalid for automation (only x-fads)
+                                */
                                assert (0);
                                break;
                }
@@ -1211,10 +1219,18 @@ AutomationLine::model_to_view_coord_y (double& y) const
 {
        if (alist->default_interpolation () != alist->interpolation()) {
                switch (alist->interpolation()) {
+                       case AutomationList::Discrete:
+                               /* toggles and MIDI only -- see is_stepped */
+                               assert (alist->default_interpolation () == AutomationList::Linear);
+                               break;
                        case AutomationList::Linear:
                                y = (y - _desc.lower) / (_desc.upper - _desc.lower);
                                return;
                        default:
+                               /* types that default to linear, can't be use
+                                * Logarithmic or Exponential interpolation.
+                                * "Curved" is invalid for automation (only x-fads)
+                                */
                                assert (0);
                                break;
                }