(Use This) Panel Start-up Blocking Code #576
Replies: 8 comments 11 replies
-
All it is is a fancy way of setting a variable to true at boot and then setting to false after a timer has run; 300ms seems to be enough. Then one checks for true or false at the beginning of each function that would otherwise be triggered on starting the program. The object is created in constructor using The lua class syntax aims to emulate Atom's
|
Beta Was this translation helpful? Give feedback.
-
so 'Panel' is a 'class' ? n00b does not actually know what it means. a macro? something like that? defined by? setmetatable(Panel, { stuff } ) end still somewhat over my head :o) |
Beta Was this translation helpful? Give feedback.
-
I have never had this experience. You might have to ensure all your code is watertight! Sometimes I have had to use it in mouse down functions- I don’t know why, but in theory it shouldn’t be necessary. |
Beta Was this translation helpful? Give feedback.
-
If I may also shine in in this topic... I'm using 5.3.201 but also 5.6.23 (=5.5.9) You should only check for if panel:getBootstrapState() == false My "called when panel has finished loading" looks like this:
Then in timers callback, at the end of the timer 2 code I set bPanelLoaded = true In Miscellaneous I have this:
In _OnChange methods I have this:
In _OnClick methods, I'm not checking for isPanelReady() |
Beta Was this translation helpful? Give feedback.
-
Hi there @dobo365 ! Thanks for your input. -- Reset Midi INPUT devices to avoid having MidiMessageReceived method called twice -- If resetting Controller devices then the bidirectional behaviour is loss (most probably a bug) sMidiDevices = panel:getProperty("panelMidiInputDevice") panel:setPropertyString("panelMidiInputDevice", "-- None") panel:setPropertyString("panelMidiInputDevice", sMidiDevices) Can you explain this a little? I have seen it but never used it. Maybe I have this problem in my panels, but I've never noticed it.
|
Beta Was this translation helpful? Give feedback.
-
thank you, dobo365. |
Beta Was this translation helpful? Give feedback.
-
So actually that bPanelLoaded is exactly the same logic. Set false with timer. One problem I found is when opening two of the same panel in Ctrlr, then popup objects or utils.warnWindow() may display- you then might need to block with ’source’ parameter. |
Beta Was this translation helpful? Give feedback.
-
Also, I’m getting a lot of source =2 coming in with the Korg M3R which I understand and sometimes clicking on a button gives me source =6, but not 4 - I haven’t yet worked out why it sometimes does that. I think Damien is using 5.6 so he might not need to block on start. |
Beta Was this translation helpful? Give feedback.
-
apparently the following do not work in drafted exe and VST instances. @dnaldoog made something for this, linked below, but he's going to have to explain it.
post:
#564 (comment)
https://ctrlr.org/forums/topic/standalone-images-not-loading/
( good read )
Beta Was this translation helpful? Give feedback.
All reactions