summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-10-02 19:43:55 +0200
committerRobin Gareus <robin@gareus.org>2017-10-03 02:20:57 +0200
commit86d3735ea89504dfb280a6a435794383af482841 (patch)
tree7d1bedde59701e3f7ad302e23913734832e9bef9 /gtk2_ardour/automation_line.cc
parent3f48d00081aa2f34e42d4219c01757b6f27392e3 (diff)
Fix MIDI Automation interpolation options
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index 2353b6c2fc..7e247044dd 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -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;
}