commit cc2fd96e1294ccc865646ffe0ccd7863d21e2d02
parent 2345d4afc85bc41a68b623191a1b452a706eb516
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Sat, 20 Apr 2024 18:34:25 +0200
Merge branch 'oss/osirus' into split_osirus_osTIrus
Diffstat:
2 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/source/jucePluginLib/controller.cpp b/source/jucePluginLib/controller.cpp
@@ -313,11 +313,18 @@ namespace pluginLib
for (const auto& index : indices)
{
- auto* p = getParameter(index.second, _part);
- if(!p)
- return false;
-
- const auto v = getParameterValue(p);
+ auto* p = getParameter(index.second, _part);
+ if(!p)
+ return false;
+ auto* largestP = p;
+ // we might have more than 1 parameter per index, use the one with the largest range
+ const auto& derived = p->getDerivedParameters();
+ for (const auto& parameter : derived)
+ {
+ if(parameter->getDescription().range.getLength() > p->getDescription().range.getLength())
+ largestP = parameter;
+ }
+ const auto v = getParameterValue(largestP);
_params.insert(std::make_pair(std::make_pair(index.first, p->getDescription().name), v));
}
diff --git a/source/jucePluginLib/parameter.cpp b/source/jucePluginLib/parameter.cpp
@@ -116,22 +116,22 @@ namespace pluginLib
{
const auto clampedValue = juce::roundToInt(m_range.getRange().clipValue(static_cast<float>(newValue)));
- if (clampedValue == m_lastValue)
- return;
-
- m_lastValue = clampedValue;
- m_lastValueOrigin = _origin;
-
- if (notifyHost && getDescription().isPublic)
+ if (clampedValue != m_lastValue)
{
- beginChangeGesture();
- const auto v = convertTo0to1(static_cast<float>(clampedValue));
- setValueNotifyingHost(v, _origin);
- endChangeGesture();
- }
- else
- {
- m_value.setValue(clampedValue);
+ m_lastValue = clampedValue;
+ m_lastValueOrigin = _origin;
+
+ if (notifyHost && getDescription().isPublic)
+ {
+ beginChangeGesture();
+ const auto v = convertTo0to1(static_cast<float>(clampedValue));
+ setValueNotifyingHost(v, _origin);
+ endChangeGesture();
+ }
+ else
+ {
+ m_value.setValue(clampedValue);
+ }
}
if (m_changingDerivedValues)