Forum
    • Categories
    • Register
    • Login

    Custom Display panel questions...

    Scheduled Pinned Locked Moved Unsolved Scripting
    4 Posts 2 Posters 28 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.
    • J
      JamesC
      last edited by

      Happy holidays all!

      Haven't been able to spend as much time as I would like working on projects and ideas but I was pleased I managed to create a custom preset bar that would display the loaded preset (if you click that text it opens the preset browser, as well as having next and previous buttons) its not the most sophisticated but it works:

      Screenshot 2025-12-18 200257.png

      I know this can be done with a combo box (I've got that set up atm) but in order to keep the UI consistent I'm looking to create essentially the same but that using the buttons will cycle through the various IR files in the folder for the Convolution Reverb.

      Firstly is this possible? Can it be built onto what I've already done with the combo box and then making the combox not visible but behind the scenes? I know I can essentially recycle the look and feel bits and pieces I've done in terms of design its the under the hood bits and pieces that I can't envision in my head.

      As always thanks for your help/responses in advance!

      dannytaurusD J 2 Replies Last reply Reply Quote 0
      • dannytaurusD
        dannytaurus @JamesC
        last edited by

        @JamesC You can adapt the example in the docs:

        https://docs.hise.dev/hise-modules/effects/list/convolution.html#parameters

        Instead of a combo box, use control callbacks on the 2 buttons to call setFile(). You'd put the list of impulse names in an array, then the buttons would load the previous or next impulse.

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

        J 1 Reply Last reply Reply Quote 0
        • J JamesC has marked this topic as solved
        • J
          JamesC @JamesC
          last edited by JamesC

          @JamesC Nice its always the simplest thing here's what I ended up doing in case anyone else needs it and for any general feedback:

          const var ConvolutionReverb1 = Synth.getAudioSampleProcessor("Convolution Reverb1");
          const var irs = Engine.loadAudioFilesIntoPool();
          
          const var rvbnextbtn = Content.getComponent("rvbnextbtn");
          const var rvbprevbtn = Content.getComponent("rvbprevbtn");
          
          // Track current IR
          var currentIRIndex = 0;
          
          ConvolutionReverb1.setFile(irs[currentIRIndex]);
          
          inline function onrvbnextbtnControl(component, value)
          {
              if (value)
              {
                  currentIRIndex++;
          
                  if (currentIRIndex >= irs.length)
                      currentIRIndex = 0; 
          
                  ConvolutionReverb1.setFile(irs[currentIRIndex]);
              }
          }
          
          inline function onrvbprevbtnControl(component, value)
          {
              if (value)
              {
                  currentIRIndex--;
          
                  if (currentIRIndex < 0)
                      currentIRIndex = irs.length - 1; 
          
                  ConvolutionReverb1.setFile(irs[currentIRIndex]);
              }
          }
          
          rvbnextbtn.setControlCallback(onrvbnextbtnControl);
          rvbprevbtn.setControlCallback(onrvbprevbtnControl);
          

          Now all becomes about show the curently loaded file name in the panel!

          1 Reply Last reply Reply Quote 0
          • J JamesC has marked this topic as unsolved
          • J
            JamesC @dannytaurus
            last edited by

            @dannytaurus

            Thanks for that buttons now working as I wanted now working on the text appearing, I can't quite work out what I've missed, currently it displays undefined:

            Screenshot 2025-12-19 054159.png

            This is the current code in respect of the text:

            const var rvbfilename = Content.getComponent("rvbfilename");
            
            inline function onrvbfilenameControl(component, value)
            {
            	local currentReverb = ConvolutionReverb1.getCurrentlyLoadedFile();
            	    if (currentReverb == "")
            	    {
            	        rvbfilename.set("text", currentReverb);
            	    }
            	    else
            	    {
            	        rvbfilename.set("text", currentReverb);
            	    }
            	   rvbfilename.repaint();
            };
            
            Content.getComponent("rvbfilename").setControlCallback(onrvbfilenameControl);
            
            rvbfilename.setPaintRoutine(function(g)
            {
                var a = this.getLocalBounds(0);
                var cornerRadius = 4;
                
            
                // Text color
                if (isContainerOpen || isHovered)
                {
                    g.setColour(0xFFFFFFFF);
                }
                else
                {
                    g.setColour(0xFFFFFFFF);
                }
            
                // IR text
                var textArea = [a[0], a[1], a[2], a[3]];
                g.setFont("font", 20);
                if (currentReverb == "")
                {
                    g.drawAlignedText("Default", textArea, "centred");
                }
                else
                {
                    g.drawAlignedText(currentReverb, textArea, "centred");
                }
            });
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            17

            Online

            2.1k

            Users

            13.1k

            Topics

            113.3k

            Posts