The handler class for user presets in HISE. More...
Classes | |
class | Listener |
A class that will be notified about user preset changes. More... | |
Public Member Functions | |
void | addListener (Listener *listener) |
Registers a listener that will be notified about preset changes. More... | |
File | getCurrentlyLoadedFile () const |
Returns the currently loaded file. More... | |
void | incPreset (bool next, bool stayInSameDirectory) |
Just loads the next user preset (or the previous one). More... | |
void | removeListener (Listener *listener) |
Deregisters a listener. More... | |
void | savePreset (String presetName=String()) |
Saves a preset. More... | |
void | setTagList (const StringArray &newTagList) |
If you want to use the tag system, supply a list of Strings and it will create the tags automatically. | |
The handler class for user presets in HISE.
A user preset is a certain state of your plugin which is used for factory banks, storing the plugin state in the DAW as well as files created by the user that restore a certain sound.
If you use a scripted interface, the data that is stored will be a XML element with the value of every ScriptComponent that has the saveInPreset
flag enabled.
However if you are bypassing the scripted interface logic and write your UI and signal path completely in C++, you can still use the logic / file handling of this class. In this case, you will be given a ValueTree that you have to fill / restore with the callbacks in the FrontendProcessor.
This class is deeply connected to the MultiColumnPresetBrowser class, which is the general purpose preset management UI component of HISE and offers functionality like a folder-based hierarchy, search field, favorite system and tags.
It also makes sure that the loading of presets are as smooth as possible by killing all voices, then load the preset on the background thread and call all registered UserPresetHandler::Listener objects when the loading has finished so you can update your UI (or whatever).
void addListener | ( | Listener * | listener | ) |
Registers a listener that will be notified about preset changes.
File getCurrentlyLoadedFile | ( | ) | const |
Returns the currently loaded file.
Can be used to display the user preset name.
void incPreset | ( | bool | next, |
bool | stayInSameDirectory | ||
) |
Just loads the next user preset (or the previous one).
Use this for "browse buttons".
stayInSameDirectory | if true, it will cycle through the current directory (otherwise the entire preset list will be used). |
void removeListener | ( | Listener * | listener | ) |
Deregisters a listener.
void savePreset | ( | String | presetName = String() | ) |
Saves a preset.
If you use the MultiColumnPresetBrowser, you won't need to bother about this method, but for custom implementations, this will save the current UI state to the given file.