1 #include "IPlugEffect.h"
2 #include "IPlug_include_in_plug_src.h"
6 const int kNumPrograms
= 1;
24 IPlugEffect::IPlugEffect(IPlugInstanceInfo instanceInfo
)
25 : IPLUG_CTOR(kNumParams
, kNumPrograms
, instanceInfo
), mGain(1.)
29 //arguments are: name, defaultVal, minVal, maxVal, step, label
30 GetParam(kGain
)->InitDouble("Gain", 50., 0., 100.0, 0.01, "%");
31 GetParam(kGain
)->SetShape(2.);
33 IGraphics
* pGraphics
= MakeGraphics(this, kWidth
, kHeight
);
34 pGraphics
->AttachPanelBackground(&COLOR_RED
);
36 IBitmap knob
= pGraphics
->LoadIBitmap(KNOB_ID
, KNOB_FN
, kKnobFrames
);
38 pGraphics
->AttachControl(new IKnobMultiControl(this, kGainX
, kGainY
, kGain
, &knob
));
40 AttachGraphics(pGraphics
);
42 //MakePreset("preset 1", ... );
43 MakeDefaultPreset((char *) "-", kNumPrograms
);
46 IPlugEffect::~IPlugEffect() {}
48 void IPlugEffect::ProcessDoubleReplacing(double** inputs
, double** outputs
, int nFrames
)
50 // Mutex is already locked for us.
52 double* in1
= inputs
[0];
53 double* in2
= inputs
[1];
54 double* out1
= outputs
[0];
55 double* out2
= outputs
[1];
57 for (int s
= 0; s
< nFrames
; ++s
, ++in1
, ++in2
, ++out1
, ++out2
)
64 void IPlugEffect::Reset()
67 IMutexLock
lock(this);
70 void IPlugEffect::OnParamChange(int paramIdx
)
72 IMutexLock
lock(this);
77 mGain
= GetParam(kGain
)->Value() / 100.;