Page 1 of 1

Save and load of ALL control and user data

PostPosted: Wed Nov 06, 2019 9:25 am
by Fritzi
Hello,

I would like to make an application as exe, not as VST and I am wondering, how ALL user generated settings can be
saved as presets. I.e. the values of sliders, knobs, text boxes, numerical values and the settings of all internal controls, like colours, sizes, aso.
The build in preset management sems to work only with VST/DAW, but what I need is the saving and loading of user (and internal) settings in a file, that can restore EVERY value of ALL controls, so a user finds exactly the same settings he once made.
Loading and saving of "session1", "session2", aso., for example.

Thank you very much for your help

Re: Save and load of ALL control and user data

PostPosted: Wed Nov 06, 2019 1:55 pm
by adamszabo
You can save anything in a simple text file

Re: Save and load of ALL control and user data

PostPosted: Wed Nov 06, 2019 2:13 pm
by Fritzi
Fine, but how exactly ?
I am new to FS and Ruby. In VB I can do this easily, but in FS there are a lot of nested modules, when you use modules in modules, some of them communicating "wireless", too.
So the usual way of reading data like:

MyText1= Form1.Textbox22.Text (in VB)

won´t work.
That´s the reason for my stupid question, how to get them all to a text file and load them again in order to restore EVERY value of every module/GUI component.

Thank you very much for your help

Re: Save and load of ALL control and user data

PostPosted: Wed Nov 06, 2019 3:16 pm
by Spogg
In an executable you would have to use the Program Manager to save a program (preset) to wherever you choose. This is saved as a text file.

When you next open the executable you would then have to manually load the program again to whatever slot you wanted in the Program manager. Assuming all the preset parameters have unique names, you would then restore all the settings stored in the program text file.

If you wanted to automatically reload the settings when opening the executable, you would have to use Ruby code for the file handling and I’m not aware that anyone’s done that before. The big advantage of using a DAW or VST hosting app is that it can store all the settings in the project (song) file so the state is saved. For this, Lock should be set to False in the Program Manager.

Cheers

Spogg

Re: Save and load of ALL control and user data

PostPosted: Sat Nov 16, 2019 7:49 pm
by Fritzi
Hi Spogg,
thank you very much. I tried to do so, but something is wrong.
I named all user control elements by different names (at least I think so) , but after saving some different setting under different file names and loading them agin, the user settings were NOT restored, but some weird behaviour appears, like moving other faders and knobs, but most of the user controls like knobs and sliders did not change their state at all.

What is wrong here ?

Thank you very much

Fritzi

Re: Save and load of ALL control and user data

PostPosted: Sun Nov 17, 2019 9:33 am
by Spogg
I think at this point you’ll need to upload your schematic so we can take a look.

Cheers

Spogg

Re: Save and load of ALL control and user data

PostPosted: Mon Nov 18, 2019 1:10 am
by billv
Fritzi wrote: how to get them all to a text file and load them again in order to restore EVERY value of every module/GUI component.


Try this custom made Pre set manager that saves and loads from file automatically
Scroll down the thread and select Version 3
http://www.dsprobotics.com/support/viewtopic.php?f=3&t=2294

Re: Save and load of ALL control and user data

PostPosted: Mon Nov 18, 2019 6:42 pm
by Fritzi
@billv Thank you very much, but I do not understand it, I am newbie

@ Spogg I attached an example with some GUI elements. Turning them all to 0 or off and saving as "preset1"
After that, turning them to maximum or on and saving that as "preset2"
After loading the presets,the vertical slider and the LED switch do not restore their old settings. Why ?

Thank you very much
Fritzi

Re: Save and load of ALL control and user data

PostPosted: Tue Nov 19, 2019 9:23 am
by Spogg
You made a very fundamental mistake!
Your demo schematic has two modules whose preset parameter name is Switch, and two called Preset name.
All parameter names must be unique, otherwise the preset manager system won’t know which value goes to which module.

Some time ago I made a little tutorial about this:

viewtopic.php?f=2&t=5985&hilit=preset+tutorial#p28501

Good luck and have fun!

Spogg

Re: Save and load of ALL control and user data

PostPosted: Tue Nov 19, 2019 2:33 pm
by Fritzi
Hi Spogg,

Great, thank you very much for your help !
If FS would automatically add preset names like preset 1, preset 2, aso. when a new element is used,
these things couldnt happen, I think.
They should add your preset manual to their user manual :-)

Thank you

Fritzi