Skip to content

Commit 669ccee

Browse files
committed
compiles but segfauts on setStyle
1 parent 6dffd8a commit 669ccee

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/surge-fx/ParameterPanel.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#include "ParameterPanel.h"
22

3-
ParameterPanel::ParameterPanel(SurgefxAudioProcessor &p) : processor(p)
3+
ParameterPanel::ParameterPanel(SurgefxAudioProcessor &p,
4+
std::shared_ptr<sst::jucegui::style::StyleSheet> styleSheet)
5+
: processor(p),
6+
sst::jucegui::style::StyleConsumer(sst::jucegui::components::Knob::Styles::styleClass)
7+
48
{
59

10+
setStyle(styleSheet);
11+
612
for (int i = 0; i < n_fx_params; ++i)
713
{
814
auto knob = std::make_unique<sst::jucegui::components::Knob>();

src/surge-fx/ParameterPanel.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919

2020
#include "juce_audio_processors/juce_audio_processors.h"
2121

22-
class ParameterPanel : public juce::Component
22+
class ParameterPanel : public juce::Component, sst::jucegui::style::StyleConsumer
2323
{
2424
public:
25-
ParameterPanel(SurgefxAudioProcessor &);
25+
ParameterPanel(SurgefxAudioProcessor &,
26+
std::shared_ptr<sst::jucegui::style::StyleSheet> styleSheet);
2627

2728
~ParameterPanel() override;
2829

src/surge-fx/SurgeFXEditor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ SurgefxAudioProcessorEditor::SurgefxAudioProcessorEditor(SurgefxAudioProcessor &
138138
picker = std::make_unique<Picker>(this);
139139
addAndMakeVisibleRecordOrder(picker.get());
140140

141-
deafultParameterPanel = std::make_unique<ParameterPanel>(p);
141+
deafultParameterPanel = std::make_unique<ParameterPanel>(p, styleSheet);
142142
addAndMakeVisibleRecordOrder(deafultParameterPanel.get());
143143

144144
auto backgroundColour = findColour(SurgeLookAndFeel::SurgeColourIds::componentBgStart);
@@ -256,7 +256,6 @@ void SurgefxAudioProcessorEditor::resized()
256256
auto bounds = getLocalBounds();
257257
int topAreaHeight =
258258
static_cast<int>((static_cast<float>(topSection) / baseHeight) * getHeight());
259-
std::cout << topAreaHeight << std::endl;
260259
int bottomAreaHeight = static_cast<int>((static_cast<float>(40) / baseHeight) * getHeight());
261260

262261
auto topArea = bounds.removeFromTop(topAreaHeight);

0 commit comments

Comments
 (0)