fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / gain_control.cc
index 3ffeb057da8fc1d0cc26a128375b15998470a3f7..8910c9a98c6b4fafac48905d420e24f4febeec35 100644 (file)
@@ -27,7 +27,7 @@
 #include "ardour/vca.h"
 #include "ardour/vca_manager.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace std;
@@ -178,48 +178,6 @@ GainControl::get_state ()
 int
 GainControl::set_state (XMLNode const& node, int version)
 {
-       AutomationControl::set_state (node, version);
-
-#if 0
-       XMLProperty const* prop = node.property (X_("masters"));
-
-       /* Problem here if we allow VCA's to be slaved to other VCA's .. we
-        * have to load all VCAs first, then set up slave/master relationships
-        * once we have them all.
-        */
-
-       if (prop) {
-               masters_string = prop->value ();
-
-               if (_session.vca_manager().vcas_loaded()) {
-                       vcas_loaded ();
-               } else {
-                       _session.vca_manager().VCAsLoaded.connect_same_thread (vca_loaded_connection, boost::bind (&GainControl::vcas_loaded, this));
-               }
-       }
-#endif
-
-       return 0;
-}
-
-void
-GainControl::vcas_loaded ()
-{
-       if (masters_string.empty()) {
-               return;
-       }
-
-       vector<string> masters;
-       split (masters_string, masters, ',');
-
-       for (vector<string>::const_iterator m = masters.begin(); m != masters.end(); ++m) {
-               boost::shared_ptr<VCA> vca = _session.vca_manager().vca_by_number (PBD::atoi (*m));
-               if (vca) {
-                       add_master (vca->gain_control());
-               }
-       }
-
-       vca_loaded_connection.disconnect ();
-       masters_string.clear ();
+       return AutomationControl::set_state (node, version);
 }