I've set up a "local" UserPreset Load and Save for just a couple of parameters.
I use the
and then filter out the specific stored presets related to just those parameters
for storing the preset files to hard drive and
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
getUserPresetListhere... 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.
@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
saveInPresetfor 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.getPresetListyou 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!