Forum
    • Categories
    • Register
    • Login

    Show default preset name on first launch

    Scheduled Pinned Locked Moved General Questions
    6 Posts 3 Posters 11 Views
    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.
    • dannytaurusD
      dannytaurus
      last edited by dannytaurus

      This is the top bar of my plugin when I open the project in HISE. The default preset 00 INIT loads, sets the knob values and shows the preset browser.

      CleanShot 2026-06-12 at 11.42.35@2x.png

      This is the top bar of my plugin on first launch in a DAW. The default preset 00 INIT loads and sets the knob values, but doesn't show in the preset browser.

      CleanShot 2026-06-12 at 11.41.14@2x.png

      Is this intended behaviour or a bug?

      The preset browser is fully functional - I can load any preset, and the first click of the > icon does show the 00 INIT preset. I'm just surprised it doesn't show on launch.

      If the plugin knows to load the default preset, shouldn't it also know to show the name in the preset browser?

      I expected:

      • on first launch (no DAW session data), the default preset loads and shows in the preset bar
      • on subsequent launch from a saved DAW session, the saved state should load

      Meat Beats: https://meatbeats.com
      Klippr Video: https://klippr.video

      David HealeyD ustkU 2 Replies Last reply Reply Quote 0
      • David HealeyD
        David Healey @dannytaurus
        last edited by David Healey

        @dannytaurus said in Show default preset name on first launch:

        Is this intended behaviour or a bug?

        Depends on your script.

        I use this in mine

        	const uph = Engine.createUserPresetHandler();
        
        	uph.setPostCallback(function(presetFile)
        	{
        		updatePresetLabel(); // Name display handled here
        	});
        

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        dannytaurusD 1 Reply Last reply Reply Quote 2
        • ustkU
          ustk @dannytaurus
          last edited by

          @dannytaurus I've just hit this problem for the 100s time a couple of days ago and it alway melts my brain...

          What I do is to force "init" in the postCallback when the presetFile is undefined, meaning it's init time...

          Another way could be to save the label in preset, but this only brought me more pain down the line

          Hise made me an F5 dude, any other app just suffers...

          dannytaurusD 1 Reply Last reply Reply Quote 1
          • dannytaurusD
            dannytaurus @David Healey
            last edited by

            @David-Healey said in Show default preset name on first launch:

            updatePresetLabel

            What does your updatePresetLabel() look like? Because I have the following already, but it's setting the text to "":

            UserPresetHandler.setPostCallback(function(presetFile)
              {
                  btnShowPresetBrowser.set("text", Engine.getCurrentUserPresetName());
              });
            

            Seems like on first launch, Engine.getCurrentUserPresetName() returns "".

            Meat Beats: https://meatbeats.com
            Klippr Video: https://klippr.video

            David HealeyD 1 Reply Last reply Reply Quote 0
            • David HealeyD
              David Healey @dannytaurus
              last edited by

              @dannytaurus

              	inline function updatePresetLabel(nameOnly: number)
              	{
              		if (!isDefined(currentPresetFile))
              			return;
              
              		local category = currentPresetFile.getParentDirectory().toString(currentPresetFile.NoExtension);
              		local name = currentPresetFile.toString(currentPresetFile.NoExtension);
              
              		if (nameOnly)
              			btnPresetBrowser.set("text", name);
              		else
              			btnPresetBrowser.set("text", category + " | " + name);
              	}
              

              I also call this in the post save callback too.

              Free HISE Bootcamp Full Course for beginners.
              YouTube Channel - Public HISE tutorials
              My Patreon - HISE tutorials

              1 Reply Last reply Reply Quote 1
              • dannytaurusD
                dannytaurus @ustk
                last edited by

                @ustk Good call. Claude suggested I update to this:

                UserPresetHandler.setPostCallback(function(presetFile)
                  {
                      // On first launch the default preset loads with no file (frontend leaves
                      // currentlyLoadedFile empty), so getCurrentUserPresetName() is "". Fall back
                      // to the default preset name. (Editor returns the real name, so it's unaffected.)
                      var name = Engine.getCurrentUserPresetName();
                      btnShowPresetBrowser.set("text", name != "" ? name : "00 INIT");
                  });
                

                I'll try it and make sure it works on first launch, and doesn't interfere with reloading DAW sessions.

                Meat Beats: https://meatbeats.com
                Klippr Video: https://klippr.video

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

                22

                Online

                2.4k

                Users

                13.8k

                Topics

                119.8k

                Posts