tags:

views:

303

answers:

2

Hi,

I'm trying to build a small program that hosts vst effects and I would like to scan a folder for plugin dlls.
I know how to find all the dlls but now I have the following questions:

  • What is the best way to determine if a given dll is a vst plugin?
    I tried to just see if the ddl exports the proper function and this works fine for plugins made with the more recent versions of the vst sdk since it exports a method called "VstPluginMain" but older versions export a rather generic "main" function.
  • How do I determine if the plugin is an effect or an instrument?
  • How do I scan vst shell plugins?
    Shell plugins are basically dlls that somehow contain multiple effects. An example of this are the plugins made by Waves Audio http://www.waves.com/

ps: If there is a library that can do all of this for me please let me know.

+2  A: 

How to determine a VST plugin?

Once you've found main/VSTPluginMain... call it! If what's returned is NULL, it's not a VST. If what's returned is a pointer to the bytes "VstP" (see VstInt32 magic; ///< must be #kEffectMagic ('VstP') in aeffect.h), then you have a VST.

The VSTPluginMain returns a pointer to an AEffect structure. You will need to look at this structure.

Effect or instrument? AEffect::flags | (effFlagsIsSynth = 1 << 8)

Shell VSTs are more complex:

Category will be kPlugCategShell

Support the "shellCategory" canDo.

Use effShellGetNextPlugin to enumerate.

To instance, respond to audioMasterCurrentId in your callback with the ID you want.

Dave Gamble
Thanks for the answer.There's just something that I don't fully get.Let's assume I find a dll that's not a plugin but exports "main" (which seem a pretty common name...) and then returns something from it. Am I not going to be in trouble if I try to dereference that value looking for "VstP"?
Roald
Potentially. You would certainly check to see if the pointer was nonzero. You might also consider checking to see if your callback was called.It would make little sense for a user to have stored a malicious DLL in their VSTPlugIns folder.
Dave Gamble
Right, the callback... thank you very much!!
Roald
A: 

If you want to develop your VST Host application in .NET take a look at VST.NET

obiwanjacobi