1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

Improved AAX support for parameter value<->string conversion, and fix for some problems with AAX parameter highlighting.

This commit is contained in:
jules 2015-03-12 12:49:16 +00:00
parent 0a977b5589
commit 05cc54abf6

View file

@ -329,12 +329,16 @@ struct AAXClasses
{
if (component != nullptr && component->pluginEditor != nullptr)
{
AudioProcessorEditor::ParameterControlHighlightInfo info;
info.parameterIndex = getParamIndexFromID (paramID);
info.isHighlighted = isHighlighted;
info.suggestedColour = getColourFromHighlightEnum (colour);
if (! isBypassParam (paramID))
{
AudioProcessorEditor::ParameterControlHighlightInfo info;
info.parameterIndex = getParamIndexFromID (paramID);
info.isHighlighted = isHighlighted;
info.suggestedColour = getColourFromHighlightEnum (colour);
component->pluginEditor->setControlHighlight (info);
}
component->pluginEditor->setControlHighlight (info);
return AAX_SUCCESS;
}
@ -554,13 +558,41 @@ struct AAXClasses
return result;
}
AAX_Result GetParameterValueFromString (AAX_CParamID paramID, double* result, const AAX_IString& text) const override
{
if (isBypassParam (paramID))
{
*result = (text.Get()[0] == 'B') ? 1 : 0;
return AAX_SUCCESS;
}
if (AudioProcessorParameter* param = pluginInstance->getParameters() [getParamIndexFromID (paramID)])
{
*result = param->getValueForText (text.Get());
return AAX_SUCCESS;
}
return AAX_CEffectParameters::GetParameterValueFromString (paramID, result, text);
}
AAX_Result GetParameterStringFromValue (AAX_CParamID paramID, double value, AAX_IString* result, int32_t maxLen) const override
{
if (isBypassParam (paramID))
result->Set (value == 0 ? "Off"
: (maxLen >= 8 ? "Bypassed" : "Byp"));
{
result->Set (value == 0 ? "Off" : (maxLen >= 8 ? "Bypassed" : "Byp"));
}
else
result->Set (pluginInstance->getParameterText (getParamIndexFromID (paramID), maxLen).toRawUTF8());
{
const int paramIndex = getParamIndexFromID (paramID);
juce::String text;
if (AudioProcessorParameter* param = pluginInstance->getParameters() [paramIndex])
text = param->getText ((float) value, maxLen);
else
text = pluginInstance->getParameterText (paramIndex, maxLen);
result->Set (text.toRawUTF8());
}
return AAX_SUCCESS;
}