Add GRID visibility knob and fix spectrum/grid rendering

- Add GRID rotary knob (0-1) controlling grid + axis-label brightness/visibility
- Raise analyser ceiling to 0 dBFS; remove overlapping 0/-6 dB lines
- Set plugin minimum width to 800px (and clamp restored width)
- Extend spectrum signal/peak waves to full plot width
- Render signal wave as quadratic spline to match peak smoothness
- Restore 1px gaps in LED mode
This commit is contained in:
Armin 2026-08-14 02:06:05 +02:00
commit b6bdc73488
6 changed files with 52 additions and 14 deletions

View file

@ -13,7 +13,7 @@ BeamgridAudioProcessorEditor::BeamgridAudioProcessorEditor (BeamgridAudioProcess
// reports IPlugView::canResize() == true to the host, which is what FL
// Studio (and other hosts) use to enable their native maximize button.
setResizable (true, true);
setResizeLimits (420, 260, 4000, 4000);
setResizeLimits (800, 260, 4000, 4000);
analyserComponent.setLookAndFeel (&lookAndFeel);
addAndMakeVisible (analyserComponent);
@ -36,6 +36,7 @@ BeamgridAudioProcessorEditor::BeamgridAudioProcessorEditor (BeamgridAudioProcess
setupKnob (modeSlider, "");
setupKnob (ledsSlider, "");
setupKnob (smoothSlider, "");
setupKnob (gridSlider, "");
barsSlider.setNumDecimalPlacesToDisplay (0);
modeSlider.setNumDecimalPlacesToDisplay (0);
ledsSlider.setNumDecimalPlacesToDisplay (0);
@ -80,6 +81,11 @@ BeamgridAudioProcessorEditor::BeamgridAudioProcessorEditor (BeamgridAudioProcess
smoothLabel.setColour (juce::Label::textColourId, juce::Colours::lightgrey);
addAndMakeVisible (smoothLabel);
gridLabel.setText ("GRID", juce::dontSendNotification);
gridLabel.setJustificationType (juce::Justification::centred);
gridLabel.setColour (juce::Label::textColourId, juce::Colours::lightgrey);
addAndMakeVisible (gridLabel);
scaleBox.addItemList (juce::StringArray ("75%", "100%", "150%", "200%", "250%", "300%"), 1);
scaleBox.setSelectedItemIndex (1); // 100%
scaleBox.setColour (juce::ComboBox::backgroundColourId, juce::Colours::black.brighter (0.15f));
@ -127,6 +133,8 @@ BeamgridAudioProcessorEditor::BeamgridAudioProcessorEditor (BeamgridAudioProcess
processorRef.getParametersState(), "leds", ledsSlider);
smoothAttachment = std::make_unique<juce::AudioProcessorValueTreeState::SliderAttachment>(
processorRef.getParametersState(), "smooth", smoothSlider);
gridAttachment = std::make_unique<juce::AudioProcessorValueTreeState::SliderAttachment>(
processorRef.getParametersState(), "grid", gridSlider);
// Set these AFTER the attachments: SliderAttachment installs its own
// textFromValueFunction, so assigning afterwards makes ours take effect.
@ -162,7 +170,7 @@ BeamgridAudioProcessorEditor::BeamgridAudioProcessorEditor (BeamgridAudioProcess
scaleIdx = i;
scaleBox.setSelectedItemIndex (scaleIdx); // triggers onChange -> setScaleFactor
const int storedW = uiState.getProperty ("uiWidth", getWidth());
const int storedW = juce::jmax (800, static_cast<int> (uiState.getProperty ("uiWidth", getWidth())));
const int storedH = uiState.getProperty ("uiHeight", getHeight());
setSize (storedW, storedH);
}
@ -207,7 +215,7 @@ void BeamgridAudioProcessorEditor::resized()
const int margin = 24;
const int gap = 14;
const int count = 8;
const int count = 9;
const int titleW = 220;
// Available width for the knob row (leave room on the right for the title).
@ -227,6 +235,7 @@ void BeamgridAudioProcessorEditor::resized()
{ modeSlider, modeLabel },
{ ledsSlider, ledsLabel },
{ smoothSlider, smoothLabel },
{ gridSlider, gridLabel },
};
const juce::Font labelFont (juce::FontOptions (11.0f));