Delete UserPreset?



  • I've set up a "local" UserPreset Load and Save for just a couple of parameters.
    I use the

    Engine.getUserPresetList();
    

    and then filter out the specific stored presets related to just those parameters
    I use

    Engine.dumpAsJSON()
    

    for storing the preset files to hard drive and

    Engine.loadFromJSON
    

    to load them.

    What if the user want to delete one of the, to hard drive, stored preset files, is there a way to script that?



  • @ulrik Not sure why you use getUserPresetList here... If you want to store some parameters, dumpAsJson() is effectively the way to go.
    So if you want user to be able to delete some of these "local presets", you need to store them in an multidimensional object. Columns can be parameters and rows the different presets, so you can keep a hand on these presets by adding/deleting rows...



  • @ustk I use getUserPresetList because I want each preset to be stored as a file (so that it would be possible to exchange presets and easily update them, and I need to read the directory where they are stored and that is the only way I know, if there is another way to do it I would be happy to learn about it 🙂

    I can understand the multidimensional object way to go, but I can't see how to store each preset as a file in the users UserPresets?



  • @ulrik The built in preset system already stores each preset as a separate file. What's your end goal?



  • @d-healey lets say I have a sampler with a mixer, and I want to load and save only the mixer parameters, then I also have a normal save and load preset via the preset floating tile.
    If I load a floating tile preset, all the mixer parameters will also be loaded, but then I want to have the same global setting but I want to have several different mixer settings.



  • @ustk @d-healey this is how long I have come so far

    HiseSnippet 1510.3ocsX0sSabDEdVfkDbqqRTiTuczpdgsfZLoo+nRogveQtg.t0jnVQoQi2cLdR1cFqcGGvBEo7D0mg9Lza5qQeCZOmYFytKXLTjxdAxyOemuybNeyLmg1opPdVlJk3svAiFvIderemQRc+M6yDRRqsHdele6TdFWmQiUrHJSFQyXukS1Xz.VVFOh34M6SwI6svbDy2+73MXwLYHOuKB4kJQHeWQhPm2a60elHNdGVD+.QRgY+n0aEpjaphUCAGaV+ljArv2vNluGCm1L9Du42NRnUoczLMOi3M2FpnQc5qNQZm+KEYhtwbrwJjNfgrcuiJNB8XrWxl8EwQsGG.xHfUZmGNl0FNdf+yEQhy6OOrbOy.zbDEiGdyLM2akhtWyat64Uv8ly5d22uSXpXfNeDz29H+VRMOsGKrbZxNWxL+0c72TAyPpajvdCemTnw4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0MfmpEXfyaK9agRUs0Wsf+V7r2nUC.W4b8Bw6NVVq5X0bQuyegxYHmly1mu9nh00dhHR2+7N9ySVuOWbbecwongstDuJtptoXBHm34utnbApaUf52+rKPM42uD0sVeJLcobRAhjEHZ81Wjne8RD8CkH5Jiky6i6jKPz6+ohqH1MgnoFLu60qcthU4Mi7DF.22aFng4VPh2mN1QdXkbO5xU0CusPEMLloK+fC7UVtAfiDJUYOV8tLSnGUbWxGjWgbSc2662VnC6OY+clI3uv1wOz9q6McU82tWO39ubmcN+c9kO7Ofi7ypgZg73myzoBTZr2vjNvSbC4fmHk73rwxEW6lXaLxzgKiLM9W3yM3JXaO2fqLdPRBKLU8pP64i3qFuqoGvmjlGOuf+yw1fvyctnueyFMIIviYeUXHFJ9Bv2mLlGdKv7k2BLO5Vf4qtEX95aAlu4Vf4amJF7+ivSFpUI1sIPGs21b+jm21RFnxLJRx+AOFTyOA
    


  • @ulrik I just thought of another idea, is it possible to drop a preset on the compiled plugin and set the plugin to read the preset data?
    In that case I could use the multidimensional way of storing the presets, I can just send the preset files to the user and the user will drop them on the plugin, would it be possible to achieve?



  • @ulrik Drag and drop of preset is not supported. But you can at least import presets via the "More" button in the preset browser.

    For what you plan to do, I see two solutions.

    You exclude the mixer from being saved with standard presets, and you create the local preset just for the mixer.
    In this case, obviously, when you load a preset from the browser, the mixer doesn't change unless you load a local preset.
    The problem here is that the user won't be able to save/recall the mixer all at once along with the standard presets.

    the second case is a mix of the two presets. You save everything in standard presets, and you give the possibility to the user to recall another mixer state from the local presets on top of that. I think it's the best solution. The mixer can be recalled from the browser, but the user can still load another state. But from what I understand that you want, the first solution would be better (mixer doesn't change on preset change but only on local mixer preset change)

    In both cases, you don't care about gathering the preset list, because you make your own mixer preset system which is independent from the standard one. just don't enable saveInPreset for the mixer's parameters



  • @ulrik I had a look to your snippet. What I find strange is that you mix both preset types in the same combobox. By using Engine.getPresetList you load your mixer presets and all the standard presets at once, it's not discriminated. But it might be your plan 😉



  • @ustk yes, that was my plan, the second case, but in that case I would not be able to delete a "mixer preset", maybe I'm complicating things, I have to think about it some more I think.

    How would you do if you want to have separate mixer presets, store it in a multidimensional object and reserve a couple of slots?



  • @ustk Yes I know, no it's not my plan, I have a filter that I would use
    and the snippet is only a test how everything works



  • @ulrik You can either reserve a number of slots, or if you don't, you can always delete a row in the multidimensional array, and you push new presets at the end.



  • @ustk yes, thank you for assistans, it's much appreciated! 👍


Log in to reply
 

6
Online

622
Users

2.5k
Topics

20.3k
Posts