Browse Source

Fixed an issue forwarding valueToText functions in the SliderAttachment

tags/2021-05-28
Tom Poole 8 years ago
parent
commit
1e9a5a18ec
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp

+ 5
- 2
modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp View File

@@ -465,8 +465,11 @@ struct AudioProcessorValueTreeState::SliderAttachment::Pimpl : private Attached
if (auto* param = dynamic_cast<AudioProcessorValueTreeState::Parameter*> (state.getParameter (paramID)))
{
slider.valueFromTextFunction = [param] (const String& text) { return (double) param->textToValueFunction (text); };
slider.textFromValueFunction = [param] (double value) { return param->valueToTextFunction ((float) value); };
if (param->textToValueFunction != nullptr)
slider.valueFromTextFunction = [param] (const String& text) { return (double) param->textToValueFunction (text); };
if (param->valueToTextFunction != nullptr)
slider.textFromValueFunction = [param] (double value) { return param->valueToTextFunction ((float) value); };
slider.setDoubleClickReturnValue (true, range.convertFrom0to1 (param->getDefaultValue()));
}


Loading…
Cancel
Save