Detect if the plugin UI interface is open or closed (bypass code when the ui is closed using broadcasters and listeners)
-
-
@Christoph-Hart
Aha! Thank you I missed this -
@griffinboy You just drop it in your on init callback and the entire script (all midi callbacks) are deferred. I thought this applied to timers as well but as Christoph points out the timers are automatically deferred.
-
@d-healey
I'm not sure if I can do what I want using Synth.deferCallbacks(true);I am firstly trying to defer my Timer script which loops and draws the UI, and then secondly to disable the scriptnode which is creating the information for the Ui.
This is for performance reasons.I think I shall have to look into what Christoph posted, it looks like I shall have to create a listener to this suspend event!
-
@griffinboy
It works perfectly using the documentation here:
https://docs.hise.dev/scripting/scripting-api/content/index.html#setsuspendtimercallbackNote* I discovered that all the repaint() routines get called when switching from a different window, back to the main interface window.
This was confusing me for a moment, making me think that my UI was still updating in the background.But no, it was successfully paused and only repainted once, when opening up the UI page,
-
-
-
@griffinboy
For those who want to see the working code: -
@griffinboy thanks for posting this, it wasn't something I had given much thought to previously, but my newer projects could benefit greatly from this
-
@HISEnberg
No problem,
I'm going to update this screenshot in a second to be less case specific, and with the code for altering scriptnode bypassI'll probably delete this post and just make a neat answer post.
-
I find this topic incredibly interesting and would like to discuss it in depth.
-
Last week, while working on a project for custom logo design services, I faced a challenge with the plugin's UI interface. It was crucial to detect whether it was open or closed. I implemented a solution using broadcasters and listeners to bypass certain code when the UI was closed. This not only streamlined the process but also indirectly optimized my workflow, allowing me to focus more on delivering creative designs to my clients.