From b4fcdbb100ec3be331e7bd8b51a86cc198448397 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 16 Nov 2014 02:09:33 -0500 Subject: [PATCH] Don't add origin value to MIDI controller regions on initial insert. This should probably hijack the same modifier as the guard points and work the same on all automation tracks, but I did it this way to not change behaviour of track automation where a default is much more reasonable. --- gtk2_ardour/automation_region_view.cc | 2 +- libs/evoral/evoral/ControlList.hpp | 2 +- libs/evoral/src/ControlList.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index 2726cf0455..59bc1f6250 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -176,7 +176,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double view->session()->begin_reversible_command (_("add automation event")); XMLNode& before = _line->the_list()->get_state(); - _line->the_list()->add (when_d, y, with_guard_points); + _line->the_list()->add (when_d, y, with_guard_points, false); XMLNode& after = _line->the_list()->get_state(); diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index daa4aa93a6..3c4b192159 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -121,7 +121,7 @@ public: virtual bool clamp_value (double& /*when*/, double& /*value*/) const { return true; } - virtual void add (double when, double value, bool with_guards=true); + virtual void add (double when, double value, bool with_guards=true, bool with_default=true); virtual void editor_add (double when, double value); void fast_simple_add (double when, double value); diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index 6717261713..bc8626c535 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -477,7 +477,7 @@ ControlList::editor_add (double when, double value) } void -ControlList::add (double when, double value, bool with_guards) +ControlList::add (double when, double value, bool with_guards, bool with_default) { /* this is for making changes from some kind of user interface or control surface (GUI, MIDI, OSC etc) @@ -494,7 +494,7 @@ ControlList::add (double when, double value, bool with_guards) ControlEvent cp (when, 0.0f); iterator insertion_point; - if (_events.empty()) { + if (_events.empty() && with_default) { /* as long as the point we're adding is not at zero, * add an "anchor" point there.