...Always on the PresetBrowser



  • @Christoph-Hart the only thing I don't understand is why everytimes I recall the project, the PresetBrowser viewer is empty, though the preset is loaded and everytimes I must press on Bank -> Category to see the presets ☹

    If you just explained it, please write me the link of the topic, I did find nothing about this thing.



  • FINALLY SOLVED!!!!!! πŸ™‚
    To get the PresetBrowser viewer loaded and so the label that shows the first preset ("Init" for exemple) everytimes the plugin is launched just add this line on the main script:

    Engine.loadNextUserPreset(true);
    

    πŸ™‚



  • @ossian1961 This doesn't work for me, it shows the next preset not the last one that was used.

    This works though πŸ˜›

    Engine.loadNextUserPreset(true);
    Engine.loadPreviousUserPreset(true);
    


  • Wow thatβ€˜s ugly πŸ˜‰



  • @Christoph-Hart said in ...Always on the PresetBrowser:

    Wow thatβ€˜s ugly πŸ˜‰

    LOL



  • @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 πŸ˜›



  • 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
    Untitled-1.jpg



  • @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.


Log in to reply
 

6
Online

502
Users

1.8k
Topics

13.6k
Posts