diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 99222368d..2400fc3bc 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -11,7 +11,7 @@ on: workflow_dispatch: env: - EXAMPLE_TARGETS: "ForwardingTestPlugin_Standalone ModalSpringReverb_Standalone SimpleEQ_Standalone StatefulPlugin_Standalone ExampleCompressor_Standalone" + EXAMPLE_TARGETS: "ForwardingTestPlugin_CLAP ModalSpringReverb_CLAP SimpleEQ_CLAP StatefulPlugin_CLAP ExampleCompressor_CLAP" jobs: build_examples: @@ -48,3 +48,9 @@ jobs: - name: "Build Example: ${{ matrix.target }}" shell: bash run: cmake --build build --parallel 4 --target $EXAMPLE_TARGETS + + - name: run clap-validator + uses: jatinchowdhury18/clap-val-action@main + with: + plugin_path: build/plugin_products/SimpleEQ.clap build/plugin_products/StatefulPlugin.clap build/plugin_products/ExampleCompressor.clap + args: --only-failed --hide-output --invert-filter --test-filter "state-*" diff --git a/cmake/test/SetupExamplePlugin.cmake b/cmake/test/SetupExamplePlugin.cmake index 2ba2c2076..e1c7ebc7e 100644 --- a/cmake/test/SetupExamplePlugin.cmake +++ b/cmake/test/SetupExamplePlugin.cmake @@ -40,4 +40,17 @@ function(setup_example_plugin target code) CLAP_PROCESS_EVENTS_RESOLUTION_SAMPLES 64 CLAP_USE_JUCE_PARAMETER_RANGES DISCRETE ) + + get_target_property(output_dir ${target} RUNTIME_OUTPUT_DIRECTORY) + foreach(format AU Standalone VST3 CLAP) + if(TARGET ${target}_${format}) + add_custom_command( + TARGET ${target}_${format} + POST_BUILD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND echo "${target}: Relocating ${format} component" + COMMAND ${CMAKE_COMMAND} -E copy_directory ${output_dir}/${format} ${CMAKE_BINARY_DIR}/plugin_products/ + ) + endif() + endforeach() endfunction(setup_example_plugin) diff --git a/modules/dsp/chowdsp_compressor/Compressor/chowdsp_LevelDetectorImpls.h b/modules/dsp/chowdsp_compressor/Compressor/chowdsp_LevelDetectorImpls.h index 701470780..b95fb2993 100644 --- a/modules/dsp/chowdsp_compressor/Compressor/chowdsp_LevelDetectorImpls.h +++ b/modules/dsp/chowdsp_compressor/Compressor/chowdsp_LevelDetectorImpls.h @@ -69,7 +69,7 @@ struct PeakRtTDetector T* z, T thresholdGain) noexcept { - jassert (inBuffer.getNumChannels() == outBuffer.getNumSamples()); + jassert (inBuffer.getNumChannels() == outBuffer.getNumChannels()); jassert (inBuffer.getNumSamples() == outBuffer.getNumSamples()); for (auto [ch, inData, outData] : buffer_iters::zip_channels (inBuffer, outBuffer)) diff --git a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp index 84acac695..69d5d5703 100644 --- a/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp +++ b/modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp @@ -53,7 +53,16 @@ juce::String timeMsValToString (float timeMsVal) return timeSecStr + " s"; } -float stringToTimeMsVal (const juce::String& s) { return s.getFloatValue(); } +float stringToTimeMsVal (const juce::String& s) +{ + auto timeVal = s.getFloatValue(); + + if (s.endsWith (" s") || s.endsWith (" S") + || s.endsWith (" seconds") || s.endsWith (" Seconds")) + timeVal *= 1000.0f; + + return timeVal; +} juce::String semitonesValToString (float semitonesVal, bool snapToInt) { diff --git a/tests/plugin_tests/chowdsp_parameters_test/ParamStringsTest.cpp b/tests/plugin_tests/chowdsp_parameters_test/ParamStringsTest.cpp index 7dd6e951a..08957b44a 100644 --- a/tests/plugin_tests/chowdsp_parameters_test/ParamStringsTest.cpp +++ b/tests/plugin_tests/chowdsp_parameters_test/ParamStringsTest.cpp @@ -39,6 +39,7 @@ TEST_CASE ("Param Strings Test", "[plugin][parameters]") REQUIRE_MESSAGE (timeMsValToString (10.0f) == juce::String ("10.00 ms"), "Incorrect milliseconds string!"); REQUIRE_MESSAGE (timeMsValToString (2000.0f) == juce::String ("2.00 s"), "Incorrect seconds string!"); REQUIRE_MESSAGE (juce::approximatelyEqual (stringToTimeMsVal ("200 ms"), 200.0f), "Incorrect milliseconds value!"); + REQUIRE_MESSAGE (juce::approximatelyEqual (stringToTimeMsVal ("2.00 s"), 2'000.0f), "Incorrect seconds value!"); } SECTION ("Semitones Param Test")