Skip to content

Commit

Permalink
- fixed compile error with conversion nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-hart committed Oct 30, 2024
1 parent 27916b2 commit a33df66
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 35 deletions.
2 changes: 1 addition & 1 deletion currentGitHash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
32a33970211f725f110631fa4132a2ae292a1ece
27916b2029b7e4e2f1e3bf7d10304a2836fa61a9
2 changes: 1 addition & 1 deletion hi_backend/backend/currentGit.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define PREVIOUS_HISE_COMMIT "32a33970211f725f110631fa4132a2ae292a1ece"
#define PREVIOUS_HISE_COMMIT "27916b2029b7e4e2f1e3bf7d10304a2836fa61a9"
28 changes: 0 additions & 28 deletions hi_dsp_library/dsp_basics/logic_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ namespace conversion_logic
{
struct ms2freq
{
static constexpr bool usesPrepareSpecs() { return true; }

double getValue(double input) const
{
if(input == 0.0)
Expand All @@ -51,8 +49,6 @@ struct ms2freq

struct freq2ms
{
static constexpr bool usesPrepareSpecs() { return false; }

double getValue(double input) const
{
if(input == 0.0)
Expand All @@ -64,8 +60,6 @@ struct freq2ms

struct ms2samples
{
static constexpr bool usesPrepareSpecs() { return true; }

double getValue(double input) const
{
return input * 0.001 * sampleRate;
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -108,8 +98,6 @@ struct ms2bpm

struct samples2ms
{
static constexpr bool usesPrepareSpecs() { return true; }

double getValue(double input) const
{
if(sampleRate == 0.0)
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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));
Expand All @@ -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;
Expand All @@ -189,8 +165,6 @@ struct freq2norm

struct db2gain
{
static constexpr bool usesPrepareSpecs() { return false; }

double getValue(double input) const
{
return hmath::db2gain(input);
Expand All @@ -199,8 +173,6 @@ struct db2gain

struct gain2db
{
static constexpr bool usesPrepareSpecs() { return false; }

double getValue(double input) const
{
return hmath::gain2db(input);
Expand Down
10 changes: 8 additions & 2 deletions hi_dsp_library/dsp_nodes/CableNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1187,9 +1187,15 @@ namespace control
pimpl::parameter_node_base<ParameterClass>(getStaticId())
{};

static constexpr bool usesPrepareSpecs()
{
return prototypes::check::prepare<ConverterClass>::value;
}

void prepare(PrepareSpecs ps)
{
this->obj.prepare(ps);
if constexpr (usesPrepareSpecs())
this->obj.prepare(ps);

if(lastInput.first)
{
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion hi_dsp_library/snex_basics/snex_DynamicType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ VariableStorage::operator void*() const

void* VariableStorage::toPtr() const
{
jassert(isVoid());
jassert(!isVoid());

return data.p.data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,6 @@ struct dynamic
currentMode = (Mode)getConverterNames().indexOf(newValue.toString());
}

static constexpr bool usesPrepareSpecs() { return true; }

struct editor : public ScriptnodeExtraComponent<dynamic>,
public ComboBox::Listener
{
Expand Down

0 comments on commit a33df66

Please sign in to comment.