Forum

    • Register
    • Login
    • Search
    • Categories

    Preset Label Update

    General Questions
    2
    6
    209
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pasmae
      pasmae last edited by

      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.

      Lindon 1 Reply Last reply Reply Quote 0
      • Lindon
        Lindon @pasmae last edited by

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

        HISE Development for hire.
        www.channelrobot.com

        1 Reply Last reply Reply Quote 0
        • pasmae
          pasmae last edited by

          @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?

          Lindon 1 Reply Last reply Reply Quote 0
          • Lindon
            Lindon @pasmae last edited by

            @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

            HISE Development for hire.
            www.channelrobot.com

            1 Reply Last reply Reply Quote 1
            • pasmae
              pasmae last edited by

              @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);
              
              1 Reply Last reply Reply Quote 0
              • pasmae
                pasmae last edited by

                need help... 😐 🙄

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                15
                Online

                1.1k
                Users

                6.8k
                Topics

                62.4k
                Posts