Hi JUCE team (and others that might see this issue),
Using the built-in AudioParameteFloat class resuls in values not being shown in automation curves in Logic X at least. The values aren't shown in the generic "Controls" version of the UI in Logic either.
Tested using the GainPlugin example.
Cause:
In the AU warpper the getter for kAudioUnitProperty_ParameterStringFromValue in GetProperty() requests a zero length string:
...
case kAudioUnitProperty_ParameterStringFromValue:
{
if (AudioUnitParameterStringFromValue* pv = (AudioUnitParameterStringFromValue*) outData)
{
if (juceFilter != nullptr)
{
const float value = (float) *(pv->inValue);
String text;
if (AudioProcessorParameter* param = juceFilter->getParameters() [(int) pv->inParamID])
text = param->getText ((float) *(pv->inValue), 0); /// <<< here
else
text = String (value);
pv->outString = text.toCFString();
return noErr;
}
}
}
...
And in AudioParameteFloat this results in an empty string due to String::substring (0,0) being called
String AudioParameterFloat::getText (float v, int length) const { return String (range.convertFrom0to1 (v), 2).substring (0, length); }
Should the wrapper be calling with a length > 0 or perhpas the parameter not calling String::substring() if the requested length is zero?
Cheers,
Martin
