HISE Logo Forum
    • Categories
    • Register
    • Login

    Preset List Order

    Scheduled Pinned Locked Moved Unsolved General Questions
    9 Posts 3 Posters 300 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.
    • HISEnbergH
      HISEnberg
      last edited by

      Is it possible to customized the order that presets are displayed, within the floating tile preset browser? I know this is fairly easy to do with a customized preset browser but I am using the built in browser in this case. By default the list displays alphabetically, but I want my "Default" setting to be the first one displayed.

      orangeO 1 Reply Last reply Reply Quote 0
      • orangeO
        orange @HISEnberg
        last edited by orange

        @HISEnberg I use the - prefix to ensure that the default preset is listed at the top.

        Screen Shot 2024-10-17 at 17.29.09.png

        develop Branch / XCode 13.1
        macOS Monterey / M1 Max

        HISEnbergH 1 Reply Last reply Reply Quote 0
        • HISEnbergH
          HISEnberg @orange
          last edited by

          @orange Thanks that is a useful trick. I am also trying to organize my list non-alphabetically so this only gets me part of the way there. :)

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @HISEnberg
            last edited by

            @HISEnberg said in Preset List Order:

            Thanks that is a useful trick. I am also trying to organize my list non-alphabetically so this only gets me part of the way there. :)

            It gets you all of the way - you don't have to show the actual name of the file in the preset browser ;)

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            HISEnbergH 1 Reply Last reply Reply Quote 0
            • HISEnbergH
              HISEnberg @d.healey
              last edited by

              @d-healey Ohhhhh clever I think I understand. How do you change the displayed name of the preset? I think you mean if I name my Presets like so:

              1-Default
              2-Preset4
              3-Preset1

              etc.

              And remove the "i-" from the name I can reorder them?

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @HISEnberg
                last edited by

                @HISEnberg said in Preset List Order:

                And remove the "i-" from the name I can reorder them?

                Exactly, you can do this using LAF

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                HISEnbergH 1 Reply Last reply Reply Quote 0
                • HISEnbergH
                  HISEnberg @d.healey
                  last edited by

                  @d-healey Would you recommend the .replace function? I can't figure out a simpler method of doing this

                  inline function cleanPresetName(displayName) {
                      return displayName
                          .replace("1-", "")
                          .replace("2-", "")
                          .replace("3-", "")
                          .replace("4-", "")
                          .replace("5-", "")
                          .replace("6-", "");
                  }
                  
                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @HISEnberg
                    last edited by

                    @HISEnberg Replace is good, if you combine it with substring then you don't need to write it out for each number.

                    const presets = ["1-Default", "2-Preset4", "3-Preset1"];
                    
                    inline function cleanPresetName(name)
                    {
                        return name.replace(name.substring(0, name.indexOf("-") + 1));
                    }
                    
                    Console.print(cleanPresetName(presets[1]));
                    

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    HISEnbergH 1 Reply Last reply Reply Quote 1
                    • HISEnbergH
                      HISEnberg @d.healey
                      last edited by

                      @d-healey Great thank you so much. I think I need a refresher on the String API.

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

                      22

                      Online

                      1.8k

                      Users

                      12.1k

                      Topics

                      105.4k

                      Posts