...Always on the PresetBrowser
-
Wow that‘s ugly ;)
-
-
@d-healey said in ...Always on the PresetBrowser:
@ossian1961 This doesn't work for me, it shows the next preset not the last one that was used.
Thank you David! Anyway I thought to that guy (I don't remember who) who wrote about get the INIT preset everytimes a plugin is open :P
-
Actually neither of these solutions really work. We need a simple way to be able to load a specific preset when the instrument is loaded, currently this doesn't seem to be possible...
-
Ok I found a kind of solution. So when you save your project all of the controls that are set to be saveInPreset are saved. And when you open the project those controls will be restored. So you need to make it so the label you use to display the preset name is set to be saveInPreset. Then in your code where you are setting the text of that label when a preset is loaded you need to check to make sure the presetName is not an empty string.
if (Engine.getCurrentUserPresetName() != "") lblPreset.set("text", Engine.getCurrentUserPresetName());
The only really issue is that it's a little awkward (at least in my case) to save the presets because you have to turn off saveInPreset to get the name to load and then turn it back on and resave the preset. Actually it might be quicker just to edit the preset xml for this.
-
@d-healey said in ...Always on the PresetBrowser:
Ok I found a kind of solution. So when you save your project all of the controls that are set to be saveInPreset are saved. And when you open the project those controls will be restored. So you need to make it so the label you use to display the preset name is set to be saveInPreset. Then in your code where you are setting the text of that label when a preset is loaded you need to check to make sure the presetName is not an empty string.
if (Engine.getCurrentUserPresetName() != "") lblPreset.set("text", Engine.getCurrentUserPresetName());
The only really issue is that it's a little awkward (at least in my case) to save the presets because you have to turn off saveInPreset to get the name to load and then turn it back on and resave the preset. Actually it might be quicker just to edit the preset xml for this.
Thank you David, I now check it :)
-
@d-healey The label return empty for the same :( It seems that without the "Engine.loadNextUserPreset(true);" or the "Engine.loadPreviousUserPreset(true);" lines the PresetBrowser is empty when the project is open... though the sound of the preset is loaded the PresetBrowser looks as initialized.
-
I suggest the following thing that I am doing at HEXERACT:
- make a init preset and call it Init.
- whenever you save your project XML, load the Init patch - this also makes sure there is no noise in the Git commits because of parameter changes.
- the preset label is obviously saveInPreset = false (everything else is just nasty). In the onInit callback you just check whether its empty and do this:
if(!Engine.getCurrentUserPresetName()) Label.set(„text“, „Init“);
-
@Christoph-Hart said in ...Always on the PresetBrowser:
I suggest the following thing that I am doing at HEXERACT:
make a init preset and call it Init.
whenever you save your project XML, load the Init patch - this also makes sure there is no noise in the Git commits because of parameter changes.
the preset label is obviously saveInPreset = false (everything else is just nasty). In the onInit callback you just check whether its empty and do this:if(!Engine.getCurrentUserPresetName())
Label.set(„text“, „Init“);Thank you Christoph :)
-
@Christoph-Hart said in ...Always on the PresetBrowser:
if(!Engine.getCurrentUserPresetName())
I had to change this to
if(Engine.getCurrentUserPresetName() == "")
-
@d-healey said in ...Always on the PresetBrowser:
if(Engine.getCurrentUserPresetName() == "")
I checked both the ways, same result. If I don't put "Engine.loadNextUserPreset(true);" or the "Engine.loadPreviousUserPreset(true);" the label will be empty and the PresetBrowser without the preset list :(
-
@ossian1961 Yes Christoph's code doesn't solve the preset browser issue but it should fix the label problem.
-
@d-healey said in ...Always on the PresetBrowser:
@ossian1961 Yes Christoph's code doesn't solve the preset browser issue but it should fix the label problem.
Unluckily it doesn't fix nothing :(
-
@ossian1961 If you rename your preset title
- Init
it will be on top of the presets, and you can use
Engine.loadNextUserPreset(true);
-
My example
-
@orange said in ...Always on the PresetBrowser:
@ossian1961 If you rename your preset title
- Init
it will be on top of the presets, and you can use
Engine.loadNextUserPreset(true);
That works! Thanks!!!!!! :)
-
@ossian1961 I've just recognized that, it works everytime but except first initialization of the plugin.
Because when the plugin is opened for the first time, after succesfully loading, plugin creates the user preset folders and presets.
But since presets haven't been created (because the plugin hasn't been loaded yet for the first time) on first initialization, the label box will be empty.If you load plugin again, the label box will be ok and show - Init preset since the presets have been created on previous plugin opening.
There should be a fix for that.
-
@d-healey said in ...Always on the PresetBrowser:
@ossian1961 This doesn't work for me, it shows the next preset not the last one that was used.
This works though :p
Engine.loadNextUserPreset(true); Engine.loadPreviousUserPreset(true);
Yeah It Does What It Supposed To Do, But The Issue With This Method Is That The Instrument/ Effect Won't Remember It's Last Settings When An End User Closes His Project.
In Short: Don't Use This Method️
-
This post is deleted! -
@orange Hi, have you found a solution for this? I have the same problem.
"I've just recognized that, it works everytime but except first initialization of the plugin.
Because when the plugin is opened for the first time, after succesfully loading, plugin creates the user preset folders and presets.
But since presets haven't been created (because the plugin hasn't been loaded yet for the first time) on first initialization, the label box will be empty.If you load plugin again, the label box will be ok and show - Init preset since the presets have been created on previous plugin opening.
There should be a fix for that."