From be92c67b94135da22376427bd9bc70c1b1a400b8 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 23 Dec 2010 23:45:12 +0100 Subject: [PATCH] VST support layer: fixed non-working 64 bit VST plugins LMMS' native Win64 VST host capabilities were broken due to wrong data types in some places. On 32 bit there's no difference between a pointer and an int but on x64 there is, therefore fix data types where approriate. Makes 64 bit VST DLLs work in LMMS/Win64. --- include/aeffectx.h | 21 ++++++++------------- plugins/vst_base/RemoteVstPlugin.cpp | 11 ++++------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/include/aeffectx.h b/include/aeffectx.h index 77a51951d..61f655646 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -167,7 +167,7 @@ public: // 00 int numEvents; // 04 - int reserved; + void *reserved; // 08 VstEvent * events[]; @@ -203,7 +203,7 @@ public: // 00-03 int magic; // dispatcher 04-07 - int (* dispatcher)( AEffect * , int , int , int , void * , float ); + intptr_t (* dispatcher)( AEffect * , int , int , intptr_t, void * , float ); // process, quite sure 08-0b void (* process)( AEffect * , float * * , float * * , int ); // setParameter 0c-0f @@ -221,15 +221,16 @@ public: // flags 24-27 int flags; // Fill somewhere 28-2b - RemoteVstPlugin * user; + void *ptr1; + void *ptr2; // Zeroes 2c-2f 30-33 34-37 38-3b - char empty3[4 + 4 + 4 + 4]; + char empty3[4 + 4 + 4]; // 1.0f 3c-3f float unkown_float; // An object? pointer 40-43 - char empty4[4]; + void *ptr3; // Zeroes 44-47 - char empty5[4]; + void *user; // Id 48-4b int32_t uniqueID; // Don't know 4c-4f @@ -268,13 +269,7 @@ public: - -typedef long int (* audioMasterCallback)( AEffect * , long int , long int , - long int , void * , float ); -// we don't use it, may be noise -#define VSTCALLBACK - - +typedef intptr_t (* audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float ); #endif diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 6c7411cc0..3bb167252 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -77,9 +77,6 @@ #define OLD_VST_SDK -#define VstInt32 long int -#define VstIntPtr long int - struct ERect { short top; @@ -228,8 +225,8 @@ private: } ; // callback used by plugin for being able to communicate with it's host - static VstIntPtr hostCallback( AEffect * _effect, VstInt32 _opcode, - VstInt32 _index, VstIntPtr _value, + static intptr_t hostCallback( AEffect * _effect, int32_t _opcode, + int32_t _index, intptr_t _value, void * _ptr, float _opt ); @@ -886,8 +883,8 @@ void RemoteVstPlugin::updateInOutCount() * - audioMasterGetDirectory: return either VST-plugin-dir or LMMS-workingdir * - audioMasterOpenFileSelector: show QFileDialog? */ -VstIntPtr RemoteVstPlugin::hostCallback( AEffect * _effect, VstInt32 _opcode, - VstInt32 _index, VstIntPtr _value, +intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode, + int32_t _index, intptr_t _value, void * _ptr, float _opt ) { static VstTimeInfo _timeInfo;