How to check that the preset has finished loading?
-
I want to read some values from preset when the plugin startup.
I found it does not work well with those UIs not finished recovering from preset. -
@civet You can use the postCallback() of the preset handler.
-
@d-healey are there any examples of this?I tried it, but the callback does not seem to fire :(
-
are there any examples of this?
Not that I know of, but there isn't much to it:
const uph = Engine.createUserPresetHandler(); uph.setPostCallback(function() { Console.print("The preset is loaded"); });
-
@d-healey I see... It’s only for user preset system such as using a UserPreset browser, not what I wanted.
-
@civet What do you want?
-
@civet said in How to check that the preset has finished loading?:
@d-healey I see... It’s only for user preset system such as using a UserPreset browser, not what I wanted.
You can also use it for the "loadUserPreset()" function
-
This post is deleted! -
You can also use it for the "loadUserPreset()" function
yea, I think it does the same thing as clicking on a PresetBrowser.
-
@d-healey
I'm using a hidden UI control to save the state about which samplemap is selected.And then, restore it in a DAW Session without touching the loadUserPreset() function
ref: https://docs.hise.audio/working-with-hise/project-management/user-presets/index.html
my solution doesn't work properly in the compiled plugin:
restoreSamplemapFrom( hiddenLabel.get("text") ); // this text is empty on Init
Maybe I could use a ComboBox with ControlCallback instead of this simple Label.
-
@civet So this has nothing to do with presets. You can use the onloading callback to check if samples have finished loading from a sample map.