From c1dbb8684a0036b041c1b86d2e1ba423e9727083 Mon Sep 17 00:00:00 2001 From: jules Date: Sat, 10 Jan 2015 15:32:29 +0000 Subject: [PATCH] Fix for auval fail with parameter strings in plugins with old-style parameter implementations. --- .../AU/juce_AU_Wrapper.mm | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 6e1edbf437..d4592ab56d 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -343,11 +343,14 @@ public: { if (juceFilter != nullptr) { + const String text (String::fromCFString (pv->inString)); + if (AudioProcessorParameter* param = juceFilter->getParameters() [(int) pv->inParamID]) - { - pv->outValue = param->getValueForText (String::fromCFString (pv->inString)); - return noErr; - } + pv->outValue = param->getValueForText (text); + else + pv->outValue = text.getFloatValue(); + + return noErr; } } } @@ -359,11 +362,16 @@ public: { if (juceFilter != nullptr) { + const float value = (float) *(pv->inValue); + String text; + if (AudioProcessorParameter* param = juceFilter->getParameters() [(int) pv->inParamID]) - { - pv->outString = param->getText ((float) *(pv->inValue), 0).toCFString(); - return noErr; - } + text = param->getText ((float) *(pv->inValue), 0); + else + text = String (value); + + pv->outString = text.toCFString(); + return noErr; } } }