showing samples in the GUI (to select it and save it in preset):
include("SettingsButton.js");
include("UserPresetWidgets.js");
const var ComboBox = Content.addComboBox("ComboBox", 721, 3);// [JSON ComboBox]
Content.setPropertiesFromJSON("ComboBox", {
"text": "Presets",
"width": 189,
"bgColour": 4278190080,
"itemColour": 4278190080,
"itemColour2": 4211081216,
"pluginParameterName": "Presets",
"items": ""
});
// [/JSON ComboBox]
const var Sampler = Synth.getSampler("Sampler");
const var sampleMapList = Sampler.getSampleMapList();
ComboBox.set("items", sampleMapList.join("\n"));
inline function onComboBoxControl(component, value)
{
Sampler.loadSampleMap(sampleMapList[value-1]);
};
ComboBox.setControlCallback(onComboBoxControl);
const var presetDecButton = UserPresetWidgets.createPresetButton("presetDecButton", 379, 8, false);
const var presetIncButton = UserPresetWidgets.createPresetButton("presetIncButton", 575, 9, true);
const var presetDisplayPanel = UserPresetWidgets.createPresetDisplay("presetDisplayPanel", 405, 6);
UserPresetWidgets.setPresetBrowserLookAndFeel(presetDisplayPanel, "Digital-7 Mono", 15, "0xFFAAAAAA");
const var settingsButton = SettingsButton.createSettingsButton("settingsButton", 5, 5);
const var PerformanceLabel = Content.addFloatingTile("PerformanceLabel", 31, 2);
// [JSON PerformanceLabel]
Content.setPropertiesFromJSON("PerformanceLabel", {
"width": 186,
"height": 32
});
// [/JSON PerformanceLabel]
const var perfData = {
"Type": "PerformanceLabel",
"Font": "Digital-7 Mono",
"FontSize": "12.0",
"ColourData": {
"textColour": "0xAAFFFFFF"
}
};
PerformanceLabel.setContentData(perfData);
const var Tooltips = Content.addFloatingTile("Tooltips", 1128, 2);
// [JSON Tooltips]
Content.setPropertiesFromJSON("Tooltips", {
"width": 453,
"height": 26,
"itemColour": 4294901760,
"itemColour2": 4294901760
});
// [/JSON Tooltips]
Tooltips.setContentData({"Type": "TooltipPanel",
"FontSize": 13.0,
"ColourData": {"bgColour": "0x000000"}});
i used it for a multisample/library rompler. Of course all set "save in preset" = yes