|
05-05-2017, 06:54 PM
|
#1
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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!
|
|
|
05-05-2017, 07:32 PM
|
#2
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
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.
|
|
|
05-05-2017, 07:40 PM
|
#3
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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.
|
|
|
05-05-2017, 07:42 PM
|
#4
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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.
|
|
|
05-06-2017, 02:39 AM
|
#5
|
Human being with feelings
Join Date: May 2015
Location: Serbia
Posts: 654
|
Did you try putting mDblAsSingleClick = true; in the constructor?
|
|
|
05-06-2017, 02:39 AM
|
#6
|
Human being with feelings
Join Date: Nov 2014
Location: Leiden, the Netherlands
Posts: 36
|
I'm not a 100% sure, but I think I once fixed this issue by overriding OnMouseDblClick() to just call OnMouseDown().
|
|
|
05-06-2017, 10:14 AM
|
#7
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
Quote:
Originally Posted by Youlean
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
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!
|
|
|
05-06-2017, 11:28 AM
|
#8
|
Human being with feelings
Join Date: Jan 2017
Posts: 43
|
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!
|
|
|
05-06-2017, 11:41 AM
|
#9
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
Quote:
Originally Posted by MSK
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.
|
|
|
05-06-2017, 11:48 AM
|
#10
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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.
|
|
|
05-07-2017, 08:02 AM
|
#11
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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!
|
|
|
05-07-2017, 04:47 PM
|
#12
|
Human being with feelings
Join Date: Mar 2017
Posts: 79
|
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?!
|
|
|
05-07-2017, 05:05 PM
|
#13
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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.
|
|
|
05-08-2017, 05:11 PM
|
#14
|
Human being with feelings
Join Date: Mar 2017
Posts: 79
|
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.
|
|
|
05-08-2017, 05:25 PM
|
#15
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
Ah, interesting! Thanks for looking into it, would definitely be over my head!
|
|
|
05-08-2017, 05:38 PM
|
#16
|
Human being with feelings
Join Date: Mar 2017
Posts: 79
|
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.
|
|
|
05-08-2017, 10:39 PM
|
#17
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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.
|
|
|
03-18-2018, 05:16 PM
|
#18
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
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.
|
|
|
03-19-2018, 05:17 PM
|
#19
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
Quote:
Originally Posted by random_id
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.
|
|
|
03-19-2018, 06:53 PM
|
#20
|
Human being with feelings
Join Date: Nov 2016
Posts: 341
|
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?
|
|
|
03-20-2018, 04:11 AM
|
#21
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
Quote:
Originally Posted by Bobflip
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.
|
|
|
02-25-2021, 11:31 PM
|
#22
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
Reviving this thread yet again - YES, I have this issue with AU - and only in Logic Pro X - works fine in Reaper. This was the issue I posted here: https://forum.cockos.com/showthread.php?t=249387
Did anyone ever discover what causes this? I found that if I change my Mac's double click speed to max the plugin works perfectly (but then double clicks for things like text entry STOP working because you can't double-click fast enough).
So there is something in the timing between the plugin and Logic that prevents Logic from always "getting the signal" that a Switch control has changed state. This can cause the plugin and Logic to become out of sync.
I tried the "mDblAsSingleClick = true;" suggestion in the constructor of ISwitchControl and it made no difference. I'm using WDL-OL branch.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:55 AM.
|