summaryrefslogtreecommitdiff
path: root/libs/ardour/lxvst_plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/lxvst_plugin.cc')
-rw-r--r--libs/ardour/lxvst_plugin.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/ardour/lxvst_plugin.cc b/libs/ardour/lxvst_plugin.cc
index b71f9fa378..259c5e6461 100644
--- a/libs/ardour/lxvst_plugin.cc
+++ b/libs/ardour/lxvst_plugin.cc
@@ -40,9 +40,10 @@ LXVSTPlugin::LXVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int un
if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
+ open_plugin ();
Session::vst_current_loading_id = 0;
- set_plugin (_state->plugin);
+ init_plugin ();
}
LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other)
@@ -54,17 +55,16 @@ LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other)
if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
+ open_plugin ();
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;
- set_plugin (_state->plugin);
+ init_plugin ();
}
LXVSTPlugin::~LXVSTPlugin ()
@@ -120,6 +120,7 @@ LXVSTPluginInfo::get_presets (bool user_only) const
Session::vst_current_loading_id = atoi (unique_id);
AEffect* plugin = handle->main_entry (Session::vst_callback);
Session::vst_current_loading_id = 0;
+ plugin->user = NULL;
plugin->dispatcher (plugin, effOpen, 0, 0, 0, 0); // :(
int const vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0);