HISE Logo Forum
    • Categories
    • Register
    • Login

    new preset browser

    Scheduled Pinned Locked Moved General Questions
    3 Posts 3 Posters 238 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.
    • JayJ
      Jay
      last edited by Jay

      Is there a way of excluding the path of preset and only show the preset name using this?
      example: "nameofpreset.preset"

      Screenshot 2023-07-01 at 11.08.19 PM.png

      // PRESETS ///////////////////////
      const var Presets = Content.getComponent("Presets");
      const var convoLbl = Content.getComponent("convoLbl");

      var menuItems = [];

      const var x = Engine.getUserPresetList();
      for (i in x)
      menuItems.insert(-1, i);

      menuItems = menuItems.join("\n");
      Presets.set("items", menuItems);

      inline function onPresetsControl(component, value)
      {
      Engine.loadUserPreset(Presets.getItemText() + ".preset");
      convoLbl.set("text", Presets.getItemText());
      };
      Content.getComponent("Presets").setControlCallback(onPresetsControl);
      // PRESETS ///////////////////////

      Thanks in advance.......

      Joansi Villalona

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

        @Jay Use the substring, indexof, lastindexof, and replace commands

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

        1 Reply Last reply Reply Quote 0
        • Dan KorneffD
          Dan Korneff
          last edited by

          I made a little function to pull a file name from a url. Maybe something similar might work for you.

          inline function extractFileName(string) {
            local fileName = string.split("/").pop(); // Extract the file name
            return fileName;
          }
          

          Dan Korneff - Producer / Mixer / Audio Nerd

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

          27

          Online

          1.7k

          Users

          11.8k

          Topics

          102.5k

          Posts