Persistence of widgets - problem
-
Hey,
I'm using a set of text widgets to hold numeric values - and using these numbers in my authorisation function.
Now I'd like to run my authorisation function on init but I see from other threads Christoph says:
"The persistent values of interface widgets are initialized after the onInit callback."
So the question of the day is - when can I run this authorisation function?
I tried in the on control call back
simply saying:
if (CR_Auth != true){ validateAuth(); }
but it seems when I get to the plugin itself - first time in it shows me the authorisation screen, takes my numbers and accepts my authorisation - and the instrument works fine, but if I unload the plugin and reload it - then these text fields are all set back to zero....it LOOKS like its not saving the text values....
What am I doing wrong?
-
Is this the HISE authorisation system or your own?
-
@d-healey my own what's the hise one?
-
@Lindon HISE has some kind of serial key system, I don't know much about it. Talk to Christoph :)
-
@d-healey - oh that one, well I have, its a "call-home" system using a server (Well I think it is) and that is only second in the "most unpopular authorisation systems" to PACE.
So its a no go.
So back to my original question: how do I get widget values to persist, and at what point in "plug-in start up" can I assume these have been initialised?
-
OK more experimentation.
Its clear that the plugin is NOT persisting the state of widgets, unless I save the project (in my DAW), and even then ONLY in the saved project. Is it even supposed to - do I have this wrong?
Where can I get some persistent storage ?
Can I write to read from a file?
I see I can loadFromJSON -- which would be ideal but there is no saveAsJSON that I can see
-
unless I save the project (in my DAW)
Are you building your instrument inside the VSTi version of HISE? I always use the standalone for building and the VSTi for testing.
All widgets with their
SaveInPreset
property set to true will have their values restored after the init callback has completed. Following that they all have theironControl
callbacks triggered. So if you want to access a saved value after initialisation you need to do it inside anonControl
callback. -
@d-healey I am building my plugin in the stand alone version of hise, then I'm loading my built plugin into my DAW (Tracktion or Reaper)
I dont dont dont want to save these widget/values in the user Presets. Sharing a preset between users would mean sharing authorisation keys - bad bad bad.
..and if i did I would have no way of creating factory presets - they would all have zeros in the authorisation key - so when a user opened a factory preset hte authorisation would fail and they'd have to enter the auth keys again....very very bad.
-
@Lindon Then I think you'll need Christoph to create a write to JSON file function.
-
@d-healey Thanks Dave.... in the meantime I will just have to get over myself... and try convince my customers that they wont really need authorisation (they already love the audio file protection in HISE)... I will create a post in the "Feature request" section...