From 92cdb9e033d8d2918253d0f69f89b0ff6d49d573 Mon Sep 17 00:00:00 2001 From: jatin Date: Mon, 6 May 2024 13:06:21 -0700 Subject: [PATCH 1/7] Make use of juce::Font compatible with JUCE-8 --- .../gui/chowdsp_gui/LookAndFeel/chowdsp_ChowLNF.cpp | 12 ++++++++++++ .../PluginComponents/chowdsp_TitleComp.cpp | 4 ++++ .../PluginComponents/chowdsp_TooltipComp.cpp | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/modules/gui/chowdsp_gui/LookAndFeel/chowdsp_ChowLNF.cpp b/modules/gui/chowdsp_gui/LookAndFeel/chowdsp_ChowLNF.cpp index 992a40a38..bb86cf772 100644 --- a/modules/gui/chowdsp_gui/LookAndFeel/chowdsp_ChowLNF.cpp +++ b/modules/gui/chowdsp_gui/LookAndFeel/chowdsp_ChowLNF.cpp @@ -60,7 +60,11 @@ void ChowLNF::drawToggleButton (juce::Graphics& g, juce::ToggleButton& button, b drawTickBox (g, button, 4.0f, ((float) button.getHeight() - tickWidth) * 0.5f, tickWidth, tickWidth, button.getToggleState(), button.isEnabled(), shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown); g.setColour (button.findColour (juce::ToggleButton::textColourId)); +#if JUCE_VERSION < 0x080000 g.setFont (juce::Font (fontSize).boldened()); +#else + g.setFont (juce::Font { juce::FontOptions { fontSize, juce::Font::bold } }); +#endif if (! button.isEnabled()) g.setOpacity (0.5f); @@ -80,7 +84,11 @@ void ChowLNF::positionComboBoxText (juce::ComboBox& box, juce::Label& label) void ChowLNF::createTabTextLayout (const juce::TabBarButton& button, float length, float depth, juce::Colour colour, juce::TextLayout& textLayout) { +#if JUCE_VERSION < 0x080000 juce::Font font (depth * 0.45f, juce::Font::bold); +#else + juce::Font font { juce::FontOptions { depth * 0.45f, juce::Font::bold } }; +#endif font.setUnderline (button.hasKeyboardFocus (false)); juce::AttributedString s; @@ -240,7 +248,11 @@ juce::Label* ChowLNF::createSliderTextBox (juce::Slider& slider) if (style == juce::Slider::LinearHorizontal) l->setJustificationType (juce::Justification::left); +#if JUCE_VERSION < 0x080000 l->setFont ((float) slider.getTextBoxHeight()); +#else + l->setFont (juce::FontOptions { (float) slider.getTextBoxHeight() }); +#endif return l; } diff --git a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp index b6eb209bb..b7117e3ac 100644 --- a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp +++ b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp @@ -10,7 +10,11 @@ TitleComp::TitleComp() void TitleComp::paint (juce::Graphics& g) { +#if JUCE_VERSION < 0x080000 g.setFont (juce::Font (font).boldened()); +#else + g.setFont (juce::Font { juce::FontOptions { font, juce::Font::bold } }); +#endif auto curFont = g.getCurrentFont(); auto b = getLocalBounds(); diff --git a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp index 51d762207..4d4418efd 100644 --- a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp +++ b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp @@ -19,7 +19,11 @@ void TooltipComponent::paint (juce::Graphics& g) { auto b = getLocalBounds(); +#if JUCE_VERSION < 0x080000 g.setFont (juce::Font (17.0f).boldened()); +#else + g.setFont (juce::Font { juce::FontOptions { 17.0f, juce::Font::bold } }); +#endif if (name.isNotEmpty()) { g.setColour (findColour (nameColourID)); From 846491e1ccb045d92307e7bff0116895cdd7aa6a Mon Sep 17 00:00:00 2001 From: jatin Date: Sat, 18 May 2024 12:47:19 -0700 Subject: [PATCH 2/7] Silencing logging warning --- modules/common/chowdsp_logging/chowdsp_logging.h | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/common/chowdsp_logging/chowdsp_logging.h b/modules/common/chowdsp_logging/chowdsp_logging.h index e4e0d2f6c..a7bb72969 100644 --- a/modules/common/chowdsp_logging/chowdsp_logging.h +++ b/modules/common/chowdsp_logging/chowdsp_logging.h @@ -27,6 +27,7 @@ BEGIN_JUCE_MODULE_DECLARATION JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wswitch-enum", "-Wfloat-equal", "-Wextra-semi", + "-Wdeprecated-declarations", "-Wc++20-compat", "-Wlanguage-extension-token") From 3802b9b89dfeded0574a292ee6cac18a2392a3d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Jan 2025 03:29:25 +0000 Subject: [PATCH 3/7] Apply clang-format --- .../ParamUtils/chowdsp_MetricParameter.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h index 682734e17..4210f7c2b 100644 --- a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h +++ b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h @@ -24,12 +24,14 @@ class MetricParameter : public FloatParameter { } - MetricParameter (const ParameterID& parameterID, - const juce::String& paramName, - const juce::NormalisableRange& paramRange, - float defaultValue, - const std::function& valueToTextFunction, - std::function&& textToValueFunction = [] (const juce::String& str) { return fromString (str); }) + MetricParameter ( + const ParameterID& parameterID, + const juce::String& paramName, + const juce::NormalisableRange& paramRange, + float defaultValue, + const std::function& valueToTextFunction, + std::function&& textToValueFunction = [] (const juce::String& str) + { return fromString (str); }) : FloatParameter ( parameterID, paramName, @@ -44,7 +46,6 @@ class MetricParameter : public FloatParameter static float fromString (const juce::String& str); private: - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MetricParameter) }; } // namespace chowdsp From ef2eff39cad794b660386efff2cdd9f9373aef2f Mon Sep 17 00:00:00 2001 From: jatin Date: Wed, 8 Jan 2025 19:47:36 -0800 Subject: [PATCH 4/7] Trying to fix MetricParameter constructor --- .../ParamUtils/chowdsp_MetricParameter.cpp | 36 +++++++++++++++++++ .../ParamUtils/chowdsp_MetricParameter.h | 23 ++---------- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp index 8759244a2..f86a59fcc 100644 --- a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp +++ b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp @@ -2,6 +2,42 @@ namespace chowdsp { +MetricParameter::MetricParameter (const ParameterID& parameterID, + const juce::String& paramName, + const juce::NormalisableRange& paramRange, + float defaultValue, + const juce::String& unitSuffix, + int numDecimalPlaces) + : MetricParameter ( + parameterID, + paramName, + paramRange, + defaultValue, + [numDecimalPlaces, unitSuffix] (float v) + { return toString (v, numDecimalPlaces) + unitSuffix; }) +{ +} + +MetricParameter::MetricParameter ( + const ParameterID& parameterID, + const juce::String& paramName, + const juce::NormalisableRange& paramRange, + float defaultValue, + const std::function& valueToTextFunction, + std::function&& textToValueFunction) + : FloatParameter ( + parameterID, + paramName, + paramRange, + defaultValue, + valueToTextFunction, + textToValueFunction != nullptr + ? std::move (textToValueFunction) + : [] (const juce::String& str) + { return fromString (str); }) +{ +} + juce::String MetricParameter::toString (float value, int numDecimalPlaces) { if (value < 1.0e-9f) // pico diff --git a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h index 4210f7c2b..4503acf64 100644 --- a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h +++ b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.h @@ -13,16 +13,7 @@ class MetricParameter : public FloatParameter const juce::NormalisableRange& paramRange, float defaultValue, const juce::String& unitSuffix = {}, - int numDecimalPlaces = 2) - : MetricParameter ( - parameterID, - paramName, - paramRange, - defaultValue, - [numDecimalPlaces, unitSuffix] (float v) - { return toString (v, numDecimalPlaces) + unitSuffix; }) - { - } + int numDecimalPlaces = 2); MetricParameter ( const ParameterID& parameterID, @@ -30,17 +21,7 @@ class MetricParameter : public FloatParameter const juce::NormalisableRange& paramRange, float defaultValue, const std::function& valueToTextFunction, - std::function&& textToValueFunction = [] (const juce::String& str) - { return fromString (str); }) - : FloatParameter ( - parameterID, - paramName, - paramRange, - defaultValue, - valueToTextFunction, - std::move (textToValueFunction)) - { - } + std::function&& textToValueFunction = nullptr); static juce::String toString (float value, int numDecimalPlaces); static float fromString (const juce::String& str); From d1af55f1ecc00eded3e0ac8f62de6f6c12c45573 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Jan 2025 03:49:55 +0000 Subject: [PATCH 5/7] Apply clang-format --- .../ParamUtils/chowdsp_MetricParameter.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp index f86a59fcc..ead2df414 100644 --- a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp +++ b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_MetricParameter.cpp @@ -9,12 +9,12 @@ MetricParameter::MetricParameter (const ParameterID& parameterID, const juce::String& unitSuffix, int numDecimalPlaces) : MetricParameter ( - parameterID, - paramName, - paramRange, - defaultValue, - [numDecimalPlaces, unitSuffix] (float v) - { return toString (v, numDecimalPlaces) + unitSuffix; }) + parameterID, + paramName, + paramRange, + defaultValue, + [numDecimalPlaces, unitSuffix] (float v) + { return toString (v, numDecimalPlaces) + unitSuffix; }) { } @@ -26,15 +26,15 @@ MetricParameter::MetricParameter ( const std::function& valueToTextFunction, std::function&& textToValueFunction) : FloatParameter ( - parameterID, - paramName, - paramRange, - defaultValue, - valueToTextFunction, - textToValueFunction != nullptr - ? std::move (textToValueFunction) - : [] (const juce::String& str) - { return fromString (str); }) + parameterID, + paramName, + paramRange, + defaultValue, + valueToTextFunction, + textToValueFunction != nullptr + ? std::move (textToValueFunction) + : [] (const juce::String& str) + { return fromString (str); }) { } From de9cc8fa0b85e66d1ea6e4c01391c7fdb8bc745b Mon Sep 17 00:00:00 2001 From: jatin Date: Wed, 8 Jan 2025 22:01:21 -0800 Subject: [PATCH 6/7] CI tweaks --- .github/workflows/examples.yml | 2 +- .github/workflows/run-tests.yml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index aef2ba8ff..a764ba547 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: env: - EXAMPLE_TARGETS: "ForwardingTestPlugin_CLAP ModalSpringReverb_CLAP SimpleEQ_CLAP StatefulPlugin_CLAP ExampleCompressor_CLAP" + EXAMPLE_TARGETS: "ForwardingTestPlugin_CLAP SimpleEQ_CLAP StatefulPlugin_CLAP ExampleCompressor_CLAP" jobs: build_examples: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 835489ca8..798ce2a79 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -23,9 +23,11 @@ jobs: fail-fast: false # show all errors for each platform (vs. cancel jobs on error) matrix: tests: [ - "chowdsp_core_test chowdsp_data_structures_test chowdsp_json_test chowdsp_serialization_test chowdsp_logging_test chowdsp_units_test chowdsp_buffers_test chowdsp_dsp_juce_test", # common_tests_lib + dsp_juce_tests_lib + "chowdsp_core_test chowdsp_data_structures_test chowdsp_json_test chowdsp_serialization_test", # common_tests_lib + "chowdsp_logging_test chowdsp_units_test chowdsp_buffers_test chowdsp_dsp_juce_test", # common_tests_lib + dsp_juce_tests_lib "chowdsp_dsp_data_structures_test chowdsp_dsp_utils_test chowdsp_filters_test chowdsp_math_test chowdsp_modal_dsp_test chowdsp_simd_test chowdsp_sources_test chowdsp_waveshapers_test chowdsp_compressor_test", # dsp_tests_lib - "chowdsp_parameters_test chowdsp_plugin_state_test chowdsp_plugin_base_test chowdsp_plugin_utils_test chowdsp_presets_v2_test chowdsp_version_test chowdsp_fuzzy_search_test", # plugin_tests_lib + "chowdsp_parameters_test chowdsp_plugin_state_test chowdsp_plugin_base_test chowdsp_version_test", # plugin_tests_lib + "chowdsp_plugin_utils_test chowdsp_presets_v2_test chowdsp_fuzzy_search_test", # plugin_tests_lib "chowdsp_gui_test chowdsp_visualizers_test", # gui_tests_lib ] name: [ From 0f38186680000ed4b76dfe05a4c578fdc4ee6c32 Mon Sep 17 00:00:00 2001 From: jatin Date: Wed, 8 Jan 2025 22:14:16 -0800 Subject: [PATCH 7/7] Revert CI tweaks [ci skip] --- .github/workflows/examples.yml | 2 +- .github/workflows/run-tests.yml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index a764ba547..aef2ba8ff 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: env: - EXAMPLE_TARGETS: "ForwardingTestPlugin_CLAP SimpleEQ_CLAP StatefulPlugin_CLAP ExampleCompressor_CLAP" + EXAMPLE_TARGETS: "ForwardingTestPlugin_CLAP ModalSpringReverb_CLAP SimpleEQ_CLAP StatefulPlugin_CLAP ExampleCompressor_CLAP" jobs: build_examples: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 798ce2a79..835489ca8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -23,11 +23,9 @@ jobs: fail-fast: false # show all errors for each platform (vs. cancel jobs on error) matrix: tests: [ - "chowdsp_core_test chowdsp_data_structures_test chowdsp_json_test chowdsp_serialization_test", # common_tests_lib - "chowdsp_logging_test chowdsp_units_test chowdsp_buffers_test chowdsp_dsp_juce_test", # common_tests_lib + dsp_juce_tests_lib + "chowdsp_core_test chowdsp_data_structures_test chowdsp_json_test chowdsp_serialization_test chowdsp_logging_test chowdsp_units_test chowdsp_buffers_test chowdsp_dsp_juce_test", # common_tests_lib + dsp_juce_tests_lib "chowdsp_dsp_data_structures_test chowdsp_dsp_utils_test chowdsp_filters_test chowdsp_math_test chowdsp_modal_dsp_test chowdsp_simd_test chowdsp_sources_test chowdsp_waveshapers_test chowdsp_compressor_test", # dsp_tests_lib - "chowdsp_parameters_test chowdsp_plugin_state_test chowdsp_plugin_base_test chowdsp_version_test", # plugin_tests_lib - "chowdsp_plugin_utils_test chowdsp_presets_v2_test chowdsp_fuzzy_search_test", # plugin_tests_lib + "chowdsp_parameters_test chowdsp_plugin_state_test chowdsp_plugin_base_test chowdsp_plugin_utils_test chowdsp_presets_v2_test chowdsp_version_test chowdsp_fuzzy_search_test", # plugin_tests_lib "chowdsp_gui_test chowdsp_visualizers_test", # gui_tests_lib ] name: [