Replace thinning static state with parameter.
[ardour.git] / libs / ardour / route.cc
index d67c1bbd86045f2c88988d98ae7dcc8c2507e7ec..e6ab6fb6fc544e20e3252d2c235454089c3b9af0 100644 (file)
@@ -2035,6 +2035,10 @@ Route::state(bool full_state)
        node->add_child_nocopy (_mute_control->get_state ());
        node->add_child_nocopy (_mute_master->get_state ());
 
+       if (full_state) {
+               node->add_child_nocopy (Automatable::get_automation_xml_state ());
+       }
+
        XMLNode* remote_control_node = new XMLNode (X_("RemoteControl"));
        snprintf (buf, sizeof (buf), "%d", _remote_control_id);
        remote_control_node->add_property (X_("id"), buf);
@@ -2305,6 +2309,9 @@ Route::set_state (const XMLNode& node, int version)
 
                } else if (child->name() == X_("MuteMaster")) {
                        _mute_master->set_state (*child, version);
+
+               } else if (child->name() == Automatable::xml_node_name) {
+                       set_automation_xml_state (*child, Evoral::Parameter(NullAutomation));
                }
        }
 
@@ -3392,6 +3399,7 @@ Route::SoloControllable::SoloControllable (std::string name, boost::shared_ptr<R
        , _route (r)
 {
        boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(SoloAutomation)));
+       gl->set_interpolation(Evoral::ControlList::Discrete);
        set_list (gl);
 }
 
@@ -3440,6 +3448,7 @@ Route::MuteControllable::MuteControllable (std::string name, boost::shared_ptr<R
        , _route (r)
 {
        boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(MuteAutomation)));
+       gl->set_interpolation(Evoral::ControlList::Discrete);
        set_list (gl);
 }
 
@@ -3448,15 +3457,22 @@ Route::MuteControllable::set_value (double val)
 {
        bool bval = ((val >= 0.5f) ? true: false);
 
-       boost::shared_ptr<RouteList> rl (new RouteList);
+       // boost::shared_ptr<RouteList> rl (new RouteList);
 
        boost::shared_ptr<Route> r = _route.lock ();
        if (!r) {
                return;
        }
 
-       rl->push_back (r);
-       _session.set_mute (rl, bval);
+       /* I don't know why this apparently "should" be done via the RT event
+          system, but doing so causes a ton of annoying errors... */
+       // rl->push_back (r);
+       // _session.set_mute (rl, bval);
+
+       /* ... but this seems to work. */
+       r->set_mute (bval, this);
+
+       AutomationControl::set_value(bval);
 }
 
 double