Expansions / Combo Box + SampleMaps
-
Add the
{EXP:
part back in when you load the sample map. -
You might find
Expansion.getWildcardReference(var relativePath)
helpful -
@d-healey Thanks David, the parallel combo box is working for now. If I'm feeling brave later on I'll try this!
-
@d-healey Ran into a slight glitch wit my combobox method. Just to refresh:
I'm using a combo box to switch between Expansions on my UI. Everything working nicely except:
I've got the combo box set to 'Save in Preset'. This means that everything gets loaded as I want it in a DAW project. Great.
However, the combo box saves a value, not an expansion. Therefore if a user changes the list of expansions (either by adding or removing expansions) then this system breaks, and potentially loads the wrong expansion etc.
Removing Save in Preset creates a kind of hybrid when reopening the DAW project (saved in exp mode) where the samples maps are factory (as per my script) but the UI is in Expansion mode (extra images etc). Even the Preset Browser is combined, displaying the Factory folders on the left but the expansion presets on the right
And if the value is higher than the amount of Expansions installed it reverts to Factory
Am I screwed?
-
@DanH said in Expansions / Combo Box + SampleMaps:
Am I screwed?
Maybe, but I think I will be too because I'm planning something similar in my project. Once I get there I'll find a solution :)
-
@DanH said in Expansions / Combo Box + SampleMaps:
Therefore if a user changes the list of expansions
.. how are they doing this?
Can yo use it to write/re-write a list of valid expansions to disk - and then use that to load up your combo box.?
-
@Lindon the combo box callback searches available expansions and makes a list
-
@DanH That sounds like a weird way to do it. Why not juse use
expHandler.getExpansionList()
? -
@d-healey that is how I'm doing it actually
const var expansionNames = []; expansionNames.push("FACTORY"); for(e in expHandler.getExpansionList()) expansionNames.push(e.getProperties().Name); const var ExpansionSelector = Content.getComponent("ExpansionSelector"); ExpansionSelector.set("items", expansionNames.join("\n")); inline function onExpansionSelectorControl(component, value) { expHandler.setCurrentExpansion(component.getItemText()); }; Content.getComponent("ExpansionSelector").setControlCallback(onExpansionSelectorControl);
ExpansionSelector is the combo box
-
@DanH said in Expansions / Combo Box + SampleMaps:
that is how I'm doing it actually
Aha, that isn't what you said :p Now it makes sense.
-
@DanH so your combo box always has a valid list of expansions in it, so whats the problem?
-
@Lindon If expansions are added or remove the list will need to be updated, this means the indexes will change in the combobox, so restoring from saveInPreset based on those saved indexes will cause a different expansion to be loaded.
-
@d-healey said in Expansions / Combo Box + SampleMaps:
@Lindon If expansions are added or remove the list will need to be updated, this means the indexes will change in the combobox, so restoring from saveInPreset based on those saved indexes will cause a different expansion to be loaded.
Correct - but as the "original" preset is no longer there its either load another or load nothing right?
-
@Lindon Well he's got it kind of working backwards I think because usually the last used preset should load and this will automatically load the correct expansion, but since he's using saveInPreset to load expansions it will go preset >> expansion >> combobox >> expansion >> ? or some other weirdness.
-
-
@d-healey I still think the preset browser is messed up though, i.e the Factory folders still appear when they should be the expansions'... if anyone else is able to test....
-
Is there a way to get an active expansion's name? Can't figure it out from the docs
-
@DanH There is a
getCurrentExpansion()
function and you can get the properties of the expansion withgetProperties()
and the properties includes the name. -
@d-healey Thanks, useful bit of script here for anyone interested: