Don't use VST ->user points, prefer host-reserved ptr
authorRobin Gareus <robin@gareus.org>
Sat, 8 Jul 2017 16:13:42 +0000 (18:13 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 8 Jul 2017 16:13:42 +0000 (18:13 +0200)
Apparently "user" is for plugins (not hosts) to use.

gtk2_ardour/linux_vst_gui_support.cc
libs/ardour/linux_vst_support.cc
libs/ardour/lxvst_plugin.cc
libs/ardour/mac_vst_plugin.cc
libs/ardour/mac_vst_support.cc
libs/ardour/session_vst.cc
libs/ardour/vst_plugin.cc
libs/fst/vstwin.c

index c51cfa60266c084d531e0b704b91c19d4ca1e388..8dc2e928e4cbd9b0bdde6c79389e3f6d459a0ce6 100644 (file)
@@ -207,7 +207,7 @@ dispatch_x_events (XEvent* event, VSTState* vstfx)
                                if (width != vstfx->width || height != vstfx->height) {
                                        vstfx->width = width;
                                        vstfx->height = height;
-                                       ARDOUR::VSTPlugin* plug = (ARDOUR::VSTPlugin *)(vstfx->plugin->user);
+                                       ARDOUR::VSTPlugin* plug = (ARDOUR::VSTPlugin *)(vstfx->plugin->ptr1);
                                        plug->VSTSizeWindow (); /* EMIT SIGNAL */
                                }
 
index 44d61f7a77bfcbd8ab05176ce84691130d8e3e61..498cbc8339c49076a9f8289d06e6a69e63cedfa4 100644 (file)
@@ -297,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)
        {
index dd7b1b483194b0094c1bcdaa0e43994881fe957c..62fff3f8b87c039fb6bb865e781dfdaf81e08d78 100644 (file)
@@ -119,7 +119,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->ptr1 = NULL;
 
                plugin->dispatcher (plugin, effOpen, 0, 0, 0, 0); // :(
                int const vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0);
index 380620febbd1ababb092ff8ccb49a7d85fa5fea4..0b52096e6aff7951ebbdaf87742cca0241a71cdc 100644 (file)
@@ -126,7 +126,7 @@ MacVSTPluginInfo::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->ptr1 = NULL;
 
                plugin->dispatcher (plugin, effOpen, 0, 0, 0, 0); // :(
                int const vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0);
index ae40e53a7141d5617a2427a18fe6bcdcd9a52d1d..b1f27eef31702d7a3d9a865f3b8465434c41d84e 100644 (file)
@@ -194,7 +194,7 @@ mac_vst_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr)
        }
 
        mac_vst->handle = fhandle;
-       mac_vst->plugin->user = userptr;
+       mac_vst->plugin->ptr1 = userptr;
 
        if (mac_vst->plugin->magic != kEffectMagic)
        {
index e086bbbce043cca621920f82287ad64de7d2190e..3950a294781ee9b7b6d8a739e14e23e61e6e2811 100644 (file)
@@ -69,8 +69,8 @@ intptr_t Session::vst_callback (
        VstTimeInfo* timeinfo;
        int32_t newflags = 0;
 
-       if (effect && effect->user) {
-               plug = (VSTPlugin *) (effect->user);
+       if (effect && effect->ptr1) {
+               plug = (VSTPlugin *) (effect->ptr1);
                session = &plug->session();
                timeinfo = plug->timeinfo ();
                DEBUG_TRACE (PBD::DEBUG::VSTCallbacks, string_compose ("am callback 0x%1%2, opcode = %3%4, plugin = \"%5\"\n",
index b61ee4186cc5a8168474b03678e2c0102a0556a7..be520ddc17821bb180ad97e8828204fdd748c380 100644 (file)
@@ -79,8 +79,8 @@ void
 VSTPlugin::open_plugin ()
 {
        _plugin = _state->plugin;
-       assert (_plugin->user == this); // should have been set by {mac_vst|fst|lxvst}_instantiate
-       _plugin->user = this;
+       assert (_plugin->ptr1 == this); // should have been set by {mac_vst|fst|lxvst}_instantiate
+       _plugin->ptr1 = this;
        _state->plugin->dispatcher (_plugin, effOpen, 0, 0, 0, 0);
        _state->vst_version = _plugin->dispatcher (_plugin, effGetVstVersion, 0, 0, 0, 0);
 }
index 065f50e95445152a1f4d3fcd2e26a8f9e9c5e5c1..b799d5179d881d770dcf77d4739e9ab4573d3558 100644 (file)
@@ -569,7 +569,7 @@ fst_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr)
        }
 
        fst->handle = fhandle;
-       fst->plugin->user = userptr;
+       fst->plugin->ptr1 = userptr;
 
        if (fst->plugin->magic != kEffectMagic) {
                fst_error ("fst_instantiate: %s is not a vst plugin\n", fhandle->name);