Don't add standard processors twice to routes from 2.X sessions. Fixes #3434.
[ardour.git] / libs / ardour / ladspa_plugin.cc
index 6e2acfbe096d066f89499fc9713d8e1c51bda39f..cc532c61ca151f077a3168e08044c936808b0607 100644 (file)
@@ -144,8 +144,6 @@ LadspaPlugin::~LadspaPlugin ()
        deactivate ();
        cleanup ();
 
-       GoingAway (); /* EMIT SIGNAL */
-
        /* XXX who should close a plugin? */
 
         // dlclose (module);
@@ -180,8 +178,6 @@ LadspaPlugin::default_value (uint32_t port)
                        sr_scaling = true;
                }
 
-               /* FIXME: add support for logarithmic defaults */
-
                else if (LADSPA_IS_HINT_DEFAULT_LOW(prh[port].HintDescriptor)) {
                        if (LADSPA_IS_HINT_LOGARITHMIC(prh[port].HintDescriptor)) {
                                ret = exp(log(prh[port].LowerBound) * 0.75f + log(prh[port].UpperBound) * 0.25f);
@@ -393,9 +389,6 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
        uint32_t port_id;
        LocaleGuard lg (X_("POSIX"));
 
-       cout << "LADSPA Plugin set state " << version << "\n";
-       cout << "- node " << node.name() << "\n";
-
        if (node.name() != state_node_name()) {
                error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
                return -1;
@@ -430,7 +423,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
 }
 
 int
-LadspaPlugin::set_state_2X (const XMLNode& node, int version)
+LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
 {
        XMLNodeList nodes;
        XMLProperty *prop;
@@ -441,9 +434,6 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int version)
        uint32_t port_id;
        LocaleGuard lg (X_("POSIX"));
 
-       cout << "LADSPA Plugin set state " << version << "\n";
-       cout << "- node " << node.name() << "\n";
-
        if (node.name() != state_node_name()) {
                error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
                return -1;
@@ -644,6 +634,9 @@ LadspaPlugin::run_in_place (nframes_t nframes)
                        _control_data[i] = _shadow_data[i];
                }
        }
+
+       assert (_was_activated);
+       
        _descriptor->run (_handle, nframes);
 }
 
@@ -701,6 +694,7 @@ LadspaPluginInfo::load (Session& session)
                if ((module = dlopen (path.c_str(), RTLD_NOW)) == 0) {
                        error << string_compose(_("LADSPA: cannot load module from \"%1\""), path) << endmsg;
                        error << dlerror() << endmsg;
+                        return PluginPtr ((Plugin*) 0);
                } else {
                        plugin.reset (new LadspaPlugin (module, session.engine(), session, index, session.frame_rate()));
                }
@@ -713,3 +707,8 @@ LadspaPluginInfo::load (Session& session)
                return PluginPtr ((Plugin*) 0);
        }
 }
+
+LadspaPluginInfo::LadspaPluginInfo()
+{
+       type = ARDOUR::LADSPA;
+}