| 16 | } |
| 17 | |
| 18 | void PanelBase::createAndConfigureSlider(const juce::String& paramName, |
| 19 | const juce::String& labelText, |
| 20 | juce::Colour sliderColour, |
| 21 | const juce::String& suffix) |
| 22 | { |
| 23 | // Create the slider instance and store it in the map. |
| 24 | modulatableSliderComponents[paramName] = std::make_unique<ModulatableSlider>(); |
| 25 | auto* slider = modulatableSliderComponents.at(paramName).get(); |
| 26 | |
| 27 | // Configure its appearance. |
| 28 | initRotarySlider(*slider, sliderColour); |
| 29 | |
| 30 | // Set the label text which the ModulatableSlider will draw itself. |
| 31 | slider->setLabel(labelText, sliderColour.withBrightness(0.9f)); |
| 32 | |
| 33 | // Set the value suffix if one is provided. |
| 34 | if (suffix.isNotEmpty()) |
| 35 | slider->setTextValueSuffix(suffix); |
| 36 | |
| 37 | // Setup modulation-related callbacks for the slider. |
| 38 | setupModulationCallbacks(*slider); |
| 39 | |
| 40 | // Add the raw pointer to our non-owning vector for easy access by the editor. |
| 41 | modulatableSliders.push_back(slider); |
| 42 | } |
| 43 | |
| 44 | void PanelBase::initRotarySlider(juce::Slider& slider, juce::Colour colour) |
| 45 | { |