PDA

View Full Version : Continuous Rotating Knob


cerberus
07-25-2010, 04:52 AM
i'm making my first iplug plug-in...

i have hacked a continous knob motion in the positive direction only so far...

it uses a bitmap with an "extra frame"; when that frame appears,
the bitmap resets it back to the "zero" frame and passes the
correct value to the dsp .

i would like to have a knob which is "rolls over" in both directions.

any ideas how best to do it?

Tale
07-25-2010, 09:49 AM
I think any of the normal knobs could be transformed into a continuous knob by simply implementing your own SetDirty(). The default IControl::SetDirty() clamps mValue, so it can't go below or above its range. Your SetDirty() would have to do something like:

void IMyLittleKnob::SetDirty(bool pushParamToPlug)
{
if (mValue < mClampLo)
mValue = mClampHi - (mClampLo - mValue);
else if (mValue > mClampHi)
mValue = mClampLo + (mValue - mClampHi);
IControl::SetDirty(pushParamToPlug);
}

junioreq
07-25-2010, 09:52 AM
And what does setDirty do? Just a function so that a knob cant go outside its bounds?

Tale
07-25-2010, 10:01 AM
SetDirty() sets the control's dirty flag so it gets updated in the GUI, and it usually also updates the value of the plug-in parameter that is tied to the control. You will find its default implementation in IControl.cpp.