COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 05-05-2017, 06:54 PM   #1
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default Inconsistent mouse clicks with ISwitchControl

I've noticed clicking quickly on an ISwitchControl can be a bit inconsistent passing the parameter back to Logic. Clicking slowly while having the related automation lane visible changes the value in the host fine, but clicking quicker will update the image twice, but sometimes the second click won't be registered on the automation lane, causing the automation and the plugin to show different values.

I spotted this with my own plugin, but checked iPlugControls and that exhibits the same behaviour. Other plugins I have can handle two fast clicks at once.

Is there something I can tweak to speed up the response?
I tried modifying OnMouseDblClick to call OnMouseDown(x, y, pMod) twice instead of once, but if anything that made things worse!
Bobflip is offline   Reply With Quote
Old 05-05-2017, 07:32 PM   #2
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 338
Default

What if you override OnMouseDblClick to do nothing? I am wondering if it is calling dblclick, and then OnMouseDown?

The other thing you could try if things still don't work is to include a timer. Every time the OnMouseDown is called, it checks the current time and compares it to the previous time the control was clicked. If it is less than a second (or something similar), you ignore the repeat calls.

I have done this with a few controls for various reasons. It isn't sexy, but it works.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 05-05-2017, 07:40 PM   #3
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

As a very quick hack I tried emptying the code out of OnMouseDblClick in the ISwitchControl.cpp, but that didn't work... it just made it register the clicks even less.
Bobflip is offline   Reply With Quote
Old 05-05-2017, 07:42 PM   #4
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

I'm not quite sure what's happening, as the plugin interface is updating for all the clicks as expected from two fast single clicks, but somewhere down the line Logic's not getting that info.
Bobflip is offline   Reply With Quote
Old 05-06-2017, 02:39 AM   #5
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 652
Default

Did you try putting mDblAsSingleClick = true; in the constructor?
Youlean is offline   Reply With Quote
Old 05-06-2017, 02:39 AM   #6
JD Young
Human being with feelings
 
JD Young's Avatar
 
Join Date: Nov 2014
Location: Leiden, the Netherlands
Posts: 36
Default

I'm not a 100% sure, but I think I once fixed this issue by overriding OnMouseDblClick() to just call OnMouseDown().
JD Young is offline   Reply With Quote
Old 05-06-2017, 10:14 AM   #7
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

Quote:
Originally Posted by Youlean View Post
Did you try putting mDblAsSingleClick = true; in the constructor?
I hadn't, have just tried it now but same result. Though the desired result is that I want two double clicks to count as two single clicks.


Quote:
Originally Posted by JD Young View Post
I'm not a 100% sure, but I think I once fixed this issue by overriding OnMouseDblClick() to just call OnMouseDown().
The ISwitchControl definition already has this, and I've tried duplicating the line to call OnMouseDown() twice. No luck!
Bobflip is offline   Reply With Quote
Old 05-06-2017, 11:28 AM   #8
MSK
Human being with feelings
 
Join Date: Jan 2017
Posts: 43
Default

I ran into the same thing making a custom IControl. However I fixed it like JD Young, having onMouseDblClick just pass the click to OnMouseDown:

Code:
void OnMouseDblClick(int x, int y, IMouseMod* pMod){ OnMouseDown(x, y, pMod);}
The only thing I can think of is maybe OnMouseDblClick isn't typed right in your code so it isn't correctly overriding. I had a similar problem writing setDirty() instead of SetDirty().

Best of luck!
MSK is offline   Reply With Quote
Old 05-06-2017, 11:41 AM   #9
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

Quote:
Originally Posted by MSK View Post
I ran into the same thing making a custom IControl. However I fixed it like JD Young, having onMouseDblClick just pass the click to OnMouseDown:

Code:
void OnMouseDblClick(int x, int y, IMouseMod* pMod){ OnMouseDown(x, y, pMod);}
The only thing I can think of is maybe OnMouseDblClick isn't typed right in your code so it isn't correctly overriding. I had a similar problem writing setDirty() instead of SetDirty().

Best of luck!
I'm also getting the problem with the bundled ISwitchControl in IControl.cpp though, and it's occurring with both WDL-OL and WDL-Youlean.

It doesn't seem to affect Ableton Live, only Logic.
Bobflip is offline   Reply With Quote
Old 05-06-2017, 11:48 AM   #10
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

Ok, just found a new bit of info!

I put another plugin (bx_cleansweep) on the same channel, that has an on/off switch that I know works as expected.

I'd set up two automation lanes so I could see what each was doing. IPlugControls was already left with the channel's automation lane set to the opposite value to the control. But then as soon as I clicked the button on bx_cleansweep, both automation lanes went to the right place! It's like as soon as Logic got the signal to update the display from bx_cleansweep, it polled IPlugControls as well.

Tested this a few times now, and it's a consistent thing in Logic X. It's happening with an unmodified WDL-OL IPlugControls example.
Bobflip is offline   Reply With Quote
Old 05-07-2017, 08:02 AM   #11
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

