ComboBox for basic preset manager

Hi,

I’m trying to make a basic preset manager to load, save and delete presets (xml), and these are populated from an user folder into a ComboBox.

It seems to work ok but one thing I’m missing is that ComboBox seems to reset to index 0 when close/open window plugin and I’d like the last preset (item) selected to be shown… I guess this is really simple but I’m stuck.

On the other hand I’d like to attach the ComboBox to an AudioParameterChoice in my apvts but since the items of the ComboBox may increase or decrease I can’t imagine how to update and keep in sync the items of the ComboBox with the StringArray list of the parameter, is this possible? would it be better to attach it to a AudioParameterInt and keep track somehow the indexes?

Thank you,
jc

People normally either:

  • Use the program change controls for selecting presets
  • Ignore those and do you own thing

If you do the latter you’ll need to be saving the name or index of your preset in some state with getStateInformation and setStateInformation so you can restore the preset name when the plugin is reopened.

You may also want to keep the current preset name in an object that’s associated with your processor not your editor so it doesn’t lose the name/position when the user closes and reopens the UI.

Using a parameter to select a preset might work. But it sounds unusual :slight_smile: And is why you’ve reached a tricky point trying to figure out how to handle the increasing number of parameters.

1 Like

Thanks for your response, getStateInformation and setStateInformation solved it, I was obfuscated in the editor :s

For a fixed number of presets (let say factory) parameter works fine also with the extra of undomanger, so I will give it a try.

1 Like