Fix up a variety of API issues
The wrapper now successfully loads.
This commit is contained in:
@@ -74,17 +74,17 @@ enum AEffectFlags { // Guessed name based on struct+field combination.
|
||||
struct AEffect {
|
||||
VstInt32 magic; // Must be FOURCC('V', 's', 't', 'P')
|
||||
|
||||
VstIntPtr(__cdecl* control)(AEffect* self, VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value);
|
||||
VstIntPtr(VstFunctionAPI* control)(AEffect* self, VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value);
|
||||
|
||||
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
|
||||
// No 2.4 host ever calls this, processReplacing and processDoubleReplacing seem to be required.
|
||||
[[deprecated]]
|
||||
#endif
|
||||
void(__cdecl* process)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
|
||||
void(VstFunctionAPI* process)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
|
||||
|
||||
void(__cdecl* setParameter)(AEffect* self, VstInt32 index, float value);
|
||||
void(VstFunctionAPI* setParameter)(AEffect* self, VstInt32 index, float value);
|
||||
|
||||
float(__cdecl* getParameter)(AEffect* self, VstInt32 index);
|
||||
float(VstFunctionAPI* getParameter)(AEffect* self, VstInt32 index);
|
||||
|
||||
VstInt32 numPrograms;
|
||||
VstInt32 numParams;
|
||||
@@ -115,7 +115,7 @@ struct AEffect {
|
||||
* \param outputs Output buffers. Can have pointers used in inputs.
|
||||
* \param sampleFrames Number of samples in all buffers.
|
||||
*/
|
||||
void(__cdecl* processReplacing)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
|
||||
void(VstFunctionAPI* processReplacing)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
|
||||
|
||||
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
|
||||
// These only appear in version >= 2.4
|
||||
@@ -126,7 +126,7 @@ struct AEffect {
|
||||
* \param outputs Output buffers. Can have pointers used in inputs.
|
||||
* \param sampleFrames Number of samples in all buffers.
|
||||
*/
|
||||
void(__cdecl* processDoubleReplacing)(AEffect* self, double** inputs, double** outputs, VstInt32 sampleFrames);
|
||||
void(VstFunctionAPI* processDoubleReplacing)(AEffect* self, double** inputs, double** outputs, VstInt32 sampleFrames);
|
||||
|
||||
char __unk12[56];
|
||||
#else
|
||||
@@ -135,6 +135,6 @@ struct AEffect {
|
||||
};
|
||||
|
||||
// Master callback.
|
||||
typedef VstIntPtr (*audioMasterCallback)(AEffect*, VstInt32 opcode, VstInt32, VstInt32, void* ptr, float);
|
||||
typedef VstIntPtr(VstFunctionAPI* audioMasterCallback)(AEffect*, VstInt32 opcode, VstInt32, VstInt32, void* ptr, float);
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -131,8 +131,8 @@ enum AEffectXMasterOpCodes {
|
||||
audioMasterGetVendorString, // Get Vendor Name
|
||||
audioMasterGetProductString, // Get Product Name
|
||||
audioMasterGetVendorVersion, // Get Vendor Version
|
||||
AEffectXMasterOpCode_23, // Counterpart to AEffectXOpCode_32
|
||||
AEffectXMasterOpCode_24,
|
||||
audioMasterVendorSpecific, // Counterpart to AEffectXOpCode_32
|
||||
audioMasterCanDo,
|
||||
AEffectXMasterOpCode_25,
|
||||
AEffectXMasterOpCode_26,
|
||||
AEffectXMasterOpCode_27,
|
||||
|
||||
@@ -15,22 +15,51 @@
|
||||
|
||||
#include "aeffeditor.hpp"
|
||||
|
||||
AEffEditor::AEffEditor(AudioEffect* effect) : _effect(effect), _handle() {}
|
||||
AEffEditor::AEffEditor(AudioEffect* effect) : effect(effect), _handle() {}
|
||||
|
||||
AEffEditor::~AEffEditor() {}
|
||||
|
||||
bool AEffEditor::getRect(ERect** rect) {}
|
||||
bool AEffEditor::getRect(ERect** rect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AEffEditor::open(void* ptr) {}
|
||||
bool AEffEditor::open(void* ptr)
|
||||
{
|
||||
if (!_handle) {
|
||||
_handle = ptr;
|
||||
return ptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AEffEditor::close() {}
|
||||
void AEffEditor::close()
|
||||
{
|
||||
_handle = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
void AEffEditor::do_nothing() {}
|
||||
void AEffEditor::do_nothing()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool AEffEditor::setKnobMode(VstInt32 val) {}
|
||||
bool AEffEditor::setKnobMode(VstInt32 val)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AEffEditor::onKeyDown(VstKeyCode& keyCode) {}
|
||||
bool AEffEditor::onKeyDown(VstKeyCode& keyCode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AEffEditor::onKeyUp(VstKeyCode& keyCode) {}
|
||||
bool AEffEditor::onKeyUp(VstKeyCode& keyCode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AEffEditor::onWheel(float distance) {}
|
||||
bool AEffEditor::onWheel(float distance)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -64,9 +64,12 @@ class AudioEffect {
|
||||
virtual void open(){};
|
||||
virtual void close(){};
|
||||
virtual void setProgram(VstInt32 program){};
|
||||
virtual VstInt32 getProgram(){};
|
||||
virtual void setProgramName(char* name){};
|
||||
virtual void getProgramName(char* name)
|
||||
virtual VstInt32 getProgram()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void setProgramName(char* name){};
|
||||
virtual void getProgramName(char* name)
|
||||
{
|
||||
*name = 0;
|
||||
}
|
||||
|
||||
@@ -41,9 +41,7 @@ VstIntPtr AudioEffectX::control(VstInt32 opcode, VstInt32 param1, VstIntPtr para
|
||||
case audioEffectGetPlugCategory:
|
||||
return (VstIntPtr)getPlugCategory();
|
||||
case audioEffectSetSpeakerArrangement:
|
||||
// MSVC: No you can't convert float to VstSpeakerArrangement*!!
|
||||
// Also MSVC: Perfectly happy with this mess...
|
||||
return setSpeakerArrangement(*(VstSpeakerArrangement**)(&value), (VstSpeakerArrangement*)ptr);
|
||||
return setSpeakerArrangement((VstSpeakerArrangement*)param2, (VstSpeakerArrangement*)ptr);
|
||||
case audioEffectBypass:
|
||||
return setBypass(!!param2) ? 1 : 0;
|
||||
case audioEffectGetEffectName:
|
||||
@@ -97,7 +95,7 @@ VstIntPtr AudioEffectX::control(VstInt32 opcode, VstInt32 param1, VstIntPtr para
|
||||
|
||||
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2300)
|
||||
case audioEffectGetSpeakerArrangement:
|
||||
return getSpeakerArrangement(*(VstSpeakerArrangement***)(&value), (VstSpeakerArrangement**)ptr);
|
||||
return getSpeakerArrangement((VstSpeakerArrangement**)param2, (VstSpeakerArrangement**)ptr);
|
||||
case audioEffectStartProcessing:
|
||||
return startProcess();
|
||||
case audioEffectStopProcessing:
|
||||
@@ -121,7 +119,7 @@ VstIntPtr AudioEffectX::control(VstInt32 opcode, VstInt32 param1, VstIntPtr para
|
||||
VstInt32 AudioEffectX::canHostDo(char* text)
|
||||
{
|
||||
if (audioMaster)
|
||||
return !!audioMaster(getAeffect(), audioMasterBeginEdit, 0, 0, text, 0);
|
||||
return !!audioMaster(getAeffect(), audioMasterCanDo, 0, 0, text, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -188,7 +186,7 @@ VstInt32 AudioEffectX::getHostVendorVersion()
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AudioEffectX::canDoubleReplacing(bool value)
|
||||
void AudioEffectX::canDoubleReplacing(bool value)
|
||||
{
|
||||
if (value)
|
||||
cEffect.flags |= AEffectFlagCanDoubleReplacing;
|
||||
|
||||
@@ -32,7 +32,7 @@ class AudioEffectX : public AudioEffect {
|
||||
|
||||
public:
|
||||
// AEffect/AEffectX
|
||||
virtual bool canDoubleReplacing(bool value);
|
||||
virtual void canDoubleReplacing(bool value);
|
||||
virtual void noTail(bool value);
|
||||
|
||||
virtual void processDoubleReplacing(double** inputs, double** outputs, VstInt32 sampleFrames){};
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#define VstFunctionAPI __cdecl
|
||||
|
||||
enum VstMaxLengths { // Anything with k is an enum?
|
||||
kVstMaxNameLen = 64,
|
||||
kVstMaxLabelLen = 64,
|
||||
|
||||
Reference in New Issue
Block a user