continue with MTC debugging
[ardour.git] / libs / ardour / processor.cc
index c8f7a136bb28473b69f261ace5f2923a202be4a7..3bc9db024bef1873c5b1d0db710cb38f5a8648b6 100644 (file)
@@ -70,6 +70,7 @@ Processor::Processor(Session& session, const string& name)
        , _next_ab_is_active(false)
        , _configured(false)
        , _gui(0)
+       , _display_to_user (true)
 {
 }
 
@@ -81,8 +82,9 @@ Processor::Processor (Session& session, const XMLNode& node)
        , _next_ab_is_active(false)
        , _configured(false)
        , _gui(0)
+       , _display_to_user (true)
 {
-       set_state (node);
+       set_state (node, Stateful::loading_state_version);
        _pending_active = _active;
 }
 
@@ -145,8 +147,43 @@ Processor::state (bool full_state)
 }
 
 int
-Processor::set_state (const XMLNode& node)
+Processor::set_state_2X (const XMLNode & node, int /*version*/)
 {
+       XMLProperty const * prop;
+
+       XMLNodeList children = node.children ();
+
+       for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
+
+               if ((*i)->name() == X_("IO")) {
+
+                       if ((prop = (*i)->property ("name")) != 0) {
+                               set_name (prop->value ());
+                       }
+
+                       if ((prop = (*i)->property ("id")) != 0) {
+                               _id = prop->value ();
+                       }
+
+                       if ((prop = (*i)->property ("active")) != 0) {
+                               if (_active != string_is_affirmative (prop->value())) {
+                                       _active = !_active;
+                                       ActiveChanged (); /* EMIT_SIGNAL */
+                               }
+                       }
+               }
+       }
+
+       return 0;
+}
+
+int
+Processor::set_state (const XMLNode& node, int version)
+{
+       if (version < 3000) {
+               return set_state_2X (node, version);
+       }
+       
        const XMLProperty *prop;
        const XMLProperty *legacy_active = 0;
 
@@ -236,3 +273,10 @@ Processor::configure_io (ChanCount in, ChanCount out)
 
        return true;
 }
+
+void
+Processor::set_display_to_user (bool yn) 
+{
+       _display_to_user = yn;
+}
+