diff options
author | nick_m <mainsbridge@gmail.com> | 2015-09-27 00:57:52 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2015-10-20 00:53:28 +1100 |
commit | 9c102fa8d20b932f9a9879298764c0351a0e5acc (patch) | |
tree | ed9bbf05a2b6771d1dbe9e86b5e586f24c2debc1 /gtk2_ardour/automation_controller.cc | |
parent | 877b258c74aa6e2fa737ca9112900dca8bce6628 (diff) |
Make automation record undo per pass rather than per touch.
Diffstat (limited to 'gtk2_ardour/automation_controller.cc')
-rw-r--r-- | gtk2_ardour/automation_controller.cc | 15 |
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); |