Skip to content

Commit

Permalink
Tweaked the order in which AutomatableParameter::setParameterValue() …
Browse files Browse the repository at this point in the history
…does things, so that the parameter's current value is updated before the listeners get invoked, so they can actually find out the new value.
  • Loading branch information
julianstorer committed Dec 9, 2024
1 parent 881d852 commit 9afc2eb
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,8 @@ void AutomatableParameter::setParameterValue (float value, bool isFollowingCurve

if (currentValue != value)
{
currentValue = value;

parameterChanged (value, isFollowingCurve);

auto& ed = getEdit();
Expand All @@ -1047,14 +1049,12 @@ void AutomatableParameter::setParameterValue (float value, bool isFollowingCurve
{
ed.getParameterChangeHandler().parameterChanged (*this, true);

currentValue = value;

if (attachedValue != nullptr)
attachedValue->triggerAsyncUpdate();
}
else
{
if (! getEdit().isLoading())
if (! ed.isLoading())
jassert (juce::MessageManager::getInstance()->currentThreadHasLockedMessageManager());

curveHasChanged();
Expand Down Expand Up @@ -1086,8 +1086,6 @@ void AutomatableParameter::setParameterValue (float value, bool isFollowingCurve
}
}

currentValue = value;

if (attachedValue != nullptr)
{
attachedValue->cancelPendingUpdate();
Expand Down

0 comments on commit 9afc2eb

Please sign in to comment.