copy VST state on copy construction
authorRobin Gareus <robin@gareus.org>
Sun, 13 Nov 2016 15:34:27 +0000 (16:34 +0100)
committerRobin Gareus <robin@gareus.org>
Sun, 13 Nov 2016 15:35:06 +0000 (16:35 +0100)
This fixes issues with replicate instances & plugin-analysis instances
not using the same set of parameters.

libs/ardour/lxvst_plugin.cc
libs/ardour/mac_vst_plugin.cc
libs/ardour/windows_vst_plugin.cc

index 3939048ad443e7ceca3ccaebb7227b7db66c6e3b..91ae75788340989ac4ea1ca4c15205fc38abcb4b 100644 (file)
@@ -58,7 +58,11 @@ LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other)
 
        _plugin = _state->plugin;
 
-       // Plugin::setup_controls ();
+       XMLNode* root = new XMLNode (other.state_node_name ());
+       LocaleGuard lg;
+       other.add_state (root);
+       set_state (*root, Stateful::loading_state_version);
+       delete root;
 }
 
 LXVSTPlugin::~LXVSTPlugin ()
index 08c39b1d354b31f55ee2f7a957aaf484bcfb5d85..2cb7301ce800116699daf653a57344929c4dfb18 100644 (file)
@@ -58,7 +58,11 @@ MacVSTPlugin::MacVSTPlugin (const MacVSTPlugin &other)
 
        _plugin = _state->plugin;
 
-       // Plugin::setup_controls ();
+       XMLNode* root = new XMLNode (other.state_node_name ());
+       LocaleGuard lg;
+       other.add_state (root);
+       set_state (*root, Stateful::loading_state_version);
+       delete root;
 }
 
 MacVSTPlugin::~MacVSTPlugin ()
index 17cfa1eed7c4120f2070ba3080b21ceabf536ca5..256d7f89a8bb13ee2fbf17bc4cbb0c81fbef1b55 100644 (file)
@@ -56,6 +56,12 @@ WindowsVSTPlugin::WindowsVSTPlugin (const WindowsVSTPlugin &other)
        Session::vst_current_loading_id = 0;
 
        _plugin = _state->plugin;
+
+       XMLNode* root = new XMLNode (other.state_node_name ());
+       LocaleGuard lg;
+       other.add_state (root);
+       set_state (*root, Stateful::loading_state_version);
+       delete root;
 }
 
 WindowsVSTPlugin::~WindowsVSTPlugin ()