summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-10-03 23:47:52 +1000
committernick_m <mainsbridge@gmail.com>2015-10-20 00:53:28 +1100
commitff2f93497793545fbe6206e3d3c8cf559619d2a9 (patch)
treea114f7a78003ebed3812ad1d2331f25e7160a730 /libs/evoral
parentffed94d89bbc279561e8d670b4aec1a068d7e9a9 (diff)
Fix incorrect initial point when recording toggled automation.
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/src/ControlList.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp
index d9c1b993bd..6d07ff150a 100644
--- a/libs/evoral/src/ControlList.cpp
+++ b/libs/evoral/src/ControlList.cpp
@@ -584,8 +584,15 @@ ControlList::add (double when, double value, bool with_guards, bool with_initial
/* empty: add an "anchor" point if the point we're adding past time 0 */
if (when >= 1) {
- _events.insert (_events.end(), new ControlEvent (0, value));
- DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added default value %2 at zero\n", this, _default_value));
+ if (_desc.toggled) {
+ const bool bval = ((value >= 0.5) ? true : false);
+ _events.insert (_events.end(), new ControlEvent (0, !bval));
+ DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added bool value %2 at zero\n", this, !bval));
+
+ } else {
+ _events.insert (_events.end(), new ControlEvent (0, value));
+ DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added default value %2 at zero\n", this, _default_value));
+ }
}
}