MCPcopy Create free account
hub / github.com/jerryuhoo/Fire / createAndConfigureSlider

Method createAndConfigureSlider

Source/Panels/ControlPanel/PanelBase.cpp:18–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void 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
44void PanelBase::initRotarySlider(juce::Slider& slider, juce::Colour colour)
45{

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
setLabelMethod · 0.80

Tested by

no test coverage detected