-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tester.cpp
45 lines (35 loc) · 1.36 KB
/
Tester.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "Tester.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
Tester::Tester(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
#if IPLUG_EDITOR // http://bit.ly/2S64BDd
mMakeGraphicsFunc = [&]() {
return MakeGraphics(*this, PLUG_WIDTH, PLUG_HEIGHT, PLUG_FPS, GetScaleForScreen(PLUG_WIDTH, PLUG_HEIGHT));
};
mLayoutFunc = [&](IGraphics* pGraphics) {
pGraphics->AttachCornerResizer(EUIResizerMode::Scale, false);
pGraphics->AttachBackground(BOTH11_FN);
pGraphics->AttachBackground(DIAL_FN);
pGraphics->LoadFont("Roboto-Regular", ROBOTO_FN);
const IRECT b = pGraphics->GetBounds();
pGraphics->AttachControl(new ITextControl(b.GetMidVPadded(450).GetVShifted(165).GetHShifted(0), "R", IText(40,COLOR_WHITE)));
IBitmap bitmap = pGraphics->LoadBitmap(DIAL_FN);
pGraphics->AttachControl(new IBKnobRotaterControl(b.GetCentredInside(170).GetVShifted(-15), bitmap, kGain));
};
#endif
}
#if IPLUG_DSP
void Tester::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
{
const double gain = GetParam(kGain)->Value() / 100.;
const int nChans = NOutChansConnected();
for (int s = 0; s < nFrames; s++) {
for (int c = 0; c < nChans; c++) {
outputs[c][s] = inputs[c][s] * gain;
}
}
}
#endif