diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index a62b393..f8eefb6 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,9 +3,9 @@ { "name": "GCC 11.4.0 x86_64-linux-gnu", "includePath": [ - "${workspaceFolder}/modules/**", + "${workspaceFolder}/Modules/**", "${workspaceFolder}/JuceLibraryCode/**", - "${workspaceFolder}/include/**", + "${workspaceFolder}/Sources/**", ], "defines": [], "compilerPath": "/usr/bin/gcc", diff --git a/CMakeLists.txt b/CMakeLists.txt index e6c396e..1218bb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,15 @@ cmake_minimum_required (VERSION 3.22...3.29 FATAL_ERROR) list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/share/cmake/Modules") +if (NOT DEFINED CMAKE_CONFIGURATION_TYPES) + set (CMAKE_CONFIGURATION_TYPES "") + list (APPEND CMAKE_CONFIGURATION_TYPES "Debug" "Release") +endif () + +if (NOT DEFINED CMAKE_BUILD_TYPE) + set (CMAKE_BUILD_TYPE "Debug") +endif () + include (GetGitRevListCount) get_git_rev_list_count () @@ -118,6 +127,12 @@ foreach (STONEYDSP_BIQUADS_UNIT_FILE IN LISTS STONEYDSP_BIQUADS_UNIT_FILES) add_library (${STONEYDSP_BIQUADS_UNIT_FILE} INTERFACE) add_library (StoneyDSP::Biquads::${STONEYDSP_BIQUADS_UNIT_FILE} ALIAS ${STONEYDSP_BIQUADS_UNIT_FILE}) + # target_include_directories (${STONEYDSP_BIQUADS_UNIT_FILE} + # INTERFACE + # $ + # $ + # ) + if (CMAKE_MAJOR_VERSION GREATER_EQUAL 3 AND (CMAKE_MINOR_VERSION LESS 23)) target_include_directories (${STONEYDSP_BIQUADS_UNIT_FILE} diff --git a/Sources/Biquads.hpp b/Sources/Biquads.hpp index 40c2b88..7b9aaad 100644 --- a/Sources/Biquads.hpp +++ b/Sources/Biquads.hpp @@ -105,7 +105,7 @@ template struct Polar; /// @} group StoneyDSP } // namespace StoneyDSP -#include "Parameters/Parameters.hpp" -#include "Wrapper/Wrapper.hpp" -#include "Processor/Processor.hpp" -#include "Editor/Editor.hpp" +// #include "Parameters/Parameters.hpp" +// #include "Wrapper/Wrapper.hpp" +// #include "Processor/Processor.hpp" +// #include "Editor/Editor.hpp" diff --git a/Sources/Editor/Editor.hpp b/Sources/Editor/Editor.hpp index ef60653..210db6a 100644 --- a/Sources/Editor/Editor.hpp +++ b/Sources/Editor/Editor.hpp @@ -25,23 +25,23 @@ #pragma once #define STONEYDSP_BIQUADS_EDITOR_HPP_INCLUDED -#ifndef STONEYDSP_BIQUADS_HPP_INCLUDED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -// #include +#include "../Biquads.hpp" + +// #ifndef STONEYDSP_BIQUADS_HPP_INCLUDED +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #endif namespace StoneyDSP { /** @addtogroup StoneyDSP @{ */ diff --git a/Sources/Parameters/Parameters.hpp b/Sources/Parameters/Parameters.hpp index 8b2fc18..59a8a9f 100644 --- a/Sources/Parameters/Parameters.hpp +++ b/Sources/Parameters/Parameters.hpp @@ -25,18 +25,18 @@ #pragma once #define STONEYDSP_BIQUADS_PARAMETERS_HPP_INCLUDED -#ifndef STONEYDSP_BIQUADS_HPP_INCLUDED -#include // depends: juce_core -#include // depends: juce_gui_extra, juce_audio_basics -#include // -#include // depends: juce_events -#include // depends: juce_core -#include // depends: juce_events -#include // depends: juce_graphics, juce_data_structures -#include // depends: juce_gui_basics -#endif // STONEYDSP_BIQUADS_HPP_INCLUDED - -// #include +#include "../Biquads.hpp" + +// #ifndef STONEYDSP_BIQUADS_HPP_INCLUDED +// #include // depends: juce_core +// #include // depends: juce_gui_extra, juce_audio_basics +// #include // +// #include // depends: juce_events +// #include // depends: juce_core +// #include // depends: juce_events +// #include // depends: juce_graphics, juce_data_structures +// #include // depends: juce_gui_basics +// #endif // STONEYDSP_BIQUADS_HPP_INCLUDED namespace StoneyDSP { /** @addtogroup StoneyDSP @{ */ diff --git a/Sources/Processor/Processor.hpp b/Sources/Processor/Processor.hpp index 39b884d..3053d8d 100644 --- a/Sources/Processor/Processor.hpp +++ b/Sources/Processor/Processor.hpp @@ -25,25 +25,25 @@ #pragma once #define STONEYDSP_BIQUADS_PROCESSOR_HPP_INCLUDED -#ifndef STONEYDSP_BIQUADS_HPP_INCLUDED -#include // depends: juce_core -#include // depends: juce_audio_basics -#include // depends: juce_gui_extra, juce_audio_basics -#include // -#include // depends: juce_events -#include // depends: juce_audio_formats -#include // depends: juce_core -#include // depends: juce_events -#include // depends: juce_graphics, juce_data_structures -#include // depends: juce_gui_basics +#include "../Biquads.hpp" +#include "../Parameters/Parameters.hpp" +#include "../Wrapper/Wrapper.hpp" -#include -#include -#endif // STONEYDSP_BIQUADS_HPP_INCLUDED +// #ifndef STONEYDSP_BIQUADS_HPP_INCLUDED +// #include // depends: juce_core +// #include // depends: juce_audio_basics +// #include // depends: juce_gui_extra, juce_audio_basics +// #include // +// #include // depends: juce_events +// #include // depends: juce_audio_formats +// #include // depends: juce_core +// #include // depends: juce_events +// #include // depends: juce_graphics, juce_data_structures +// #include // depends: juce_gui_basics -// #include -// #include -// #include +// #include +// #include +// #endif // STONEYDSP_BIQUADS_HPP_INCLUDED // #include "Biquads.hpp" // #include "Parameters.hpp" diff --git a/Sources/Wrapper/Wrapper.cpp b/Sources/Wrapper/Wrapper.cpp index fcbd967..706d11e 100644 --- a/Sources/Wrapper/Wrapper.cpp +++ b/Sources/Wrapper/Wrapper.cpp @@ -44,54 +44,50 @@ AudioPluginAudioProcessorWrapper::AudioPluginAudioProcessorWrapper(A , biquadArraySize(static_cast(4)) // cannot ‘dynamic_cast’ this - target type is not pointer or reference... -, masterBypassPtr(static_cast (apvts.getParameter("Master_bypassID"))) -, masterOutputPtr(static_cast (apvts.getParameter("Master_outputID"))) -, masterMixPtr(static_cast (apvts.getParameter("Master_mixID"))) -, masterOsPtr(static_cast (apvts.getParameter("Master_osID"))) -, masterTransformPtr(static_cast (apvts.getParameter("Master_transformID"))) +, masterBypassPtr(dynamic_cast (apvts.getParameter("Master_bypassID"))) +, masterOutputPtr(dynamic_cast (apvts.getParameter("Master_outputID"))) +, masterMixPtr(dynamic_cast (apvts.getParameter("Master_mixID"))) +, masterOsPtr(dynamic_cast (apvts.getParameter("Master_osID"))) +, masterTransformPtr(dynamic_cast (apvts.getParameter("Master_transformID"))) + +// , biquadsABypassPtr(dynamic_cast (apvts.getParameter("Band_A_bypassID"))) +// , biquadsAFrequencyPtr(dynamic_cast (apvts.getParameter("Band_A_frequencyID"))) +// , biquadsAResonancePtr(dynamic_cast (apvts.getParameter("Band_A_resonanceID"))) +// , biquadsAGainPtr(dynamic_cast (apvts.getParameter("Band_A_gainID"))) +// , biquadsATypePtr(dynamic_cast (apvts.getParameter("Band_A_typeID"))) + +// , biquadsBBypassPtr(dynamic_cast (apvts.getParameter("Band_B_bypassID"))) +// , biquadsBFrequencyPtr(dynamic_cast (apvts.getParameter("Band_B_frequencyID"))) +// , biquadsBResonancePtr(dynamic_cast (apvts.getParameter("Band_B_resonanceID"))) +// , biquadsBGainPtr(dynamic_cast (apvts.getParameter("Band_B_gainID"))) +// , biquadsBTypePtr(dynamic_cast (apvts.getParameter("Band_B_typeID"))) + +// , biquadsCBypassPtr(dynamic_cast (apvts.getParameter("Band_C_bypassID"))) +// , biquadsCFrequencyPtr(dynamic_cast (apvts.getParameter("Band_C_frequencyID"))) +// , biquadsCResonancePtr(dynamic_cast (apvts.getParameter("Band_C_resonanceID"))) +// , biquadsCGainPtr(dynamic_cast (apvts.getParameter("Band_C_gainID"))) +// , biquadsCTypePtr(dynamic_cast (apvts.getParameter("Band_C_typeID"))) + +// , biquadsDBypassPtr(dynamic_cast (apvts.getParameter("Band_D_bypassID"))) +// , biquadsDFrequencyPtr(dynamic_cast (apvts.getParameter("Band_D_frequencyID"))) +// , biquadsDResonancePtr(dynamic_cast (apvts.getParameter("Band_D_resonanceID"))) +// , biquadsDGainPtr(dynamic_cast (apvts.getParameter("Band_D_gainID"))) +// , biquadsDTypePtr(dynamic_cast (apvts.getParameter("Band_D_typeID"))) + +, bypassState(dynamic_cast (apvts.getParameter("Master_bypassID"))) -, bypassState(static_cast (apvts.getParameter("Master_bypassID"))) , biquadsBypassPtrArray() , biquadsFrequencyPtrArray() , biquadsResonancePtrArray() , biquadsGainPtrArray() , biquadsFilterTypePtrArray() -// , biquadsBypassPtrArray -// { -// dynamic_cast (apvts.getParameter("Band_A_bypassID")) -// , dynamic_cast (apvts.getParameter("Band_B_bypassID")) -// , dynamic_cast (apvts.getParameter("Band_C_bypassID")) -// , dynamic_cast (apvts.getParameter("Band_D_bypassID")) -// } -// , biquadsFrequencyPtrArray -// { -// dynamic_cast (apvts.getParameter("Band_A_frequencyID")) -// , dynamic_cast (apvts.getParameter("Band_B_frequencyID")) -// , dynamic_cast (apvts.getParameter("Band_C_frequencyID")) -// , dynamic_cast (apvts.getParameter("Band_D_frequencyID")) -// } -// , biquadsResonancePtrArray -// { -// dynamic_cast (apvts.getParameter("Band_A_resonanceID")) -// , dynamic_cast (apvts.getParameter("Band_B_resonanceID")) -// , dynamic_cast (apvts.getParameter("Band_C_resonanceID")) -// , dynamic_cast (apvts.getParameter("Band_D_resonanceID")) -// } -// , biquadsGainPtrArray -// { -// dynamic_cast (apvts.getParameter("Band_A_gainID")) -// , dynamic_cast (apvts.getParameter("Band_B_gainID")) -// , dynamic_cast (apvts.getParameter("Band_C_gainID")) -// , dynamic_cast (apvts.getParameter("Band_D_gainID")) -// } - { - masterBypassPtr = static_cast (apvts.getParameter("Master_bypassID")); - masterOutputPtr = static_cast (apvts.getParameter("Master_outputID")); - masterMixPtr = static_cast (apvts.getParameter("Master_mixID")); - masterOsPtr = static_cast (apvts.getParameter("Master_osID")); - masterTransformPtr = static_cast (apvts.getParameter("Master_transformID")); + masterBypassPtr = dynamic_cast (apvts.getParameter("Master_bypassID")); + masterOutputPtr = dynamic_cast (apvts.getParameter("Master_outputID")); + masterMixPtr = dynamic_cast (apvts.getParameter("Master_mixID")); + masterOsPtr = dynamic_cast (apvts.getParameter("Master_osID")); + masterTransformPtr = dynamic_cast (apvts.getParameter("Master_transformID")); // biquadsABypassPtr = dynamic_cast (apvts.getParameter("Band_A_bypassID")); // biquadsAFrequencyPtr = dynamic_cast (apvts.getParameter("Band_A_frequencyID")); @@ -119,45 +115,6 @@ AudioPluginAudioProcessorWrapper::AudioPluginAudioProcessorWrapper(A bypassState = dynamic_cast (apvts.getParameter("Master_bypassID")); - // biquadsBypassPtrArray = - // { - // dynamic_cast (apvts.getParameter("Band_A_bypassID")) - // , dynamic_cast (apvts.getParameter("Band_B_bypassID")) - // , dynamic_cast (apvts.getParameter("Band_C_bypassID")) - // , dynamic_cast (apvts.getParameter("Band_D_bypassID")) - // }; - - // biquadsFrequencyPtrArray = - // { - // dynamic_cast (apvts.getParameter("Band_A_frequencyID")) - // , dynamic_cast (apvts.getParameter("Band_B_frequencyID")) - // , dynamic_cast (apvts.getParameter("Band_C_frequencyID")) - // , dynamic_cast (apvts.getParameter("Band_D_frequencyID")) - // }; - - // biquadsResonancePtrArray = - // { - // dynamic_cast (apvts.getParameter("Band_A_resonanceID")) - // , dynamic_cast (apvts.getParameter("Band_B_resonanceID")) - // , dynamic_cast (apvts.getParameter("Band_C_resonanceID")) - // , dynamic_cast (apvts.getParameter("Band_D_resonanceID")) - // }; - - // biquadsGainPtrArray = - // { - // dynamic_cast (apvts.getParameter("Band_A_gainID")) - // , dynamic_cast (apvts.getParameter("Band_B_gainID")) - // , dynamic_cast (apvts.getParameter("Band_C_gainID")) - // , dynamic_cast (apvts.getParameter("Band_D_gainID")) - // }; - // biquadsFilterTypePtrArray = - // { - // dynamic_cast (apvts.getParameter("Band_A_typeID")) - // , dynamic_cast (apvts.getParameter("Band_A_typeID")) - // , dynamic_cast (apvts.getParameter("Band_A_typeID")) - // , dynamic_cast (apvts.getParameter("Band_A_typeID")) - // }; - jassert(masterBypassPtr != nullptr); jassert(masterOutputPtr != nullptr); jassert(masterMixPtr != nullptr); @@ -190,12 +147,6 @@ AudioPluginAudioProcessorWrapper::AudioPluginAudioProcessorWrapper(A jassert(bypassState != nullptr); - // jassert(biquadsBypassPtrArray != nullptr); - // jassert(biquadsFrequencyPtrArray != nullptr); - // jassert(biquadsResonancePtrArray != nullptr); - // jassert(biquadsGainPtrArray != nullptr); - // jassert(biquadsFilterTypePtrArray != nullptr); - jassert(biquadArraySize != static_cast(0)); // auto osFilter = juce::dsp::Oversampling::filterHalfBandFIREquiripple; @@ -390,21 +341,28 @@ void AudioPluginAudioProcessorWrapper::update() mixer->setWetMixProportion(static_cast (0.01f * masterMixPtr->get())); for(auto& biquad : biquadArray) - { biquad->setTransformType(static_cast (masterTransformPtr->getIndex())); - for(auto& biquadsFrequencyPtr : biquadsFrequencyPtrArray) - biquad->setFrequency(static_cast(biquadsFrequencyPtr->get())); + for(std::size_t i = static_cast(0); i < biquadArraySize; ++i) + { + biquadArray[i]->setFrequency(static_cast(biquadsFrequencyPtrArray[i]->get())); + biquadArray[i]->setResonance(static_cast(biquadsResonancePtrArray[i]->get())); + biquadArray[i]->setGain(static_cast(biquadsGainPtrArray[i]->get())); + biquadArray[i]->setFilterType(static_cast(biquadsFilterTypePtrArray[i]->getIndex())); + } + + // for(auto& biquadsFrequencyPtr : biquadsFrequencyPtrArray) + // biquad->setFrequency(static_cast(biquadsFrequencyPtr->get())); - for(auto& biquadsResonancePtr : biquadsResonancePtrArray) - biquad->setFrequency(static_cast(biquadsResonancePtr->get())); + // for(auto& biquadsResonancePtr : biquadsResonancePtrArray) + // biquad->setResonance(static_cast(biquadsResonancePtr->get())); - for(auto& biquadsGainPtr : biquadsGainPtrArray) - biquad->setGain(static_cast(biquadsGainPtr->get())); + // for(auto& biquadsGainPtr : biquadsGainPtrArray) + // biquad->setGain(static_cast(biquadsGainPtr->get())); + + // for(auto& biquadsTypePtr : biquadsFilterTypePtrArray) + // biquad->setFilterType(static_cast(biquadsTypePtr->getIndex())); - for(auto& biquadsTypePtr : biquadsFilterTypePtrArray) - biquad->setFilterType(static_cast(biquadsTypePtr->getIndex())); - } // biquadArray[0]->setFrequency (static_cast (biquadsAFrequencyPtr->get())); // biquadArray[0]->setResonance (static_cast (biquadsAResonancePtr->get())); diff --git a/Sources/Wrapper/Wrapper.hpp b/Sources/Wrapper/Wrapper.hpp index 90935e3..41aef3f 100644 --- a/Sources/Wrapper/Wrapper.hpp +++ b/Sources/Wrapper/Wrapper.hpp @@ -25,23 +25,23 @@ #pragma once #define STONEYDSP_BIQUADS_WRAPPER_HPP_INCLUDED -#ifndef STONEYDSP_BIQUADS_HPP_INCLUDED -#include // depends: juce_core -#include // depends: juce_audio_basics -#include // depends: juce_gui_extra, juce_audio_basics -#include // -#include // depends: juce_events -#include // depends: juce_audio_formats -#include // depends: juce_core -#include // depends: juce_events -#include // depends: juce_graphics, juce_data_structures -#include // depends: juce_gui_basics - -#include -#include -#endif // STONEYDSP_BIQUADS_HPP_INCLUDED - -// #include +#include "../Biquads.hpp" + +// #ifndef STONEYDSP_BIQUADS_HPP_INCLUDED +// #include // depends: juce_core +// #include // depends: juce_audio_basics +// #include // depends: juce_gui_extra, juce_audio_basics +// #include // +// #include // depends: juce_events +// #include // depends: juce_audio_formats +// #include // depends: juce_core +// #include // depends: juce_events +// #include // depends: juce_graphics, juce_data_structures +// #include // depends: juce_gui_basics + +// #include +// #include +// #endif // STONEYDSP_BIQUADS_HPP_INCLUDED namespace StoneyDSP { /** @addtogroup StoneyDSP @{ */ @@ -177,11 +177,11 @@ class AudioPluginAudioProcessorWrapper //========================================================================== /** Parameter pointers. */ - juce::AudioParameterBool* masterBypassPtr { nullptr }; - juce::AudioParameterFloat* masterOutputPtr { nullptr }; - juce::AudioParameterFloat* masterMixPtr { nullptr }; - juce::AudioParameterChoice* masterOsPtr { nullptr }; - juce::AudioParameterChoice* masterTransformPtr { nullptr }; + juce::AudioParameterBool* masterBypassPtr { nullptr }; + juce::AudioParameterFloat* masterOutputPtr { nullptr }; + juce::AudioParameterFloat* masterMixPtr { nullptr }; + juce::AudioParameterChoice* masterOsPtr { nullptr }; + juce::AudioParameterChoice* masterTransformPtr { nullptr }; // juce::AudioParameterBool* biquadsABypassPtr { nullptr }; // juce::AudioParameterFloat* biquadsAFrequencyPtr { nullptr }; @@ -207,7 +207,7 @@ class AudioPluginAudioProcessorWrapper // juce::AudioParameterFloat* biquadsDGainPtr { nullptr }; // juce::AudioParameterChoice* biquadsDTypePtr { nullptr }; - juce::AudioParameterBool* bypassState { nullptr }; + juce::AudioParameterBool* bypassState { nullptr }; juce::AudioParameterBool* biquadsBypassPtrArray[4]; juce::AudioParameterFloat* biquadsFrequencyPtrArray[4]; diff --git a/VERSION b/VERSION index ff0b08b..eff871e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.3.163 +1.2.3.164