X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Flinux_vst_support.cc;h=498cbc8339c49076a9f8289d06e6a69e63cedfa4;hb=0eaf7b1e18ba0f6e9ce600f0a99c0fd218b44d81;hp=065e8bd755b9e79674b7cc05d480642860c89eba;hpb=5dc24971009b20a662a58a2e01c47df9b6b5526b;p=ardour.git diff --git a/libs/ardour/linux_vst_support.cc b/libs/ardour/linux_vst_support.cc index 065e8bd755..498cbc8339 100644 --- a/libs/ardour/linux_vst_support.cc +++ b/libs/ardour/linux_vst_support.cc @@ -219,12 +219,10 @@ vstfx_load (const char *path) /*Find the main entry point into the plugin*/ - fhandle->main_entry = (main_entry_t) dlsym(fhandle->dll, "main"); + fhandle->main_entry = (main_entry_t) dlsym(fhandle->dll, "VSTPluginMain"); if (fhandle->main_entry == 0) { - if ((fhandle->main_entry = (main_entry_t) dlsym(fhandle->dll, "VSTPluginMain")) != 0) { - PBD::warning << path << _(": is a VST >= 2.4 - this plugin may or may not function correctly with this version of Ardour.") << endmsg; - } + fhandle->main_entry = (main_entry_t) dlsym(fhandle->dll, "main"); } if (fhandle->main_entry == 0) @@ -299,7 +297,7 @@ vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr) } vstfx->handle = fhandle; - vstfx->plugin->user = userptr; + vstfx->plugin->ptr1 = userptr; if (vstfx->plugin->magic != kEffectMagic) { @@ -308,14 +306,16 @@ vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr) return 0; } - vstfx->plugin->dispatcher (vstfx->plugin, effOpen, 0, 0, 0, 0); - - /*May or May not need to 'switch the plugin on' here - unlikely - since FST doesn't and most plugins start up 'On' by default - I think this is the least of our worries*/ - - //vstfx->plugin->dispatcher (vstfx->plugin, effMainsChanged, 0, 1, 0, 0); - - vstfx->vst_version = vstfx->plugin->dispatcher (vstfx->plugin, effGetVstVersion, 0, 0, 0, 0); + if (!userptr) { + /* scanning.. or w/o master-callback userptr == 0, open now. + * + * Session::vst_callback needs a pointer to the AEffect + * ((VSTPlugin*)userptr)->_plugin = vstfx->plugin + * before calling effOpen, because effOpen may call back + */ + vstfx->plugin->dispatcher (vstfx->plugin, effOpen, 0, 0, 0, 0); + vstfx->vst_version = vstfx->plugin->dispatcher (vstfx->plugin, effGetVstVersion, 0, 0, 0, 0); + } vstfx->handle->plugincnt++; vstfx->wantIdle = 0;