Assume VST chunks are portable (Mac, Linux, Windows VST)
authorRobin Gareus <robin@gareus.org>
Tue, 25 Apr 2017 16:40:43 +0000 (18:40 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 25 Apr 2017 16:40:43 +0000 (18:40 +0200)
libs/ardour/plugin_insert.cc
libs/ardour/vst_plugin.cc

index cad48904949c2c233317aa2af1218f7520dcb706..c20464be8990a10d4e72b09972c6c8e56e6de8fd 100644 (file)
@@ -2487,6 +2487,7 @@ PluginInsert::set_state(const XMLNode& node, int version)
        }
 
        boost::shared_ptr<Plugin> plugin = find_plugin (_session, prop->value(), type);
+       bool any_vst = false;
 
        /* treat VST plugins equivalent if they have the same uniqueID
         * allow to move sessions windows <> linux */
@@ -2494,6 +2495,7 @@ PluginInsert::set_state(const XMLNode& node, int version)
        if (plugin == 0 && (type == ARDOUR::Windows_VST || type == ARDOUR::MacVST)) {
                type = ARDOUR::LXVST;
                plugin = find_plugin (_session, prop->value(), type);
+               if (plugin) { any_vst = true; }
        }
 #endif
 
@@ -2501,6 +2503,7 @@ PluginInsert::set_state(const XMLNode& node, int version)
        if (plugin == 0 && (type == ARDOUR::LXVST || type == ARDOUR::MacVST)) {
                type = ARDOUR::Windows_VST;
                plugin = find_plugin (_session, prop->value(), type);
+               if (plugin) { any_vst = true; }
        }
 #endif
 
@@ -2508,6 +2511,7 @@ PluginInsert::set_state(const XMLNode& node, int version)
        if (plugin == 0 && (type == ARDOUR::Windows_VST || type == ARDOUR::LXVST)) {
                type = ARDOUR::MacVST;
                plugin = find_plugin (_session, prop->value(), type);
+               if (plugin) { any_vst = true; }
        }
 #endif
 
@@ -2575,7 +2579,9 @@ PluginInsert::set_state(const XMLNode& node, int version)
                   and set all plugins to the same state.
                */
 
-               if ((*niter)->name() == plugin->state_node_name()) {
+               if (   ((*niter)->name() == plugin->state_node_name())
+                   || (any_vst && ((*niter)->name() == "lxvst" || (*niter)->name() == "windows-vst" || (*niter)->name() == "mac-vst"))
+                  ) {
 
                        for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
                                /* Plugin state can include external files which are named after the ID.
index ff226f44ca1c9bc8c8fdee711d30324cf32870e8..6b1f0b325441edd550b569aef03b0a36affd66d2 100644 (file)
@@ -282,11 +282,6 @@ VSTPlugin::set_state (const XMLNode& node, int version)
        LocaleGuard lg;
        int ret = -1;
 
-       if (node.name() != state_node_name()) {
-               error << _("Bad node sent to VSTPlugin::set_state") << endmsg;
-               return 0;
-       }
-
 #ifndef NO_PLUGIN_STATE
        XMLNode* child;