Hi there, I am currently working on implementing the accessibility features on a project. When voiceOver reads a slider value it also reads the final zeros in the decimal places (i.e. 1.600000). I would like to have voiceOver to just read the non-zero values (i.e. 1.6), this can be done by modifying getCurrentValueAsString() inside Slider::SliderAccessibilityHandler::ValueInterface. Can getCurrentValueAsString() be overridden somehow? Also, having the possibility to set the amount of readable decimal places by voiceOver (or the Windows counterpart) somewhere in AccessibilityHandler would be nice imho.
when initializing the juce::AudioProcessorParameter (or some inherited class of it) you can define the lambda that converts the value to a string. there you could do something like:
return juce::String(std::floor(value * 100f) * .01f) + " whateverTheUnitIs";
to have values with a fixed amount of decimals, like 2 in this case
Hey, thanks for your reply. Unfortunately I am not using juce::AudioProcessorParameter. My app uses different types of inherited juce::Slider objects. So far I’ve got it working by replacing juce_Slider.cpp with a custom version that modifies Slider::SliderAccessibilityHandler::ValueInterface::getCurrentValueAsString() but I don’t think that’s the best approach to solve the issue.
The Slider itself has also two lambdas you can use, textFromValueFunction and valueFromTextFunction.
HTH
Setting the textFromValueFunction lambda to a custom function did the trick! Thanks a lot
