Skip to content

Commit

Permalink
rename to ParameterPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
shih1 committed Jan 4, 2025
1 parent eace802 commit 6dffd8a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/surge-fx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
};
12 changes: 6 additions & 6 deletions src/surge-fx/SurgeFXEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ SurgefxAudioProcessorEditor::SurgefxAudioProcessorEditor(SurgefxAudioProcessor &
picker = std::make_unique<Picker>(this);
addAndMakeVisibleRecordOrder(picker.get());

defaultKnobLayout = std::make_unique<SurgeFXDefaultEditor>(p);
addAndMakeVisibleRecordOrder(defaultKnobLayout.get());
deafultParameterPanel = std::make_unique<ParameterPanel>(p);
addAndMakeVisibleRecordOrder(deafultParameterPanel.get());

auto backgroundColour = findColour(SurgeLookAndFeel::SurgeColourIds::componentBgStart);
auto surgeOrange = findColour(SurgeLookAndFeel::SurgeColourIds::orange);
Expand Down Expand Up @@ -198,7 +198,7 @@ void SurgefxAudioProcessorEditor::resetLabels()
}
};

defaultKnobLayout->reset();
deafultParameterPanel->reset();
picker->repaint();

int row = 0, col = 0;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -267,7 +267,7 @@ void SurgefxAudioProcessorEditor::resized()
fxNameLabel->setFont(juce::FontOptions(28));
fxNameLabel->setBounds(bottomArea);

defaultKnobLayout->setBounds(bounds);
deafultParameterPanel->setBounds(bounds);
}

int SurgefxAudioProcessorEditor::findLargestFittingZoomBetween(
Expand Down
4 changes: 2 additions & 2 deletions src/surge-fx/SurgeFXEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -58,7 +58,7 @@ class SurgefxAudioProcessorEditor : public juce::AudioProcessorEditor,
};
std::vector<FxMenu> menu;
std::unique_ptr<juce::Component> picker;
std::unique_ptr<SurgeFXDefaultEditor> defaultKnobLayout;
std::unique_ptr<ParameterPanel> deafultParameterPanel;
static constexpr int topSection = 80;

void makeMenu();
Expand Down

0 comments on commit 6dffd8a

Please sign in to comment.