fix import of v2 session redirects: active or inactive
authorBen Loftis <ben@harrisonconsoles.com>
Thu, 5 Mar 2015 18:48:30 +0000 (12:48 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Thu, 5 Mar 2015 18:48:30 +0000 (12:48 -0600)
libs/ardour/processor.cc
libs/ardour/route.cc

index ca1f71db5ae0ea727ba145e65b109c85743cb3dc..fa6cab579ad7cff165ddc111c4beba1afc6fadae 100644 (file)
@@ -150,7 +150,9 @@ Processor::set_state_2X (const XMLNode & node, int /*version*/)
                        
                        set_id (**i);
 
-                       if ((prop = (*i)->property ("active")) != 0) {
+                       //note:  in A2, active state was stored in the Redirect node, not the child IO node
+                       /*
+                        * if ((prop = (*i)->property ("active")) != 0) {
                                bool const a = string_is_affirmative (prop->value ());
                                if (_active != a) {
                                        if (a) {
@@ -159,7 +161,8 @@ Processor::set_state_2X (const XMLNode & node, int /*version*/)
                                                deactivate ();
                                        }
                                }
-                       }
+                       }*/
+                       
                }
        }
 
index ef46cd403e252ec412fe18fab31641a4e81b0707..3ff30f826eb4335064d2bf8773deceef22b37d5d 100644 (file)
@@ -1217,8 +1217,18 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
                if (processor->set_state (node, version)) {
                        return false;
                }
+               
+               //A2 uses the "active" flag in the toplevel redirect node, not in the child plugin/IO
+               if (i != children.end()) {
+                       if ((prop = (*i)->property (X_("active"))) != 0) {
+                               if ( string_is_affirmative (prop->value()) )
+                                       processor->activate();
+                               else
+                                       processor->deactivate();
+                       }
+               }
 
-               return (add_processor (processor, placement) == 0);
+               return (add_processor (processor, placement, 0, false) == 0);
        }
 
        catch (failed_constructor &err) {