A few fixes to interpolation of MIDI controller data. Don't interpolate
[ardour.git] / libs / evoral / src / ControlList.cpp
index 3eb6c7d4ce969db3520a1b148509ab15584e0e31..bfe4c953659fd3fa0adbb28d6859fae82ef51078 100644 (file)
@@ -954,10 +954,11 @@ ControlList::rt_safe_earliest_event(double start, double end, double& x, double&
 bool
 ControlList::rt_safe_earliest_event_unlocked(double start, double end, double& x, double& y, bool inclusive) const
 {
-       if (_interpolation == Discrete)
+       if (_interpolation == Discrete) {
                return rt_safe_earliest_event_discrete_unlocked(start, end, x, y, inclusive);
-       else
+       } else {
                return rt_safe_earliest_event_linear_unlocked(start, end, x, y, inclusive);
+       }
 }
 
 
@@ -1356,5 +1357,16 @@ ControlList::move_ranges (const list< RangeMove<double> >& movements)
        maybe_signal_changed ();
 }
 
+void
+ControlList::set_interpolation (InterpolationStyle s)
+{
+       if (_interpolation == s) {
+               return;
+       }
+
+       _interpolation = s;
+       InterpolationChanged (s); /* EMIT SIGNAL */
+}
+
 } // namespace Evoral