Was having issues with display strings showing up in my AU after making my own parameter subclasses, and I noticed in the AU wrapper:
case kAudioUnitProperty_ParameterStringFromValue:
{
if (AudioUnitParameterStringFromValue* pv = (AudioUnitParameterStringFromValue*) outData)
{
if (juceFilter != nullptr)
{
if (auto* param = getParameterForAUParameterID (pv->inParamID))
{
const float value = (float) *(pv->inValue);
String text;
if (LegacyAudioParameter::isLegacy (param))
text = String (value);
else
text = param->getText (value / getMaximumParameterValue (param), 0);
pv->outString = text.toCFString();
return noErr;
}
}
}
}
break;
getText()
is called with a length of 0… since I do abide by that length arg in my param classes it was just returning an empty string every call.
Is there a reason for 0 or should I be considering a 0 value as “unrestricted” length?