Created
October 7, 2019 21:49
-
-
Save Xenakios/265adbc112ecda926c00d4d15da02758 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "aeffectx.h" | |
#include <dlfcn.h> | |
typedef AEffect* (*PluginEntryProc) (audioMasterCallback audioMaster); | |
VstIntPtr mycallback (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt) | |
{ | |
if (opcode == audioMasterVersion) | |
{ | |
return kVstVersion; | |
} | |
return 0; | |
} | |
int main(int argc, const char * argv[]) | |
{ | |
void* pluglib = dlopen("/Library/Audio/Plug-Ins/VST/GRM/GRM Shuffling Stereo.vst/Contents/MacOS/GRM Shuffling Stereo", RTLD_NOW); | |
if (pluglib) | |
{ | |
void* plugmain = dlsym(pluglib, "VSTPluginMain"); | |
if (plugmain) | |
{ | |
PluginEntryProc eproc = (PluginEntryProc)plugmain; | |
AEffect* aeff = eproc(mycallback); | |
if (aeff) | |
{ | |
std::cout << "AEffect created\n"; | |
std::cout << aeff->numInputs << " inputs\n"; | |
std::cout << aeff->numOutputs << " outputs\n"; // shows 2 outputs now... | |
VstSpeakerArrangement temp1 = {0}; | |
VstSpeakerArrangement temp2 = {0}; | |
aeff->dispatcher(aeff,effSetSpeakerArrangement,0, (VstIntPtr)&temp1,&temp2,0.0f); | |
std::cout << aeff->numInputs << " inputs\n"; | |
std::cout << aeff->numOutputs << " outputs\n"; // and 8 outputs now! | |
} else std::cout << "could not create AEffect\n"; | |
} else std::cout << "could not load plugin main func\n"; | |
} else std::cout << "could not open plugin dll\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment