I am trying to update a bitmap (frame number) in response to plugin action. In iPlug1 it was simply "GetGUI()->SetControlFromPlug(ControlIdx, value) but that is no longer the case in iPlug2.
I have studied the iPlugControls project - and similar threads here - and have tried what appears to be the means for updating a multi-frame bitmap control - but so far no go.
I have initialized the IBitmap control like this:
IBitmap bitmap = pGraphics->LoadBitmap(CLIPLED_FN, 2);// bitmap has two frames
pGraphics->AttachControl(new IBitmapControl(215, 109, bitmap, kCtrlTagLED1))
I have this at the end of the Process block, outside the for loop:
mSendUpdate = true;
and attempted to update the control like this:
void MyPlugin::OnIdle()
{
if (mSendUpdate)
{
if (GetUI())
{
GetUI()->GetControlWithTag(kCtrlTagLED1)->SetValue(value);//value 0.0 - 1.0
GetUI()->SetAllControlsDirty();
}
mSendUpdate = false;
}
}
But it does not work. Bitmap stays at frame 0 regardless of “value”. Also tried “SetValueFromDelegate(value)” with same result (doesn’t do anything).
So what is the approach to updating a bitmap?
Also, I noticed that the “AttachControls” function doesn’t seem to know the difference between kControls and kCtrlTags even though enumerated in separate EParams and ECtrlTags blocks. Both interpret as the same int values according to MSVS and end up crosscoupling. What’s the problem HERE? Almost seems like it should be like this:
enum EParams
{
kControl1 = 0,
kControl2,
...
kNumParams
};
enum ECtrlTags
{
kCtrlTag1 = kNumParams,// should continue rather than start at zero?
kCtrlTag2,
...
kNumCtrlTags
};
I don’t see “kNumCtrlTags” used anywhere so maybe something is missing?