Saving and accessing presets
-
@pcs800
Also, make sure to tick 'Embed User Presets' in the settings. This ensures that when you ship the plugin, it includes the presets and automatically extracts them to the user's presets folder. -
@ustk Excellent, thank you!
So now how do I save presets with it?
It has a search field and a save button which doesn't seem to do anything. -
@pcs800 Click
Add
in the Preset Browser to save a new preset
Save
is for saving the preset that is currently loaded -
@ustk Oh boy, my fault. I had the browser tile very short, and the "add" option was hidden. Thank you again
-
@ustk How would I show and hide the preset browser with a button?
It's pretty big and if visible all the time, would take up too much space. -
@pcs800 You can set the visible property in the button's callback
-
@d-healey I don't know what callback means.
I know I can set the visibility in the preset browser properties window.
How would I use a button to alternate the browsers visibility? -
-
@d-healey Ok, i am using the following script to show/hide the preset browser via a button. However, I have to click it twice to show, and twicce to hide.
How do I get it to click once for each action?inline function onbtnToggleBrowserControl(component, value)
{
if (value)
{
fltPresetBrowser.set("visible", !fltPresetBrowser.get("visible"));
}
}const var btnToggleBrowser = Content.getComponent("btnToggleBrowser");
const var fltPresetBrowser = Content.getComponent("fltPresetBrowser");inline function onbtnToggleBrowserControl(component, value)
{
if (value) // Only trigger on button press (value == 1)
{
fltPresetBrowser.set("visible", !fltPresetBrowser.get("visible"));
}
};btnToggleBrowser.setControlCallback(onbtnToggleBrowserControl);
// Hide browser on init
fltPresetBrowser.set("visible", false); -
@pcs800 Never mind, I found it. The radial group set to 1 works.
-
@pcs800 Looks like you're making good progress. Each control can only have one control callback. You've assigned two here, so you're going to get weird behaviour.
This is how I would do it:
//! fltPresetBrowser const var fltPresetBrowser = Content.getComponent("fltPresetBrowser"); //! btnToggleBrowser const var btnToggleBrowser = Content.getComponent("btnToggleBrowser"); btnToggleBrowser.setControlCallback(onbtnToggleBrowserControl); inline function onbtnToggleBrowserControl(component, value) { fltPresetBrowser.set("visible", value); }
-
@d-healey This code isn't working. Clicking the button does not show/hide the preset browser.
However, the code I posted above is working, so i have another problem now.When the plugin is loaded into a daw, the preset browser shows up. I want it to be hidden at startup. How would I code that?
-
@pcs800 said in Saving and accessing presets:
This code isn't working
Did you remove your code before putting this code in? Did you disable the radio group (set it to 0)? Radio groups are for when you have multiple buttons working together.
@pcs800 said in Saving and accessing presets:
When the plugin is loaded into a daw, the preset browser shows up. I want it to be hidden at startup. How would I code that?
If the button's saveInPreset property is enabled, then as long as you save your project with the preset browser hidden it will be hidden when the plugin is loaded.
-
@d-healey I had not set the radil0 option back to zero, my fault. So yes your code does work, thank you for that.
I am compiling a new build with the browser hidden in the reset.
I'll let you know if I somehow mess that up too. -
@d-healey Ok that worked! Thanks!
Now my other issue is that the presets I built in hise, are not showing up in the preset browser when the plugin is loaded into a daw. -
@pcs800 If you've enabled the option in project preferences to embed presets in the plugin then the first time you run the plugin the presets will be extracted - but only the first time.
After that the presets won't be extracted unless you clear them from the app data folder (which you can find through the file menu in HISE).
-
@d-healey So go to the project appdata folder and delete the .json file inside the user presets folder?
-
@pcs800 Delete the user presets folder
-
@d-healey That worked, but seems odd when thinking in terms of installing on a users computer.
But I'll get to that when the time comes.
The only issue I have left now, if that when I choose a preset, the browser window closes. It should remain open until the user clicks the show/hide button.
How do I accomplish that? -
@pcs800 You need to save your presets with the button enabled.