Change the min/max value of a Slider dynamically


#1

is there a way of changing the min / max value of a slider in runtime?


#2

slider->setRange(newmin, newmax);


#3

thanks! this is from the editor. an option to do this from the processor?


#4

You can get your editor subclass object by casting the editor base class you can get from getActiveEditor() in your AudioProcessor subclass. Things to note, however :

  1. There might not be a GUI editor object to use since plugins must also work without a GUI editor. (getActiveEditor() may return a null pointer.)
  2. You must not call GUI methods directly (such as Slider::setRange) from other threads. (Which certainly will be used in the AudioProcessor methods.) You must somehow arrange things so that the setRange call happens from the GUI thread.

#5

thank you very much!