VST Audio Effect Example

VST 2.4 Audio Effect Example Code
Based on VST SDK 2.4 example 'AGain': class AGain : public AudioEffectX { public: AGain (audioMasterCallback audioMaster); ~AGain ; virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); virtual void setParameter     (VstInt32 index, float value); virtual float getParameter    (VstInt32 index); protected: float fGain; }; AudioEffect* createEffectInstance (audioMasterCallback audioMaster) { return new AGain (audioMaster); } AGain::AGain (audioMasterCallback audioMaster) : AudioEffectX (audioMaster, 1, 1) { // 1 program, 1 parameter only setNumInputs (2);      // stereo in     setNumOutputs (2);      // stereo out setUniqueID ('SKIN');  // identify canProcessReplacing ; // supports replacing output fGain = 1.f;           // default to 0 dB } AGain::~AGain { } void AGain::setParameter (VstInt32 index, float value) { fGain = value; } float AGain::getParameter (VstInt32 index) { return fGain; } void AGain::processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames) { float* in1 =  inputs[0]; float* in2 =  inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; while (--sampleFrames >= 0) {        (*out1++) = (*in1++) * fGain; (*out2++) = (*in2++) * fGain; } }
 * 1) include "audioeffectx.h"