SetStateInformation not firing when no custom info in preset

Post Reply
User avatar
AndyMac
Posts: 148
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

SetStateInformation not firing when no custom info in preset

Post by AndyMac »

I'm wanting to use additional state information to automagically migrate user presets from my custom Log scale knobs to the new Log scales in the designer. However, when testing it in debug mode, the SetStateInformation routine does not appear to fire if there is no custom information stored in the preset.

This is a pretty major issue as there is no way for me to work out whether the module has loaded with a preset in the old form, or initialised completely from scratch (where it will automatically want to use the new log knobs).

Is there a way to get at this information? I have tried a load of workarounds and have found none to actually allow me to work out whether a preset or state has been loaded (which could imply the version). I am trying to understand the initialisation sequence so that I can try to get at whether state has been restored of defaults just used - I can't seem to find any way to even get at this!

A couple of suggestions that would help:
1. ensure, or allow SetStateInformation to fire even when nothing in the custom byte array - devs would need to handle null arrays
2. maybe a simple value that can be queried to get at whether the state has been restored, and from what
3. include some form of build version in the presets as saved - and make this available through the variables for the modules as well

I am going to add the versioning into all modules going forwards, but this still does not help with the migration question.
CherryRuss
Posts: 27
Joined: Sat Oct 20, 2018 9:29 pm

Re: SetStateInformation not firing when no custom info in preset

Post by CherryRuss »

Hi AndyMac.

We've talked this over and decided to send notifications when preset loading begins and ends. Then you can set a boolean flag when preset loading starts and another when SetStateInformation gets called, and if you start getting knob values during the loading process without the SetState flag set, you'll know this is a preset from an older version of the module. Let us know if this won't work for you.
User avatar
AndyMac
Posts: 148
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

Re: SetStateInformation not firing when no custom info in preset

Post by AndyMac »

That's brilliant. This would work for me fine, and seems like a great way to deal with it.
I presume this will be on the backlog for the next release?
Thank you
CherryRuss
Posts: 27
Joined: Sat Oct 20, 2018 9:29 pm

Re: SetStateInformation not firing when no custom info in preset

Post by CherryRuss »

Yes, it should be in the next build. Possibly out next week, depending on how testing goes.
User avatar
AndyMac
Posts: 148
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

Re: SetStateInformation not firing when no custom info in preset

Post by AndyMac »

Brilliant :-)
Post Reply

Return to “Module Designer”