I've uploaded a video showing the problem. I click a few times on the ISwitchControl, and first regular speed then a bit quicker. It's left stuck with the button as expected but the Logic automation lane on the wrong setting. Then I go to bx_cleansweep and click the Phase button, at which point both automation lanes change.

https://sendvid.com/dkyppwiu

At this point I'm using the standard ISwitchControl in WDL-OL. Seems pretty strange!
Bobflip is offline   Reply With Quote
Old 05-07-2017, 04:47 PM   #12
Opcode 7
Human being with feelings
 
Join Date: Mar 2017
Posts: 49
Default

I am also trying to debug something similar you described (but in my case, a modified InvisibleSwitchControl)

If I click it once, it works.

If I click it click it twice, very fast, it will only register the 1st click.

I've tried to step through the code and into its parent IControl to determine where the latency/pause/sleep is happening at, to no avail. Does anyone know the mechanism I'm referring too?!
Opcode 7 is offline   Reply With Quote
Old 05-07-2017, 05:05 PM   #13
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

It certainly sounds like the same issue I'm having. Have you checked the video I posted in the comment above yours? Wondering if your host exhibits the same behaviour when you click a switch on another plugin.
Bobflip is offline   Reply With Quote
Old 05-08-2017, 05:11 PM   #14
Opcode 7
Human being with feelings
 
Join Date: Mar 2017
Posts: 49
Default

The behavior I described is happening in the .exe asio application form -- no DAW involved. I am going to do some more debugging & stepping through the IControl code -- it has to be somewhere in there.
Opcode 7 is offline   Reply With Quote
Old 05-08-2017, 05:25 PM   #15
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

Ah, interesting! Thanks for looking into it, would definitely be over my head!
Bobflip is offline   Reply With Quote
Old 05-08-2017, 05:38 PM   #16
Opcode 7
Human being with feelings
 
Join Date: Mar 2017
Posts: 49
Default

I'm gonna make a wild guess here, and there's a 99% chance I'm wrong, but It might have to do with the redraw & fps speed that the controls get drawn at, as I cannot figure it out.

EDIT: I just re-read this thread, and I set mDblAsSingleClick to true, like Youlean suggested, and that solved my issue. I feel like an idiot.

Thanks Youlean!

Bobflip, try setting it in your controls constructor. This is what I did :

Quote:
IInvisibleSwitchControl::IInvisibleSwitchControl(I PlugBase* pPlug, IRECT pR, int paramIdx)
: IControl(pPlug, pR, paramIdx, IChannelBlend::kBlendClobber)
{
mDblAsSingleClick = true;
mDisablePrompt = true;
}

Last edited by Opcode 7; 05-08-2017 at 06:27 PM.
Opcode 7 is offline   Reply With Quote
Old 05-08-2017, 10:39 PM   #17
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

Hmmm, it didn't work out last time I tried it, but will give it another go, might've got muddled somewhere along the line trying different bits in and out.
Bobflip is offline   Reply With Quote
Old 03-18-2018, 05:16 PM   #18
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 338
Default

Let me bring this post back from the dead...

Anyone having issues with the ISwitchControl in Logic (AU)?

It looks like the switch is working and the param is being set correctly; however, something is not working within Draw(). It is very intermittent, and sometimes clicking another switch will cause another switch to change it's draw frame state.

I have tried mDblAsSingleClick = true, as well as setting all SetAllControlsDirty() after every click. Testing AU in Reaper and there aren't any issues.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 03-19-2018, 05:17 PM   #19
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 338
Default

Quote:
Originally Posted by random_id View Post
Let me bring this post back from the dead...

Anyone having issues with the ISwitchControl in Logic (AU)?

It looks like the switch is working and the param is being set correctly; however, something is not working within Draw(). It is very intermittent, and sometimes clicking another switch will cause another switch to change it's draw frame state.

I have tried mDblAsSingleClick = true, as well as setting all SetAllControlsDirty() after every click. Testing AU in Reaper and there aren't any issues.
Just to update, I am using Youlean's code, although not up-to-date.
If I add mPlug->ResetGUIResize() at the end of OnMouseDown(), it looks like it fixes the problem with Logic. I haven't found any adverse effects at this point.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 03-19-2018, 06:53 PM   #20
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 328
Default

I haven't personally had this issue, but Logic does have that thing where it won't update the plugin display if playback is stopped and no audio is passing through, could your issue have been related to that, or was it still there when the project is playing?
Bobflip is offline   Reply With Quote
Old 03-20-2018, 04:11 AM   #21
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 338
Default

Quote:
Originally Posted by Bobflip View Post
I haven't personally had this issue, but Logic does have that thing where it won't update the plugin display if playback is stopped and no audio is passing through, could your issue have been related to that, or was it still there when the project is playing?
I did not know that, but it explains a lot of my graphics issues in Logic.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.