diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6fcf4d3..12f459a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,6 +48,7 @@ target_sources(ChowMultiTool PRIVATE gui/Brickwall/BrickwallEditor.cpp gui/Brickwall/BrickwallPlot.cpp + gui/Brickwall/BrickwallChyron.cpp gui/Brickwall/BottomBar.cpp gui/AnalogEQ/AnalogEQEditor.cpp diff --git a/src/dsp/EQ/EQProcessor.cpp b/src/dsp/EQ/EQProcessor.cpp index 9f5646f..1405556 100644 --- a/src/dsp/EQ/EQProcessor.cpp +++ b/src/dsp/EQ/EQProcessor.cpp @@ -36,7 +36,6 @@ void EQProcessor::processBlock (const chowdsp::BufferView& buffer) preSpectrumAnalyserTask->processBlockInput (preEqAudioBuffer); } - const auto&& eqParams = getEQParams(); EQToolParams::EQParams::setEQParameters (eq, eqParams); linPhaseEQ.setParameters (eqParams); diff --git a/src/gui/Brickwall/BrickwallChyron.cpp b/src/gui/Brickwall/BrickwallChyron.cpp new file mode 100644 index 0000000..69a0ab0 --- /dev/null +++ b/src/gui/Brickwall/BrickwallChyron.cpp @@ -0,0 +1,32 @@ +#include "BrickwallChyron.h" +#include "gui/Shared/Colours.h" + +namespace gui::brickwall +{ +BrickwallChyron::BrickwallChyron (chowdsp::PluginState& pluginState, + dsp::brickwall::Params& params, + const chowdsp::HostContextProvider& hcp) + : state (pluginState), + cutoffSlider (state, params.cutoff.get(), &hcp) +{ + cutoffSlider.setName ("Cutoff"); + addAndMakeVisible (cutoffSlider); +} + +void BrickwallChyron::resized() +{ + auto bounds = getLocalBounds(); + cutoffSlider.setBounds (bounds.reduced (proportionOfHeight (0.2f))); +} + +void BrickwallChyron::paint (juce::Graphics& g) +{ + const auto bounds = getLocalBounds(); + + g.setColour (juce::Colours::black.withAlpha (0.75f)); + g.fillRoundedRectangle (bounds.toFloat(), 2.5f); + + g.setColour (colours::linesColour); + g.drawRoundedRectangle (bounds.toFloat(), 2.5f, 1.0f); +} +} // namespace gui::brickwall diff --git a/src/gui/Brickwall/BrickwallChyron.h b/src/gui/Brickwall/BrickwallChyron.h new file mode 100644 index 0000000..f482b0a --- /dev/null +++ b/src/gui/Brickwall/BrickwallChyron.h @@ -0,0 +1,28 @@ +#pragma once + +#include "dsp/Brickwall/BrickwallProcessor.h" +#include "gui/Shared/Fonts.h" +#include "gui/Shared/TextSlider.h" + +namespace gui::brickwall +{ +class BrickwallChyron : public juce::Component +{ +public: + BrickwallChyron (chowdsp::PluginState& pluginState, + dsp::brickwall::Params& params, + const chowdsp::HostContextProvider& hcp); + + void resized() override; + void paint (juce::Graphics& g) override; + +private: + chowdsp::PluginState& state; + + TextSlider cutoffSlider; + + SharedFonts fonts; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BrickwallChyron) +}; +} // namespace gui::brickwall diff --git a/src/gui/Brickwall/BrickwallPlot.cpp b/src/gui/Brickwall/BrickwallPlot.cpp index 802457e..2696ca5 100644 --- a/src/gui/Brickwall/BrickwallPlot.cpp +++ b/src/gui/Brickwall/BrickwallPlot.cpp @@ -99,9 +99,11 @@ BrickwallPlot::BrickwallPlot (State& pluginState, dsp::brickwall::Params& brickw .fftOrder = fftOrder, }), brickwall (brickwallParams), - cutoffSlider (*brickwallParams.cutoff, *this, pluginState, hcp) + cutoffSlider (*brickwallParams.cutoff, *this, pluginState, hcp), + chyron (pluginState, brickwallParams, hcp) { addAndMakeVisible (cutoffSlider); + addAndMakeVisible (chyron); brickwall.prepare ({ sampleRate, (uint32_t) blockSize, 1 }); filterPlotter.runFilterCallback = [this] (const float* input, float* output, int numSamples) @@ -162,5 +164,13 @@ void BrickwallPlot::resized() { updatePlot(); cutoffSlider.setBounds (getLocalBounds()); + + const auto pad = proportionOfWidth (0.005f); + const auto chyronWidth = proportionOfWidth (0.15f); + const auto chyronHeight = proportionOfWidth (0.05f); + chyron.setBounds (getWidth() - pad - chyronWidth, + getHeight() - pad - proportionOfHeight (0.075f) - chyronHeight, + chyronWidth, + chyronHeight); } } // namespace gui::brickwall diff --git a/src/gui/Brickwall/BrickwallPlot.h b/src/gui/Brickwall/BrickwallPlot.h index 23da5b6..b955ff1 100644 --- a/src/gui/Brickwall/BrickwallPlot.h +++ b/src/gui/Brickwall/BrickwallPlot.h @@ -1,5 +1,6 @@ #pragma once +#include "BrickwallChyron.h" #include "dsp/Brickwall/BrickwallProcessor.h" #include "state/PluginState.h" @@ -41,6 +42,8 @@ class BrickwallPlot : public chowdsp::SpectrumPlotBase const chowdsp::HostContextProvider& hostContextProvider; } cutoffSlider; + BrickwallChyron chyron; + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BrickwallPlot) }; } // namespace gui::brickwall diff --git a/src/gui/EQ/EQEditor.cpp b/src/gui/EQ/EQEditor.cpp index 4b32477..4f6d9b3 100644 --- a/src/gui/EQ/EQEditor.cpp +++ b/src/gui/EQ/EQEditor.cpp @@ -15,7 +15,7 @@ EQEditor::EQEditor (State& pluginState, dsp::eq::EQToolParams& eqParams, const c drawCheckButton ("Vector/square-check-regular.svg", colours::linesColour, colours::linesColour), drawXButton ("Vector/rectangle-xmark-regular.svg", colours::linesColour, colours::linesColour) { - params.isOpen.store(true); + params.isOpen.store (true); bottomBar = std::make_unique (pluginState, eqParams); @@ -57,7 +57,7 @@ EQEditor::EQEditor (State& pluginState, dsp::eq::EQToolParams& eqParams, const c EQEditor::~EQEditor() { - params.isOpen.store(false); + params.isOpen.store (false); } void EQEditor::paint (juce::Graphics& g) diff --git a/src/gui/Shared/SpectrumAnalyser.cpp b/src/gui/Shared/SpectrumAnalyser.cpp index 8e6a2bc..4694db6 100644 --- a/src/gui/Shared/SpectrumAnalyser.cpp +++ b/src/gui/Shared/SpectrumAnalyser.cpp @@ -24,7 +24,7 @@ void SpectrumAnalyser::paint (juce::Graphics& g) g.strokePath(prePath, juce::PathStrokeType(1)); g.setGradientFill (juce::ColourGradient::vertical (gui::logo::colours::backgroundBlue.withAlpha(0.4f), eqPlot.getYCoordinateForDecibels (0.0f), - gui::logo::colours::backgroundBlue.darker().withAlpha(0.4f), + gui::logo::colours::backgroundBlue.darker().withAlpha (0.4f), (float) getHeight())); g.fillPath (postPath); } diff --git a/src/gui/Shared/SpectrumAnalyserTask.cpp b/src/gui/Shared/SpectrumAnalyserTask.cpp index 1633af6..9d546fa 100644 --- a/src/gui/Shared/SpectrumAnalyserTask.cpp +++ b/src/gui/Shared/SpectrumAnalyserTask.cpp @@ -101,7 +101,7 @@ void SpectrumAnalyserTask::SpectrumAnalyserBackgroundTask::runTask (const juce:: freqSmooth (fftMagsUnsmoothedDB.data(), fftMagsSmoothedDB.data(), fftOutSize, 1.0f / 128.0f); expSmooth (magsPrevious.data(), fftMagsSmoothedDB.data(), fftOutSize, 0.2f); } -} +} // namespace gui // notes for Rachel: // - dynamic range trick is cool! // - tweaked some things re: painting, frequency band smoothing, smoothing across time, and threading stuff diff --git a/src/gui/Shared/SpectrumAnalyserTask.h b/src/gui/Shared/SpectrumAnalyserTask.h index 38b45a3..fa224d3 100644 --- a/src/gui/Shared/SpectrumAnalyserTask.h +++ b/src/gui/Shared/SpectrumAnalyserTask.h @@ -37,4 +37,4 @@ class SpectrumAnalyserTask private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SpectrumAnalyserTask) }; -} \ No newline at end of file +} // namespace gui \ No newline at end of file