From 77d5fb7a359e87a51a9eca4adf926d69bc3bdeaf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 29 Nov 2014 14:32:12 -0500 Subject: [PATCH] Fix write for boolean automation. --- gtk2_ardour/automation_controller.cc | 17 +++++++++++------ libs/ardour/automation_control.cc | 9 --------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index a8051f0eb4..511fb0bf2f 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -162,12 +162,15 @@ AutomationController::value_adjusted () { if (!_ignore_change) { _controllable->set_value (_controllable->interface_to_internal(_adjustment->get_value())); - } else { - /* A bar controller will automatically follow the adjustment, but for a - button we have to do it manually. */ - ArdourButton* but = dynamic_cast(_widget); - if (but) { - but->set_active(_adjustment->get_value() >= 0.5); + } + + /* A bar controller will automatically follow the adjustment, but for a + button we have to do it manually. */ + ArdourButton* but = dynamic_cast(_widget); + if (but) { + const bool active = _adjustment->get_value() >= 0.5; + if (but->get_active() != active) { + but->set_active(active); } } } @@ -202,6 +205,7 @@ AutomationController::toggled () { ArdourButton* but = dynamic_cast(_widget); if (but) { + start_touch(); const bool was_active = _controllable->get_value() >= 0.5; if (was_active) { _adjustment->set_value(0.0); @@ -210,6 +214,7 @@ AutomationController::toggled () _adjustment->set_value(1.0); but->set_active(true); } + end_touch(); } } diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index d209e733d5..e21fda6874 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -62,15 +62,6 @@ AutomationControl::set_value (double value) { bool to_list = _list && ((AutomationList*)_list.get())->automation_write(); - if (to_list && parameter().toggled()) { - - // store the previous value just before this so any - // interpolation works right - - - _list->add (get_double(), _session.transport_frame()-1); - } - Control::set_double (value, _session.transport_frame(), to_list); Changed(); /* EMIT SIGNAL */