How to fetch list of XMLPresetBackups for loading
-
Using the ExternalFloatingTile example, and coding my UI in C++. I'm having trouble finding how to access the list of available presets so that I can load them. I found the UserPresetsHelper, but I want to load the bundled presets that I have made.
I found how to get a list of sample maps from getCurrentSampleMapPool(). But still having trouble figuring out XMLPresetsBackups list, which I assume is the list of xml presets that I want.
Anyone have an example of finding the list of non-user presets and loading one in C++?
-
XMLPresetBackups are backups of your project, is this what you're wanting? If so there is no way to do that.
-
Maybe I'm misunderstanding the various formats and the hierarchy.
There's a sample map, which tells a sampler what audio files to play from which midi notes.
But isn't there a preset above that storing all the whole signal chain? I thought I'd be able to load different presets with different signal chains, and thus produce a different UI layout... but maybe not?
Or I'd have to use the Raw C++ approach, and load them as HISE snippets?
-
Your HISE project is stored either as a .hip file or an XML file (aka XMLPresetBackup). This contains the chain of modules that defines your project. These files,
.hip
and.xml
can be opened in HISE for you to work on your project.The sample map is an entirely separate xml file that defines the mapping of samples inside the mapping editor. Usually a sample map is only used in a single project, but there is nothing stopping you using it in multiple projects, it is not tied/locked to a particular
.hip
orXMLPresetBackup
.Within your project you can load sample maps into samplers through the sampler module, you can also do this via scripting.
The functionality you're describing, to load different project files into your project, is not possible in HISE - although maybe one day if the HISE player project is reborn.
The only way you could do this is to create your own project in C++ (or another suitable language), I don't think you could do it through HISE's Raw C++ API (but I might be wrong).
Then there are user presets. These have the file extension
.preset
. A user preset saves and restores the configuration of controls on the GUI, and through scripting it can be used to load sample maps and change the state of various other modules. This may be able to achieve some of what you've described. -
Thanks. Just to confirm, what's the correct way to get a list of sample maps from C++ for loading when using a custom C++ UI with the External Floating Tile demo? I've turned the sample maps into monoliths and I have two. I'd just like to try switching between them for testing.
-
@ohtravioso I have no idea :) I'm not too familiar with the C++ side of things.
-
Ok. I understand better now. You create "User Presets", but they got bundled along as factory content. I have to add controls to the Interface designer, so they're part of the preset. But then I have to hide them when using the External Floating Tile with C++ JUCE GUI. And the presets only affect the single chain you've created, which can involve many samplers you can enable and disable.
That gets a little tedious having to hide and show controls all the time since I don't want any of them to show, but seems to be working.
UPDATE: Small tip is to place all those controls in a single Floating Tile, and then just show and hide that one component as needed.