From a33df6689dc4519fa7dcb395ed243e9edd73dbff Mon Sep 17 00:00:00 2001 From: Christoph Hart Date: Wed, 30 Oct 2024 12:55:51 +0100 Subject: [PATCH] - fixed compile error with conversion nodes --- currentGitHash.txt | 2 +- hi_backend/backend/currentGit.h | 2 +- hi_dsp_library/dsp_basics/logic_classes.h | 28 ------------------- hi_dsp_library/dsp_nodes/CableNodes.h | 10 +++++-- .../snex_basics/snex_DynamicType.cpp | 2 +- .../dynamic_elements/DynamicSmootherNode.h | 2 -- 6 files changed, 11 insertions(+), 35 deletions(-) diff --git a/currentGitHash.txt b/currentGitHash.txt index 6b43918e9c..a1276fa617 100644 --- a/currentGitHash.txt +++ b/currentGitHash.txt @@ -1 +1 @@ -32a33970211f725f110631fa4132a2ae292a1ece +27916b2029b7e4e2f1e3bf7d10304a2836fa61a9 diff --git a/hi_backend/backend/currentGit.h b/hi_backend/backend/currentGit.h index 2683f3f75d..16a7fe55bb 100644 --- a/hi_backend/backend/currentGit.h +++ b/hi_backend/backend/currentGit.h @@ -1 +1 @@ -#define PREVIOUS_HISE_COMMIT "32a33970211f725f110631fa4132a2ae292a1ece" +#define PREVIOUS_HISE_COMMIT "27916b2029b7e4e2f1e3bf7d10304a2836fa61a9" diff --git a/hi_dsp_library/dsp_basics/logic_classes.h b/hi_dsp_library/dsp_basics/logic_classes.h index 9899e208c4..88211e278c 100644 --- a/hi_dsp_library/dsp_basics/logic_classes.h +++ b/hi_dsp_library/dsp_basics/logic_classes.h @@ -38,8 +38,6 @@ namespace conversion_logic { struct ms2freq { - static constexpr bool usesPrepareSpecs() { return true; } - double getValue(double input) const { if(input == 0.0) @@ -51,8 +49,6 @@ struct ms2freq struct freq2ms { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { if(input == 0.0) @@ -64,8 +60,6 @@ struct freq2ms struct ms2samples { - static constexpr bool usesPrepareSpecs() { return true; } - double getValue(double input) const { return input * 0.001 * sampleRate; @@ -81,8 +75,6 @@ struct ms2samples struct freq2samples { - static constexpr bool usesPrepareSpecs() { return true; } - double getValue(double input) const { return input > 0.001f ? sampleRate / input : 0.0f; @@ -98,8 +90,6 @@ struct freq2samples struct ms2bpm { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return 60 / (hmath::max(input, 1.0) * 0.001); @@ -108,8 +98,6 @@ struct ms2bpm struct samples2ms { - static constexpr bool usesPrepareSpecs() { return true; } - double getValue(double input) const { if(sampleRate == 0.0) @@ -128,8 +116,6 @@ struct samples2ms struct pitch2st { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return std::log2(input) * 12.0; @@ -138,8 +124,6 @@ struct pitch2st struct st2pitch { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return pow(2.0, input / 12.0); @@ -148,8 +132,6 @@ struct st2pitch struct cent2pitch { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return pow(2.0, input / 1200.0); @@ -158,8 +140,6 @@ struct cent2pitch struct pitch2cent { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return std::log2(input) * 1200.0; @@ -168,8 +148,6 @@ struct pitch2cent struct midi2freq { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return MidiMessage::getMidiNoteInHertz(hmath::round(input*127.0)); @@ -178,8 +156,6 @@ struct midi2freq struct freq2norm { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { static constexpr double factor = 1.0 / 20000.0; @@ -189,8 +165,6 @@ struct freq2norm struct db2gain { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return hmath::db2gain(input); @@ -199,8 +173,6 @@ struct db2gain struct gain2db { - static constexpr bool usesPrepareSpecs() { return false; } - double getValue(double input) const { return hmath::gain2db(input); diff --git a/hi_dsp_library/dsp_nodes/CableNodes.h b/hi_dsp_library/dsp_nodes/CableNodes.h index 544763431b..00b6c83f90 100644 --- a/hi_dsp_library/dsp_nodes/CableNodes.h +++ b/hi_dsp_library/dsp_nodes/CableNodes.h @@ -1187,9 +1187,15 @@ namespace control pimpl::parameter_node_base(getStaticId()) {}; + static constexpr bool usesPrepareSpecs() + { + return prototypes::check::prepare::value; + } + void prepare(PrepareSpecs ps) { - this->obj.prepare(ps); + if constexpr (usesPrepareSpecs()) + this->obj.prepare(ps); if(lastInput.first) { @@ -1199,7 +1205,7 @@ namespace control void setValue(double input) { - if constexpr (ConverterClass::usesPrepareSpecs()) + if constexpr (usesPrepareSpecs()) lastInput = { true, input }; auto v = obj.getValue(input); diff --git a/hi_dsp_library/snex_basics/snex_DynamicType.cpp b/hi_dsp_library/snex_basics/snex_DynamicType.cpp index 86e5179f9b..a32b251acc 100644 --- a/hi_dsp_library/snex_basics/snex_DynamicType.cpp +++ b/hi_dsp_library/snex_basics/snex_DynamicType.cpp @@ -202,7 +202,7 @@ VariableStorage::operator void*() const void* VariableStorage::toPtr() const { - jassert(isVoid()); + jassert(!isVoid()); return data.p.data; } diff --git a/hi_scripting/scripting/scriptnode/dynamic_elements/DynamicSmootherNode.h b/hi_scripting/scripting/scriptnode/dynamic_elements/DynamicSmootherNode.h index fcbe7958f1..af40ccf476 100644 --- a/hi_scripting/scripting/scriptnode/dynamic_elements/DynamicSmootherNode.h +++ b/hi_scripting/scripting/scriptnode/dynamic_elements/DynamicSmootherNode.h @@ -706,8 +706,6 @@ struct dynamic currentMode = (Mode)getConverterNames().indexOf(newValue.toString()); } - static constexpr bool usesPrepareSpecs() { return true; } - struct editor : public ScriptnodeExtraComponent, public ComboBox::Listener {