From 6ecbeed8e82f594bf354d4f3974f601829b55002 Mon Sep 17 00:00:00 2001 From: nick_m Date: Thu, 18 Jun 2015 10:03:18 +1000 Subject: [PATCH] Fix ControlList::editor_add () wrt guard points. --- libs/evoral/src/ControlList.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index d592be3491..5118744c05 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -469,13 +469,18 @@ ControlList::editor_add (double when, double value, bool with_guard) } } + insert_position = when; + if (with_guard) { + if (when > 64) { + add_guard_point (when - 64); + } + maybe_add_insert_guard (when); + } + ControlEvent cp (when, 0.0f); iterator i = lower_bound (_events.begin(), _events.end(), &cp, time_comparator); DEBUG_TRACE (DEBUG::ControlList, string_compose ("editor_add: actually add when= %1 value= %2\n", when, value)); _events.insert (i, new ControlEvent (when, value)); - if (with_guard) { - add_guard_point (when); - } mark_dirty ();