diff options
author | nick_m <mainsbridge@gmail.com> | 2015-10-03 05:08:26 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2015-10-20 00:53:28 +1100 |
commit | ffed94d89bbc279561e8d670b4aec1a068d7e9a9 (patch) | |
tree | 8ef84f10f394f99c6052e6ddc0efc0e20c357014 /gtk2_ardour/automation_controller.cc | |
parent | 16480001082168a25af12239bb43baa7991a99c0 (diff) |
Automation - more toggled controller twiddling.
Diffstat (limited to 'gtk2_ardour/automation_controller.cc')
-rw-r--r-- | gtk2_ardour/automation_controller.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index 691e0f3b58..14f778ffa8 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -197,28 +197,26 @@ AutomationController::toggled () { ArdourButton* but = dynamic_cast<ArdourButton*>(_widget); const AutoState as = _controllable->automation_state (); - + const double where = _controllable->session ().audible_frame (); 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()); + if (to_list) { + if (as == Touch && _controllable->list ()->in_new_write_pass ()) { + _controllable->alist ()->start_write_pass (where); } + _controllable->list ()->set_in_write_pass (true, false, where); } - _controllable->set_double (!but->get_active (), _controllable->session ().transport_frame (), to_list); + _controllable->set_double (!but->get_active (), where, to_list); - const bool was_active = _controllable->get_value() >= 0.5; - if (was_active && but->get_active()) { - _adjustment->set_value(0.0); - but->set_active(false); - } else if (!was_active && !but->get_active()) { - _adjustment->set_value(1.0); - but->set_active(true); + const bool active = _controllable->get_double (to_list, where) >= 0.5; + if (active && !but->get_active ()) { + _adjustment->set_value (1.0); + but->set_active (true); + } else if (!active && but->get_active ()) { + _adjustment->set_value (0.0); + but->set_active (false); } } } |