i tried to pinpoint the right moment where the CPU is at its highest.
I finally centered around the draw function of the big knobs.
first i used the code from Steinberg, but then i made my own as i thought it was faster.
here is Steinberg drawing code :
Code: Select all
void CDispLinearKnob::draw (CDrawContext *pContext)
{
CPoint where (0, 0);
if (value >= 0.f)
{
CCoord tmp = heightOfOneImage * (subPixmaps - 1);
where_.v = (CCoord)(value * (float)tmp);
for (CCoord realY = 0; realY <= tmp; realY += heightOfOneImage)
{
if (where.v < realY)
{
where.v = realY - heightOfOneImage;
if (where.v < 0)
where.v = 0;
break;
}
}
}
if (pBackground)
{
if (bTransparencyEnabled)
pBackground->drawTransparent (pContext, size, where_);
else
pBackground->draw (pContext, size, where_);
}
valueToPoint (lastDrawnPoint);
setDirty (false);
}
Code: Select all
void CDispLinearKnob::draw (CDrawContext *pContext)
{
CPoint where (0, 0);
where.v = int(value * (subPixmaps -1)) *heightOfOneImage;
if (pBackground)
{
if (bTransparencyEnabled)
pBackground->drawTransparent (pContext, size, where);
else
pBackground->draw (pContext, size, where);
}
valueToPoint (lastDrawnPoint);
setDirty (false);
}this i so weird, has anyone an answer to this ?...
thanks
EDIT : as i said earlier, i use 4 big animKnobs (86x86) and 3 little ones (53x53) for this plugin
