Mousewheel messages and IMouseObserver / interfering parameter updates in AAXWrapper

A user interface toolkit mainly for audio plug-ins (VST, AudioUnit, etc).
ray
Posts: 97
Joined: Fri Sep 02, 2016 9:37 am

Mousewheel messages and IMouseObserver / interfering parameter updates in AAXWrapper

Post by ray » Wed Nov 14, 2018 11:11 am

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
Last edited by ray on Mon Jan 28, 2019 11:39 am, edited 1 time in total.

Arne Scheffler
Posts: 276
Joined: Mon Jun 20, 2016 7:53 am

Re: Mousewheel messages and IMouseObserver

Post by Arne Scheffler » Fri Nov 16, 2018 6:16 pm

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

ray
Posts: 97
Joined: Fri Sep 02, 2016 9:37 am

Re: Mousewheel messages and IMouseObserver

Post by ray » Sat Nov 17, 2018 12:01 am

Arne Scheffler wrote: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
Last edited by ray on Sun Nov 18, 2018 7:55 am, edited 4 times in total.

ray
Posts: 97
Joined: Fri Sep 02, 2016 9:37 am

Re: Mousewheel messages and IMouseObserver

Post by ray » Mon Nov 19, 2018 11:00 am

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

Arne Scheffler
Posts: 276
Joined: Mon Jun 20, 2016 7:53 am

Re: Mousewheel messages and IMouseObserver

Post by Arne Scheffler » Mon Nov 26, 2018 4:25 pm

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

Cheers,
Arne

ray
Posts: 97
Joined: Fri Sep 02, 2016 9:37 am

Re: Mousewheel messages and IMouseObserver

Post by ray » Mon Nov 26, 2018 5:18 pm

Arne Scheffler wrote: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

ray
Posts: 97
Joined: Fri Sep 02, 2016 9:37 am

Re: Mousewheel messages and IMouseObserver

Post by ray » Mon Jan 28, 2019 11:38 am

ray wrote:
Arne Scheffler wrote: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.

Arne Scheffler
Posts: 276
Joined: Mon Jun 20, 2016 7:53 am

Re: Mousewheel messages and IMouseObserver / interfering parameter updates in AAXWrapper

Post by Arne Scheffler » Wed Jan 30, 2019 12:30 pm

We are open for pull requests in this regard ;-)

Cheers,
Arne

ray
Posts: 97
Joined: Fri Sep 02, 2016 9:37 am

Re: Mousewheel messages and IMouseObserver / interfering parameter updates in AAXWrapper

Post by ray » Tue Feb 05, 2019 10:25 am

Arne Scheffler wrote:We are open for pull requests in this regard ;-)

Cheers,
Arne
Thanks, Arne.

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

Arne Scheffler
Posts: 276
Joined: Mon Jun 20, 2016 7:53 am

Re: Mousewheel messages and IMouseObserver / interfering parameter updates in AAXWrapper

Post by Arne Scheffler » Fri Feb 22, 2019 3:35 pm

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

Post Reply