gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit de35d682077fad28e41a3e5a33643f8695d5030d
parent 67091637410b4eb060da4271d4e2ed54755f181c
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Tue,  6 Aug 2024 21:50:50 +0200

fix some leftovers from when parameters were still just an uint8_t

Diffstat:
Msource/jucePluginLib/parameter.cpp | 13++++++-------
Msource/jucePluginLib/parameter.h | 6+++---
2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/source/jucePluginLib/parameter.cpp b/source/jucePluginLib/parameter.cpp @@ -44,7 +44,6 @@ namespace pluginLib const auto value = juce::roundToInt(floatValue); jassert(m_range.getRange().contains(floatValue) || m_range.end == floatValue); - jassert(value >= 0 && value <= 127); if (value == m_lastValue) return; @@ -54,12 +53,12 @@ namespace pluginLib { if(m_rateLimit) { - sendParameterChangeDelayed(static_cast<uint8_t>(value), ++m_uniqueDelayCallbackId); + sendParameterChangeDelayed(value, ++m_uniqueDelayCallbackId); } else { m_lastSendTime = milliseconds(); - m_controller.sendParameterChange(*this, static_cast<uint8_t>(value)); + m_controller.sendParameterChange(*this, value); } } @@ -72,7 +71,7 @@ namespace pluginLib return t.count(); } - void Parameter::sendParameterChangeDelayed(const uint8_t _value, uint32_t _uniqueId) + void Parameter::sendParameterChangeDelayed(const ParamValue _value, uint32_t _uniqueId) { if(_uniqueId != m_uniqueDelayCallbackId) return; @@ -227,10 +226,10 @@ namespace pluginLib return juce::String::formatted("%d_%d_%d", static_cast<int>(d.page), part, d.index); } - uint8_t Parameter::getDefault() const + ParamValue Parameter::getDefault() const { - if(m_desc.defaultValue != Description::NoDefaultValue) - return static_cast<uint8_t>(m_desc.defaultValue); + if(m_desc.defaultValue != Description::NoDefaultValue) + return m_desc.defaultValue; return 0; } diff --git a/source/jucePluginLib/parameter.h b/source/jucePluginLib/parameter.h @@ -66,10 +66,10 @@ namespace pluginLib float getDefaultValue() const override { - return convertTo0to1((float)getDefault()); + return convertTo0to1(static_cast<float>(getDefault())); } - virtual uint8_t getDefault() const; + virtual ParamValue getDefault() const; juce::String getText(float normalisedValue, int /*maximumStringLength*/) const override { @@ -114,7 +114,7 @@ namespace pluginLib void setDerivedValue(const int _value); void sendToSynth(); static uint64_t milliseconds(); - void sendParameterChangeDelayed(uint8_t, uint32_t _uniqueId); + void sendParameterChangeDelayed(ParamValue _value, uint32_t _uniqueId); void forwardToDerived(const int _newValue); int clampValue(int _value) const;