Fix save/load of MIDI automation state. Fixes #3354.
[ardour.git] / libs / ardour / processor.cc
index 47211567bf17470cc7961b597700b0b95c2b38dc..c75a7720e0b8c3512a7d107cd3e25fb5dfd42b62 100644 (file)
@@ -61,7 +61,7 @@ const string Processor::state_node_name = "Processor";
 
 Processor::Processor(Session& session, const string& name)
        : SessionObject(session, name)
-       , AutomatableControls(session)
+       , Automatable (session)
        , _pending_active(false)
        , _active(false)
        , _next_ab_is_active(false)
@@ -150,10 +150,13 @@ Processor::set_state_2X (const XMLNode & node, int /*version*/)
                        }
 
                        if ((prop = (*i)->property ("active")) != 0) {
-                               if (_active != string_is_affirmative (prop->value())) {
-                                       _active = !_active;
-                                        _pending_active = _active;
-                                       ActiveChanged (); /* EMIT_SIGNAL */
+                               bool const a = string_is_affirmative (prop->value ());
+                               if (_active != a) {
+                                       if (a) {
+                                               activate ();
+                                       } else {
+                                               deactivate ();
+                                       }
                                }
                        }
                }
@@ -232,10 +235,13 @@ Processor::set_state (const XMLNode& node, int version)
                }
        }
 
-       if (_active != string_is_affirmative (prop->value())) {
-               _active = !_active;
-                _pending_active = _active;
-               ActiveChanged (); /* EMIT_SIGNAL */
+       bool const a = string_is_affirmative (prop->value ());
+       if (_active != a) {
+               if (a) {
+                       activate ();
+               } else {
+                       deactivate ();
+               }
        }
 
        return 0;