Still taking my first steps in WDL-OL and enjoying it...
So, with the help of this
this tutorial and the IPlugControls example I've managed to build a simple distortion / clipper plugin with an output knob and a peak meter. Looks like this currently:
https://i.imgur.com/U7SY5jU.jpg
Now next step I'd like to try is change the color of the peak meter dynamically at some predetermined value (when over the clipping threshold) to indicate that signal clipping is happening. I.e. peak > clipping threshold ? -> turn meter red
How would I go doing this ?
As from what I understand so far, the color of the peak meter is set in
...controls.h here:
Code:
class IPeakMeterVert : public IControl
{
public:
(...)
bool Draw(IGraphics* pGraphics)
{
pGraphics->FillIRect(&COLOR_WHITE, &mRECT); // change this color dynamically ?
IRECT filledBit = IRECT(mRECT.L, mRECT.T, mRECT.R, mRECT.B - (mValue * mRECT.H()));
pGraphics->FillIRect(&mColor, &filledBit);
return true;
}
(...)
};
And the meter is drawn when doing in the plugin constructor:
Code:
mMeterIdx_L = pGraphics->AttachControl(new IPeakMeterVert(this, IRECT(meterL_left, meterTop, meterL_right, meterBottom)));
mMeterIdx_R = pGraphics->AttachControl(new IPeakMeterVert(this, IRECT(meterR_left, meterTop, meterR_right, meterBottom)));