Preset Label Update



  • Hello,
    I have a label that shows the current preset name just like shown in the tutorial from @d-healey . Is it possible to update the label to indicate also manual changes on the UI (knobs, sliders, etc)? I'm thinking about adding a * to the preset name or showing "User" instead of the preset name.



  • @pasmae just check that the lavbel text doesnt already contain a * and if not add one...and on preset save remove any *



  • @Lindon How do I check with the script if a preset (the current UI state) was saved? (Still new to scripting... ☺ )
    And I think that solution would only work for the moment that the preset ist saved, after a changing slider or knob value it would still hide the *, or am I wrong?



  • @pasmae said in Preset Label Update:

    @Lindon How do I check with the script if a preset (the current UI state) was saved? (Still new to scripting... ☺ )
    And I think that solution would only work for the moment that the preset ist saved, after a changing slider or knob value it would still hide the *, or am I wrong?

    OK so - user loads a preset - so you show the preset name (lets call it "myCoolPre") in a text label

    • when the user changes any control - in its call back:

    • do whatever the control is supposed to do to the sound

    • read the text in the label

    • does this text contain a "*"?

      • if not then this is an un-modified preset - add a '*' to the front of the Name thus: "*myCoolPre"
      • if yes then this is already a modified preset - dont worry about it.
    • when the user decides to save a preset

      • does the text contain a '*'?
        • if so remove the '*'
      • save the preset


  • @Lindon Ok, so I made two test buttons (I didn't figure out yet how to check the save function in the preset browser...)
    The first one should represent a normal button on the UI, the second one the save function...
    Am I on the right way at least? 😬

    //TEST Update Preset Label
    
    inline function onButton20Control(component, value)
    {
    	var y = PresetNameLbl.get("text");
    	var check = y.indexOf ("*");
    	
    	if (check == -1)
        {
            Content.getComponent("PresetNameLbl").set("text", "Current Preset: "+Engine.getCurrentUserPresetName()+"*");
        }
    };
    
    Content.getComponent("Button20").setControlCallback(onButton20Control);
    
    
    //pretend SAVE function Button
    
    inline function onButton21Control(component, value)
    {
    	if (check > -1)
        {
            Content.getComponent("PresetNameLbl").set("text", "Current Preset: "+Engine.getCurrentUserPresetName());
        }
        
        Engine.saveUserPreset("test");
    };
    
    Content.getComponent("Button21").setControlCallback(onButton21Control);
    


  • need help... 😐 🙄


Log in to reply
 

7
Online

887
Users

3.2k
Topics

26.9k
Posts