Mousewheel messages and IMouseObserver / interfering parameter updates in AAXWrapper

Hi,

I’m currently trying to come up with a bugfix in which I have to work around interferences between direct UI updates triggered by mousewheel interactions on the one hand and parameter updates imposed on the component by the AAXWrapper scheduled update logic that forces parameter updates into the main thread idle. The latter ones are subsequently transferred back to the UI via IEditController::setParameterNormalized() and cause the described interference.

In order to fix this, I would like to detect and signal mousewheel events globally and without overriding any specific onWheel() control implementations.

However, currently it seems there is no way to do so, because IMouseObserver does not allow for intercerpting mousewheel messages at all - is this by design? What would you suggest? IPlugView::onWheel() never gets hit, either.

Thanks.

Best,
Ray

Hi Ray,
at the moment there’s no way to disable mouse wheel functionality.
But don’t you get the same issue when someone uses mouse down and mouse move to change control value ?

Your best bet for a hot fix is to patch CFrame and intercept platformOnMouseWheel.

Cheers,
Arne

Hi Arne,

I’m not trying to disable the mouse wheel but I’m trying to detect (in a global manner) when the user interacts with my GUI through the mouse wheel.

Normal drag edits don’t cause this type of behavior because they are always framed by beginEdit()/endEdit() so I can simply check ongoing edits using the isEditing() state in my EditController::setParamNormalized() implementation.

With mousewheel edits, as you know, it’s a series of beginEdit() / valueChanged() / endEdit() …so in terms of the editing state it’s not a continuous thing which may be interrupted, in this case by the AAXWrapper‘s scheduled parameter updates sent back to my component. I haven’t tried yet, but I assume the same issue can be reproduced with the AAX wrapped SDK example. Will check ASAP.

My idea to work around this would be to have a hold timer that keeps an „isInWheelEdit“ state for a couple of milliseconds after a mouse wheel edit ended so the AAX wrapper’s next idle interval has expired. This is why I need to detect wheel events globally.

A workaround could be to keep track of drag movements using an appropriate IMouseObserver implementation, because anything else is either a wheel or a key edit, but that would fail when the user clicks and then starts turning the mousewheel without moving the cursor.

Hope that makes sense.

Best,
Ray

I can confirm that the reported issue is reproducible using the AAX wrapped AGain SDK example. Simply move the gain fader using the mousewheel and you’ll see the described glitches. They get more apparent when you hold down the shift modifier for fine movement. Instead of moving smoothly like in other formats, the slider will occasionally jump around when the wrapper interferes with a scheduled UI thread idle paramter update holding one of the previous values during the ongoing edit.

Best,
Ray

Hi,
would it help to add an onWheel method to the IMouseObserver interface ?
Then I think it would be easy to add.

Cheers,
Arne

Hi Arne,

yes, I think that would be a good addition because it would give developers a chance to work around this or observe the mouse wheel action for other purposes.

Best,
Ray

I see this has (deliberately?) been addressed in some controls that use a timer to “hold” and edit for 500ms in onWheel() so one can check the state isEditing() to skip interfering parameter updates, e.g. CXYPad, but not CKnob or CSlider and others.

Can we expect the change to be integrated into all controls that allow for wheel editing? That would make all downstream patches/workarounds become obsolete.

Thanks.

We are open for pull requests in this regard :wink:

Cheers,
Arne

Thanks, Arne.

Okay then, I’ll try to prepare something then asap.

Hi Ray,
I just committed the change to always use a timer for all mouse wheel edits in all controls. Please let me know if this fixes your issue.

Cheers,
Arne

Hi Arne,

Oh wow, that was quick.
I’ll check and get back to you asap.

Best,
Ray

Using your latest changes, the glitches are still present in the AAX wrapped again example (edit the slider using the mousewheel).