if ((_state = mac_vst_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor ();
}
+ open_plugin ();
Session::vst_current_loading_id = 0;
- set_plugin (_state->plugin);
+ init_plugin ();
}
MacVSTPlugin::MacVSTPlugin (const MacVSTPlugin &other)
if ((_state = mac_vst_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 ();
}
MacVSTPlugin::~MacVSTPlugin ()
mac_vst_close (_state);
}
+void
+MacVSTPlugin::open_plugin ()
+{
+ VSTPlugin::open_plugin ();
+ _plugin->dispatcher (_plugin, effCanDo, 0, 0, const_cast<char*> ("hasCockosViewAsConfig"), 0.0f);
+}
+
PluginPtr
MacVSTPluginInfo::load (Session& session)
{
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);