AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
Excuse me for unclever question and for my poor English, but I really can't understand, how can I create AudioEffectX* plugin from VST2-3 DLL? I can create AEffect* object by using such code:
Code: Select all (#)
typedef AEffect *(*vstPluginFuncPtr)(audioMasterCallback host);
VstIntPtr VSTCALLBACK hostCallback(AEffect *effect, VstInt32 opcode, VstInt32 index, VstInt32 value, void *ptr, float opt)
{ return NULL;}
AEffect * GetVSTPlugin(LPCWSTR path, HMODULE *pModule)
{
AEffect *plugin = NULL;
*pModule = LoadLibrary(path);
if (*pModule == NULL)
{
sprintf(sLastError, "Plugin '%S' load error: %d\n", path, GetLastError());
return NULL;
}
vstPluginFuncPtr mainEntryPoint = (vstPluginFuncPtr)GetProcAddress(*pModule, "VSTPluginMain");
if (mainEntryPoint == NULL)
{
sprintf(sLastError, "Plugin '%S' has not entry point 'VSTPluginMain'\n", path, GetLastError());
return NULL;
}
plugin = mainEntryPoint(hostCallback);
return plugin;
}
....
HMODULE hModule;
AEffect * Plugin = GetVSTPlugin(PathToDLL, &hModule);
I can use it for getting parameter properties such as Name, Label, DisplyName, Value
( for example: Plugin->dispatcher(effGetParamName, i, 0, &Param->Name, 0);),
but I can't get maxVal, minVal and Step (float or int) for concrete parameter. For this, in AudioEffectX.h declared virtual method getParameterProperties(int Index, VstParameterProperties &Props) and new dispatcher opcode - effGetParameterProperties. But class AudioEffectX is not child of AEffect, so I can't cast my Plugin to it.
In DLL from address "VSTPluginMain" begins exactly AEffect structure.
Maybe, new DLLs (VST 2 and higher) have any another entry point, not VSTPluginMain, which contains AudioEffectX structure?
Please, could you tell me, what I must write for getting maxVal, minVal and Step of i-th parameter?
Thanx for advance!
