From f3d59a0f2f2caa590e7050036ec88c657412b3e2 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 2 Sep 2014 17:58:21 +0100 Subject: [PATCH] Fix for bypass parameter handling in AAX. --- .../AAX/juce_AAX_Wrapper.cpp | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index d599407d72..29820732d4 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -574,28 +574,27 @@ struct AAXClasses AAX_Result SetParameterNormalizedValue (AAX_CParamID paramID, double newValue) override { - if (! isBypassParam (paramID)) - { - if (AAX_IParameter* p = const_cast (mParameterManager.GetParameterByID (paramID))) - p->SetValueWithFloat ((float) newValue); + if (isBypassParam (paramID)) + return AAX_CEffectParameters::SetParameterNormalizedValue (paramID, newValue); - pluginInstance->setParameter (getParamIndexFromID (paramID), (float) newValue); - } + if (AAX_IParameter* p = const_cast (mParameterManager.GetParameterByID (paramID))) + p->SetValueWithFloat ((float) newValue); + pluginInstance->setParameter (getParamIndexFromID (paramID), (float) newValue); return AAX_SUCCESS; } - AAX_Result SetParameterNormalizedRelative (AAX_CParamID paramID, double newValue) override + AAX_Result SetParameterNormalizedRelative (AAX_CParamID paramID, double newDeltaValue) override { - if (! isBypassParam (paramID)) - { - const int paramIndex = getParamIndexFromID (paramID); - const float oldValue = pluginInstance->getParameter (paramIndex); - pluginInstance->setParameter (paramIndex, jlimit (0.0f, 1.0f, (float) (oldValue + newValue))); + if (isBypassParam (paramID)) + return AAX_CEffectParameters::SetParameterNormalizedRelative (paramID, newDeltaValue); - if (AAX_IParameter* p = const_cast (mParameterManager.GetParameterByID (paramID))) - p->SetValueWithFloat ((float) newValue); - } + const int paramIndex = getParamIndexFromID (paramID); + const float newValue = pluginInstance->getParameter (paramIndex) + (float) newDeltaValue; + pluginInstance->setParameter (paramIndex, jlimit (0.0f, 1.0f, newValue)); + + if (AAX_IParameter* p = const_cast (mParameterManager.GetParameterByID (paramID))) + p->SetValueWithFloat (newValue); return AAX_SUCCESS; }