Presets radio-button for changing from current to another Rackspace/Variation


#21

It may be that we need to add functionality to GP Script to explicitly disable/enable callbacks but it’s not obvious to me that that won’t cause a completely different set of problems.


#22

I think that what I am doing right now, I mean setting variables to inhibit the callback actions, is more risky than having a “silent” option on a SetWidgetValue function. Indeed, each time I want to “silently” set a widget value, I prevent the action of 1 callback. But as callbacks are asynchronous, I cannot be sure the callback I inhibit this way is the one called due to my action on the widget value :grimacing:.
From the system side, I don’t see why It should be risky not to call callback functions at initialization time. From the user side, it is still possible to initiate an initial call of one ore more callback functions from the “Activate” callback function if necessary (e.g. by setting a widget value to the exact same value, its callback function is called).

Not convinced ?

Well, in the meantime, I the widget “recall values” I saved could stay to the saved values all the time, I would already be happy :smirk:


#23

I think I am missing something… I am talking from the « Recall values » in the widget properties. I only act on the widget « values », there is no way to change the « Recall values » within a script, and my « Recall values » are modified by something, because when I check the widget properties after a while, some «Recall values », initially saved to 0.0 are suddenly set to 100.0 !!!


#24

Can you provide a really tiny example gig where this is reliably happening so that we can investigate? It should have as few plugins as possible (preferably none, perhaps just use our internal plugins)


#25

OK, I prepared a gig file, but It is not was I expected. Here it is : presets_radio-buttons.gig (83.6 KB)

First of all, I tried to remove almost everything but the presets panel and the scripts. But each time I try to remove the unused panels, GP freezes (milky screen and rotating mouse pointer in Windows 7 64) and finally GP crashes. So, perhaps you could also have a look at this issue?..

The gig file is not what I expected to provide, because It doesn’t allow me to give you a proof of the phenomenon I described (a 0 “Recall value” changed to a 100 while playing with the preset buttons). To tell the truth, It never worked that fine. I checked many times, and no suspicious “Recal value” change. But, fortunately something strange happen that you can possibly reproduce.

It happens each time I switch from Preset3 or Preset4 (in Mr Tramp rackspace) to Preset2 or Preset1 (in Ivory Rackspace). It selects Preset0, which is not supposed to be possible. Indeed, when switching to Ivory this way, the initial call of the Button0 callback function, which is supposed to be called with 0 as a new value (because it is the “Recall value” I saved), is called with a new value equal to 1!

Here is the script log I produce at this time, I hope what happens is clear enough :grimacing: ( what I call “global level” or “global value” is related to the “global variable” holding the ID of the current ON preset button, which I encode in the Label0 under the form <99.id>)

Mr Tramp: Button2 callback start ============
Mr Tramp: Button0: OFF
Mr Tramp: Button1: OFF
Mr Tramp: Button2: ON
Mr Tramp: Button3: OFF
Mr Tramp: Button4: OFF
Mr Tramp: Button5: OFF
Mr Tramp: Button6: OFF
Mr Tramp: Button7: OFF
Mr Tramp: Button2 callback stop ============
Mr Tramp:
Mr Tramp: Button3 callback start ============
Mr Tramp: === SILENT CALL ===
Mr Tramp: Button3 callback stop ============
Mr Tramp:
Ivory: Button0 callback start ============
> Ivory: Button0: ON
Ivory: Button1: OFF
Ivory: Button2: OFF
Ivory: Button3: OFF
Ivory: Button4: OFF
Ivory: Button5: OFF
Ivory: Button6: OFF
Ivory: Button7: OFF
Ivory: Button0 callback stop ============
Ivory:
Ivory: Button1 callback start ============
Ivory: Button1 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button1 callback stop ============
Ivory:
Ivory: Button2 callback start ============
Ivory: Button2 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button2 callback stop ============
Ivory:
Ivory: Button3 callback start ============
Ivory: Button3 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button3 callback stop ============
Ivory:
Ivory: Button4 callback start ============
Ivory: Button4 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button4 callback stop ============
Ivory:
Ivory:
Ivory: >>>>>>>>>> Switched to Variation Number : 0
Ivory:
Ivory: Button0 callback start ============
Ivory: Button0: ON
Ivory: Button1: OFF
Ivory: Button2: OFF
Ivory: Button3: OFF
Ivory: Button4: OFF
Ivory: Button5: OFF
Ivory: Button6: OFF
Ivory: Button7: OFF
Ivory: Button0 callback stop ============
Ivory:
Ivory: Button1 callback start ============
Ivory: Button1 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button1 callback stop ============
Ivory:
Ivory: Button2 callback start ============
Ivory: Button2 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button2 callback stop ============
Ivory:
Ivory: Button3 callback start ============
Ivory: Button3 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button3 callback stop ============
Ivory:
Ivory: Button4 callback start ============
Ivory: Button4 new value is OFF! Let’s Check if it is OK at global level
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: Button4 callback stop ============
Ivory:
Ivory: ###################################################
Ivory: ######## Activation callback of Ivory rackspace
Ivory: =======>
Ivory: =======> Only Button0 is ON according to global value !
Ivory: =======>
Ivory: ###################################################
Ivory:
Ivory:
Ivory: >>>>>>>>>> Switched to Variation Number : 0
Ivory:

I hope the current state of my source code, with many many debug prints and “quick & dirty” hacks, is clear enough (I am still trying to understand how GP script works).

Regards,

David