Custom Display panel questions...
-
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:

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!
-
@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. -
J JamesC has marked this topic as solved
-
@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!
-
J JamesC has marked this topic as unsolved
-
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:

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"); } });