HISE Logo Forum
    • Categories
    • Register
    • Login

    Is is possible rename the display name on combo box?

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 227 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.
    • T.B.GuangT
      T.B.Guang
      last edited by

      Is is possible rename the display name on combo box?
      My stituation, it display like this: "ROJECT_FOLDER}LargeHall_IR"
      I try to change this but not success :)) Thank for help!

      //masterIRReverb
      const masterIRReverb = Synth.getAudioSampleProcessor("masterIRReverb");
      
      // Pool audio files
      const audioFiles = Engine.loadAudioFilesIntoPool();
      
      // Get a list of irs
          const var irs = [];
      
          for (a in audioFiles)
          {
              if (a.indexOf("ir/")) //Impulse responses will be in ir folder
              {
                  var ir = a.substring(a.indexOf("ir/") + 3, a.lastIndexOf("."));
                  irs.push(ir);
              }
          }
          
      // cmbIR
      const var cmbIR = Content.getComponent("cmbIR");
      cmbIR.set("items", irs.join("\n")); // Populate dropdown
      
      inline function oncmbIRControl(component, value)
          {
              local filename = component.getItemText();
              loadIR(filename);
          };
              
      Content.getComponent("cmbIR").setControlCallback(oncmbIRControl);
      //Load Detail imPulse File//
      inline function loadIR(filename)
      {
      	masterIRReverb.setFile("{PROJECT_FOLDER}LargeHall_IR.wav");
      	masterIRReverb.setFile("{PROJECT_FOLDER}MediumStringHall_IR.wav");
      }
      
      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by

        Put the paths of your IRs into an array. Use the names you want to display as the items for your combo box. In the combo box control callback you can use the value (-1) as the index to the array containing the file paths.

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

        T.B.GuangT 1 Reply Last reply Reply Quote 0
        • T.B.GuangT
          T.B.Guang @d.healey
          last edited by

          @d-healey Thank Bro

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

          35

          Online

          1.7k

          Users

          11.7k

          Topics

          102.0k

          Posts