summaryrefslogtreecommitdiff
path: root/libs/ardour/windows_vst_plugin.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-03-06 23:49:40 +0100
committerRobin Gareus <robin@gareus.org>2017-03-07 00:13:56 +0100
commite1095310a8186bbd977534285df0ab29423d3aa3 (patch)
treeeae28a2a01773762ae77bf7b12c1270df7d468cb /libs/ardour/windows_vst_plugin.cc
parent589c13c0eb9f6003a7e8cf923110459c897ea4b0 (diff)
Rework VST initialization:
Set the AEffect* plugin pointer before calling effOpen. effOpen may call back into the host (masterCallback) and invoke actions which depend on _plugin (eg. to call back into the plugin again)
Diffstat (limited to 'libs/ardour/windows_vst_plugin.cc')
-rw-r--r--libs/ardour/windows_vst_plugin.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/ardour/windows_vst_plugin.cc b/libs/ardour/windows_vst_plugin.cc
index 53bfee05e8..82304a9f93 100644
--- a/libs/ardour/windows_vst_plugin.cc
+++ b/libs/ardour/windows_vst_plugin.cc
@@ -39,9 +39,10 @@ WindowsVSTPlugin::WindowsVSTPlugin (AudioEngine& e, Session& session, VSTHandle*
if ((_state = fst_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
+ open_plugin ();
Session::vst_current_loading_id = 0;
- set_plugin (_state->plugin);
+ init_plugin ();
}
WindowsVSTPlugin::WindowsVSTPlugin (const WindowsVSTPlugin &other)
@@ -53,17 +54,16 @@ WindowsVSTPlugin::WindowsVSTPlugin (const WindowsVSTPlugin &other)
if ((_state = fst_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 ();
}
WindowsVSTPlugin::~WindowsVSTPlugin ()