summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/automation_controller.cc')
-rw-r--r--gtk2_ardour/automation_controller.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc
index 1bce94dca2..691e0f3b58 100644
--- a/gtk2_ardour/automation_controller.cc
+++ b/gtk2_ardour/automation_controller.cc
@@ -196,7 +196,22 @@ void
AutomationController::toggled ()
{
ArdourButton* but = dynamic_cast<ArdourButton*>(_widget);
+ const AutoState as = _controllable->automation_state ();
+
+ const bool to_list = _controllable->list () && _controllable->session().transport_rolling () && (as == Touch || as == Write);
+
if (but) {
+ if (_controllable->session().transport_rolling()) {
+ if (_controllable->automation_state() == Touch && _controllable->list()->in_new_write_pass ()) {
+ _controllable->alist()->start_write_pass ( _controllable->session().audible_frame());
+ }
+ if (_controllable->list()) {
+ _controllable->list()->set_in_write_pass(true, false, _controllable->session().audible_frame());
+ }
+ }
+
+ _controllable->set_double (!but->get_active (), _controllable->session ().transport_frame (), to_list);
+
const bool was_active = _controllable->get_value() >= 0.5;
if (was_active && but->get_active()) {
_adjustment->set_value(0.0);