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

Method BandPanel

Source/Panels/ControlPanel/BandPanel.cpp:15–70  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

13
14//==============================================================================
15BandPanel::BandPanel(FireAudioProcessor& p,
16 std::function<void(ModulatableSlider*)> onModDragStart,
17 std::function<void(ModulatableSlider*)> onModDragMove,
18 std::function<void(ModulatableSlider*)> onModDragEnd,
19 std::function<void(ModulatableSlider*)> onHoverStart,
20 std::function<void(ModulatableSlider*)> onHoverEnd)
21 : PanelBase(p), focusBandNum(0)
22{
23 // Create all UI components using helper methods
24 createSliders();
25 createLabels();
26 createButtons();
27 createComboBoxes(); // Create distortion mode dropdowns
28
29 // Assign callbacks to all modulatable sliders in this panel
30 for (auto& sliderPair : modulatableSliderComponents)
31 {
32 auto* slider = sliderPair.second.get();
33 slider->onModDragStart = onModDragStart;
34 slider->onModDragMove = onModDragMove;
35 slider->onModDragEnd = onModDragEnd;
36 slider->onHoverStart = onHoverStart;
37 slider->onHoverEnd = onHoverEnd;
38 }
39
40 // Add graph components and make them visible
41 addAndMakeVisible(oscilloscope);
42 addAndMakeVisible(distortionGraph);
43 addAndMakeVisible(vuPanel);
44 addAndMakeVisible(widthGraph);
45
46 // Group components for visibility management after they've been created
47 setupComponentGroups();
48
49 // We listen directly to the parameters that affect our "link" logic.
50 for (int i = 0; i < 4; ++i)
51 {
52 processor.treeState.addParameterListener(ParameterIDAndName::getIDString(DRIVE_ID, i), this);
53 processor.treeState.addParameterListener(ParameterIDAndName::getIDString(LINKED_ID, i), this);
54 }
55
56 // Load initial bypass states from the processor's state tree
57 for (int i = 0; i < 4; ++i)
58 {
59 driveBypassTemp[i] = *processor.treeState.getRawParameterValue(ParameterIDAndName::getIDString(DRIVE_BYPASS_ID, i));
60 shapeBypassTemp[i] = *processor.treeState.getRawParameterValue(ParameterIDAndName::getIDString(SHAPE_BYPASS_ID, i));
61 compBypassTemp[i] = *processor.treeState.getRawParameterValue(ParameterIDAndName::getIDString(COMP_BYPASS_ID, i));
62 widthBypassTemp[i] = *processor.treeState.getRawParameterValue(ParameterIDAndName::getIDString(WIDTH_BYPASS_ID, i));
63 }
64
65 // Set initial attachments for band 0 and update knob enabled states
66 setFocusBandNum(0, true);
67
68 // Set initial visibility
69 buttonClicked(&oscSwitch);
70}
71
72BandPanel::~BandPanel()

Callers

nothing calls this directly

Calls 2

getIDStringFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected