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

Method FireAudioProcessorEditor

Source/PluginEditor.cpp:17–383  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

15
16//==============================================================================
17FireAudioProcessorEditor::FireAudioProcessorEditor(FireAudioProcessor& p)
18 : AudioProcessorEditor(&p),
19 processor(p),
20 stateComponent { p.stateAB, p.statePresets, p.treeState },
21 // Initialize bandPanel and globalPanel with the popup callbacks
22 bandPanel(p, {}, {}, {}, {}, {}),
23 globalPanel(processor, {}, {}, {}, {}, {}),
24 lfoPanel(p)
25{
26 addAndMakeVisible(valuePopup);
27 valuePopup.setAlwaysOnTop(true);
28 valuePopup.setVisible(false);
29
30 addAndMakeVisible(valueEntryPopup);
31 valueEntryPopup.setAlwaysOnTop(true);
32 valueEntryPopup.setVisible(false);
33
34 valueEntryPopup.onOk = [this](double value)
35 {
36 if (sliderForValueEntry != nullptr)
37 {
38 processor.setModulationValue(sliderForValueEntry->getParamID(), (float) value);
39 }
40
41 valueEntryPopup.setVisible(false);
42 sliderForValueEntry = nullptr;
43 };
44
45 valueEntryPopup.onCancel = [this]()
46 {
47 valueEntryPopup.setVisible(false);
48 sliderForValueEntry = nullptr;
49 };
50
51 processor.addChangeListener(this);
52 // timer
53 juce::Timer::startTimerHz(60.0f);
54
55 lfoPanel.onAssignButtonClicked = [this](int lfoIndex)
56 {
57 if (isLfoAssignMode)
58 {
59 // If already in assignment mode, exit directly.
60 // (The cleanup logic has been moved to a separate function for reusability).
61 exitAssignMode();
62 }
63 else
64 {
65 // --- Enter assignment mode ---
66 isLfoAssignMode = true;
67 lfoSourceForAssignment = lfoIndex;
68 lfoPanel.assignButton.setToggleState(true, juce::dontSendNotification);
69
70 // Define the callback function to be executed when a slider is clicked.
71 auto sliderClickCallback = [this](const juce::String& parameterID)
72 {
73 // This callback now does only one thing: tell the processor to assign the LFO.
74 // It no longer handles any UI state changes.

Callers

nothing calls this directly

Calls 15

setModulationValueMethod · 0.80
lfoDataHasChangedMethod · 0.80
getDriveKnobMethod · 0.80
toggleBipolarModeMethod · 0.80
setModulationDepthMethod · 0.80
resetModulationMethod · 0.80
addListenerMethod · 0.80

Tested by

no test coverage detected