It would be nice if we could use integer types for specializations of juce::NormalisableRange
. Right now, the function convertTo0to1
returns a ValueType
, and convertFrom0to1
takes a ValueType
parameter, which obviously doesn’t make much sense when ValueType
is, for example, int
.
My use case is a custom NumericProperty
class, which is basically a generic class similar to juce::Value
, having a NormalisedRange
baked directly into it. I would appreciate being able to use the NormalisedRange
's nice features like skew factor without having to use NormalisedRange<float>
even for integer types, and doing my own rounding/casting.
IMO, it would make sense to have the following function signatures:
float convertTo0to1(ValueType v)
ValueType convertFrom0to1(float proportion)