diff --git a/src/surge-fx/CMakeLists.txt b/src/surge-fx/CMakeLists.txt index 3104204dbf7..547c773f3a7 100644 --- a/src/surge-fx/CMakeLists.txt +++ b/src/surge-fx/CMakeLists.txt @@ -58,7 +58,7 @@ target_sources(${PROJECT_NAME} PRIVATE SurgeFXEditor.cpp SurgeFXEditor.h SurgeFXProcessor.cpp - SurgeFXDefaultEditor.cpp + ParameterPanel.cpp SurgeFXProcessor.h SurgeLookAndFeel.h FXOpenSoundControl.cpp diff --git a/src/surge-fx/SurgeFXDefaultEditor.cpp b/src/surge-fx/ParameterPanel.cpp similarity index 96% rename from src/surge-fx/SurgeFXDefaultEditor.cpp rename to src/surge-fx/ParameterPanel.cpp index bfce354bdd4..4949358929a 100644 --- a/src/surge-fx/SurgeFXDefaultEditor.cpp +++ b/src/surge-fx/ParameterPanel.cpp @@ -1,6 +1,6 @@ -#include "SurgeFXDefaultEditor.h" +#include "ParameterPanel.h" -SurgeFXDefaultEditor::SurgeFXDefaultEditor(SurgefxAudioProcessor &p) : processor(p) +ParameterPanel::ParameterPanel(SurgefxAudioProcessor &p) : processor(p) { for (int i = 0; i < n_fx_params; ++i) @@ -101,11 +101,11 @@ SurgeFXDefaultEditor::SurgeFXDefaultEditor(SurgefxAudioProcessor &p) : processor } } -SurgeFXDefaultEditor::~SurgeFXDefaultEditor() {} +ParameterPanel::~ParameterPanel() {} -void SurgeFXDefaultEditor::paint(juce::Graphics &g) { g.fillAll(juce::Colours::darkgrey); } +void ParameterPanel::paint(juce::Graphics &g) { g.fillAll(juce::Colours::darkgrey); } -void SurgeFXDefaultEditor::reset() +void ParameterPanel::reset() { knobs.clear(); sources.clear(); @@ -171,7 +171,7 @@ void SurgeFXDefaultEditor::reset() st(fxDeactivated[i], name + " Deactivated"); } } -void SurgeFXDefaultEditor::resized() +void ParameterPanel::resized() { int ypos0 = topSection - 5; int rowHeight = (getHeight() - topSection - 40 - 10) / 6.0; diff --git a/src/surge-fx/SurgeFXDefaultEditor.h b/src/surge-fx/ParameterPanel.h similarity index 85% rename from src/surge-fx/SurgeFXDefaultEditor.h rename to src/surge-fx/ParameterPanel.h index 2aba93d907a..29ae75029d1 100644 --- a/src/surge-fx/SurgeFXDefaultEditor.h +++ b/src/surge-fx/ParameterPanel.h @@ -19,12 +19,12 @@ #include "juce_audio_processors/juce_audio_processors.h" -class SurgeFXDefaultEditor : public juce::Component +class ParameterPanel : public juce::Component { public: - SurgeFXDefaultEditor(SurgefxAudioProcessor &); + ParameterPanel(SurgefxAudioProcessor &); - ~SurgeFXDefaultEditor() override; + ~ParameterPanel() override; void paint(juce::Graphics &) override; void resized() override; @@ -49,5 +49,5 @@ class SurgeFXDefaultEditor : public juce::Component juce::Font projectFont; - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SurgeFXDefaultEditor); + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ParameterPanel); }; diff --git a/src/surge-fx/SurgeFXEditor.cpp b/src/surge-fx/SurgeFXEditor.cpp index 09335ef751b..aacea7d68d2 100644 --- a/src/surge-fx/SurgeFXEditor.cpp +++ b/src/surge-fx/SurgeFXEditor.cpp @@ -138,8 +138,8 @@ SurgefxAudioProcessorEditor::SurgefxAudioProcessorEditor(SurgefxAudioProcessor & picker = std::make_unique(this); addAndMakeVisibleRecordOrder(picker.get()); - defaultKnobLayout = std::make_unique(p); - addAndMakeVisibleRecordOrder(defaultKnobLayout.get()); + deafultParameterPanel = std::make_unique(p); + addAndMakeVisibleRecordOrder(deafultParameterPanel.get()); auto backgroundColour = findColour(SurgeLookAndFeel::SurgeColourIds::componentBgStart); auto surgeOrange = findColour(SurgeLookAndFeel::SurgeColourIds::orange); @@ -198,7 +198,7 @@ void SurgefxAudioProcessorEditor::resetLabels() } }; - defaultKnobLayout->reset(); + deafultParameterPanel->reset(); picker->repaint(); int row = 0, col = 0; @@ -230,8 +230,8 @@ void SurgefxAudioProcessorEditor::paramsChangedCallback() { if (i < n_fx_params) { - defaultKnobLayout->sources.at(i)->setValueFromModel(fv[i]); - defaultKnobLayout->fxParamDisplay[i].setDisplay( + deafultParameterPanel->sources.at(i)->setValueFromModel(fv[i]); + deafultParameterPanel->fxParamDisplay[i].setDisplay( processor.getParamValueFor(i, fv[i])); } else @@ -267,7 +267,7 @@ void SurgefxAudioProcessorEditor::resized() fxNameLabel->setFont(juce::FontOptions(28)); fxNameLabel->setBounds(bottomArea); - defaultKnobLayout->setBounds(bounds); + deafultParameterPanel->setBounds(bounds); } int SurgefxAudioProcessorEditor::findLargestFittingZoomBetween( diff --git a/src/surge-fx/SurgeFXEditor.h b/src/surge-fx/SurgeFXEditor.h index 0021797528d..328055997bd 100644 --- a/src/surge-fx/SurgeFXEditor.h +++ b/src/surge-fx/SurgeFXEditor.h @@ -24,7 +24,7 @@ #define SURGE_SRC_SURGE_FX_SURGEFXEDITOR_H #include "SurgeFXProcessor.h" -#include "SurgeFXDefaultEditor.h" +#include "ParameterPanel.h" #include "SurgeLookAndFeel.h" #include "KnobSource.h" @@ -58,7 +58,7 @@ class SurgefxAudioProcessorEditor : public juce::AudioProcessorEditor, }; std::vector menu; std::unique_ptr picker; - std::unique_ptr defaultKnobLayout; + std::unique_ptr deafultParameterPanel; static constexpr int topSection = 80; void makeMenu();