View Single Post
Old 08-06-2020, 10:51 PM   #1
Human being with feelings
Join Date: Apr 2018
Posts: 354
Default ISwitchControl bitmap getting out of sync on AAX

Problem with ISwitchControl running in Pro Tools (AAX). Clicking on a switch when the transport is running changes the control’s state (toggles it) but the bitmap SOMETIMES doesn’t change - causing the bitmap and control state to become out of sync.

This does not happen when playback is stopped nor in VST, VST3 or AU versions. There's obviously an issue with Draw called in the ISwitchControl but I don’t know why it only happens in Pro Tools and only on Mac OS.

I made a workaround by calling parameterIdx->Redraw() for the control in OnParamChange(). It works but is it “safe” to force a redraw from there? I would rather fix the problem with ISwitchControl if possible.

Anyone else come across this?

TBPro pointed me to the cause - it's in iGraphics.cpp - so it could actually be a latent problem in all formats. Every occurrence of pControl->Draw(this) in the IGraphics Draw() method needs to be immediately followed with pControl->SetClean(). In other words they have to form a pair. I found that pControl2 (in a loop through all controls) had no SetClean() at all so I added it. With these changes the iSwitch sync problem is solved. Could be that other plugin formats have faster/different GUI threads so this issue only appeared in Pro Tools, IDK.

Last edited by Nonlinear; 08-29-2020 at 09:36 AM.
Nonlinear is offline   Reply With Quote