Toggled automation fixes.
authornick_m <mainsbridge@gmail.com>
Mon, 21 Sep 2015 17:20:39 +0000 (03:20 +1000)
committernick_m <mainsbridge@gmail.com>
Mon, 19 Oct 2015 13:53:27 +0000 (00:53 +1100)
- don't attempt to insert two points on toggle.
- remove forced touch->write mode change on toggle
- initial state still wrong, but works much better overall.

gtk2_ardour/automation_controller.cc
libs/ardour/route.cc

index a20ae54211146714fd10baa7cac74b99bb21ba5d..1bce94dca2b464c9f024fd3f41bd67680891d607 100644 (file)
@@ -86,7 +86,6 @@ AutomationController::AutomationController(boost::shared_ptr<Automatable>
                but->set_controllable(ac);
                but->signal_clicked.connect(
                        sigc::mem_fun(*this, &AutomationController::toggled));
-
                _widget = but;
        } else {
                AutomationBarController* bar = manage(new AutomationBarController(_printer, ac, adj));
@@ -198,14 +197,6 @@ AutomationController::toggled ()
 {
        ArdourButton* but = dynamic_cast<ArdourButton*>(_widget);
        if (but) {
-               if (_controllable->session().transport_rolling()) {
-                       if (_controllable->automation_state() == Touch) {
-                               _controllable->set_automation_state(Write);
-                       }
-                       if (_controllable->list()) {
-                               _controllable->list()->set_in_write_pass(true, true, _controllable->session().audible_frame());
-                       }
-               }
                const bool was_active = _controllable->get_value() >= 0.5;
                if (was_active && but->get_active()) {
                        _adjustment->set_value(0.0);
index c3b09df2d36cf25b00857ad8f058d52f0a73c306..cb3f0d48c94fee50cabff6eca55f18bde90d7ea4 100644 (file)
@@ -3900,7 +3900,16 @@ Route::MuteControllable::set_superficial_value(bool muted)
        /* Note we can not use AutomationControl::set_value here since it will emit
           Changed(), but the value will not be correct to the observer. */
 
-       bool to_list = _list && ((AutomationList*)_list.get())->automation_write();
+       /* this is a tweak of ControlList::automation_write ()
+          as currently MuteControllable can't be touching.
+          bool to_list = _list && ((AutomationList*)_list.get())->automation_write();
+       */
+       const AutoState as = ((AutomationList*)_list.get())->automation_state ();
+       bool to_list = _list && _session.transport_rolling () && (as == Touch || as == Write);
+
+       if (to_list) {
+               _list->set_in_write_pass(true, false, _session.audible_frame ());
+       }
 
        Control::set_double (muted, _session.transport_frame(), to_list);
 }
@@ -3916,6 +3925,8 @@ Route::MuteControllable::set_value (double val)
        }
 
        if (_list && ((AutomationList*)_list.get())->automation_playback()) {
+               // Set superficial/automation value to drive controller (and possibly record)
+               set_superficial_value (bval);
                // Playing back automation, set route mute directly
                r->set_mute (bval, this);
        } else {
@@ -3924,9 +3935,6 @@ Route::MuteControllable::set_value (double val)
                rl->push_back (r);
                _session.set_mute (rl, bval, Session::rt_cleanup);
        }
-
-       // Set superficial/automation value to drive controller (and possibly record)
-       set_superficial_value(bval);
 }
 
 double