loadUserPreset - strange behaviour...
-
@Lindon said in loadUserPreset - strange behaviour...:
@ossian1961 thank you for this pointer, however, developing a separate stand alone call-and-response based solution is again over kill in my view, plus it definitely does not fit with any of the major distributor networks - who require (at best) a set of pre-built "authorisation codes" to distribute with their sales receipts.
So what I'm trying to do here is find a way of storing IN the plug-in (or in a file I can access from the plug-in) a set of authorisation numbers.
This functionality has been available in Kontakt since at least version 4, so I'm a bit surprised frankly its not in HISE already.
You right. I partecipated for this theme on many forums and most of the best developers, at the end, noticed that a "good" cracker will be able to find the way to crack it.
-
@ossian1961 then if you were on those forums you will know all sides of the argument.
-
@Lindon said in loadUserPreset - strange behaviour...:
@ossian1961 then if you were on those forums you will know all sides of the argument.
I just wrote those guys said, that's all. They have this problem every days about their work.
-
This functionality has been available in Kontakt since at least version 4, so I'm a bit surprised frankly its not in HISE already.
I think the reason it's not in HISE is because until now there hasn't been a use case for it, everything so far can be done through the existing preset system.
-
@d-healey Dave, yeah understood, and I'm happy (ish) to use the existing systems - especially if I can get it to work - but right now I cant get HISE to recall any values for any widget.
Lets hope Christoph can point at what I'm doing wrong.
-
Hey guys. I'm just starting to add user presets to my project. Having a little trouble getting them to load with a combo box.
I've created 2 user presets in the PresetBrowser, but the interface designer doesn't show any control changes.
Here's what I'm doing:const var ComboBox1 = Content.getComponent("ComboBox1"); const var list = Engine.getUserPresetList(); inline function onComboBox1Control(component, value) { switch (number) { case 1: Engine.loadUserPreset(list[0]); break; case 2: Engine.loadUserPreset(list[1]); break; } }; Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
-
@dustbro have you checked that list elements contain the correct data? Bit obvious but still...
-
@dustbro
switch (number) { case 1: Engine.loadUserPreset(list[0]); break; case 2: Engine.loadUserPreset(list[1]); break; }
Use this instead :
Engine.loadUserPreset(list[number-1]);
it's not a fix to the issue it's just a much shorter way of writing the same thing. Where are you gettingnumber
from though? -
@Lindon I believe so:
-
Protip: Rightclick on the row in the table to get a popup with the data for arrays and objects :)
-
@d-healey said in loadUserPreset - strange behaviour...:
Where are you getting number from though?
I thought the number was the position of the selected combo box?
-
@dustbro said in loadUserPreset - strange behaviour...:
I thought the number was the position of the selected combo box?
The combobox has a index starting with 1 because 0 marks "no selection".
-
@dustbro
I thought the number was the position of the selected combo box?
In this function the first time the word
number
appears is inside theswitch
. I think you want to replace number with value.inline function onComboBox1Control(component, value) { switch (number) { case 1: Engine.loadUserPreset(list[0]); break; case 2: Engine.loadUserPreset(list[1]); break; } };
-
@d-healey said in loadUserPreset - strange behaviour...:
I think you want to replace number with value.
If I replace number with value, HISE crashes when I compile the script
-
Even if I ditch the array
this = instant HISE crash:inline function onComboBox1Control(component, value) { switch(value) { case 1: Engine.loadUserPreset("asdf/Bass/BassLeveler"); break; case 2: Engine.loadUserPreset("asdf/Drums/DrumPump"); break; } }; Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
-
@dustbro yeah HISE crashes like a 0.1 app when I use loadUserPreset
-
@Lindon :( Using the Preset browser floating tile works as expected... but my GUI only has room for a simple combo box.
not sure what I'm doing wrong -
@dustbro yeah must be some bug with the load preset function. But value is definitely right since number doesn't exist
-
@dustbro As Dave pointed out to me, using:
storeAllControlsAsPreset("abc",false);
and
restoreAllControlsAsPreset("abc");seems to be more reliable - try substituting those?
-
@Lindon I'll give that a try.
Is it required to use storeAllControlsAsPreset if the preset files already exist?