JUCE
Public Member Functions | Public Attributes | List of all members
NormalisableRange< ValueType > Class Template Reference

Represents a mapping between an arbitrary range of values and a normalised 0->1 range. More...

Public Member Functions

 NormalisableRange () noexcept
 Creates a continuous range that performs a dummy mapping. More...
 
 NormalisableRange (const NormalisableRange &other) noexcept
 Creates a copy of another range. More...
 
NormalisableRangeoperator= (const NormalisableRange &other) noexcept
 Creates a copy of another range. More...
 
 NormalisableRange (ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor) noexcept
 Creates a NormalisableRange with a given range, interval and skew factor. More...
 
 NormalisableRange (ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue) noexcept
 Creates a NormalisableRange with a given range and interval, but a dummy skew-factor. More...
 
 NormalisableRange (ValueType rangeStart, ValueType rangeEnd) noexcept
 Creates a NormalisableRange with a given range, continuous interval, but a dummy skew-factor. More...
 
ValueType convertTo0to1 (ValueType v) const noexcept
 Uses the properties of this mapping to convert a non-normalised value to its 0->1 representation. More...
 
ValueType convertFrom0to1 (ValueType proportion) const noexcept
 Uses the properties of this mapping to convert a normalised 0->1 value to its full-range representation. More...
 
ValueType snapToLegalValue (ValueType v) const noexcept
 Takes a non-normalised value and snaps it based on the interval property of this NormalisedRange. More...
 
Range< ValueType > getRange () const noexcept
 

Public Attributes

ValueType start
 The start of the non-normalised range. More...
 
ValueType end
 The end of the non-normalised range. More...
 
ValueType interval
 The snapping interval that should be used (in non-normalised value). More...
 
ValueType skew
 An optional skew factor that alters the way values are distribute across the range. More...
 

Detailed Description

template<typename ValueType>
class NormalisableRange< ValueType >

Represents a mapping between an arbitrary range of values and a normalised 0->1 range.

The properties of the mapping also include an optional snapping interval and skew-factor.

See also
Range

Constructor & Destructor Documentation

template<typename ValueType>
NormalisableRange< ValueType >::NormalisableRange ( )
noexcept

Creates a continuous range that performs a dummy mapping.

template<typename ValueType>
NormalisableRange< ValueType >::NormalisableRange ( const NormalisableRange< ValueType > &  other)
noexcept

Creates a copy of another range.

template<typename ValueType>
NormalisableRange< ValueType >::NormalisableRange ( ValueType  rangeStart,
ValueType  rangeEnd,
ValueType  intervalValue,
ValueType  skewFactor 
)
noexcept

Creates a NormalisableRange with a given range, interval and skew factor.

template<typename ValueType>
NormalisableRange< ValueType >::NormalisableRange ( ValueType  rangeStart,
ValueType  rangeEnd,
ValueType  intervalValue 
)
noexcept

Creates a NormalisableRange with a given range and interval, but a dummy skew-factor.

template<typename ValueType>
NormalisableRange< ValueType >::NormalisableRange ( ValueType  rangeStart,
ValueType  rangeEnd 
)
noexcept

Creates a NormalisableRange with a given range, continuous interval, but a dummy skew-factor.

Member Function Documentation

template<typename ValueType>
NormalisableRange& NormalisableRange< ValueType >::operator= ( const NormalisableRange< ValueType > &  other)
noexcept

Creates a copy of another range.

template<typename ValueType>
ValueType NormalisableRange< ValueType >::convertTo0to1 ( ValueType  v) const
noexcept

Uses the properties of this mapping to convert a non-normalised value to its 0->1 representation.

template<typename ValueType>
ValueType NormalisableRange< ValueType >::convertFrom0to1 ( ValueType  proportion) const
noexcept

Uses the properties of this mapping to convert a normalised 0->1 value to its full-range representation.

template<typename ValueType>
ValueType NormalisableRange< ValueType >::snapToLegalValue ( ValueType  v) const
noexcept

Takes a non-normalised value and snaps it based on the interval property of this NormalisedRange.

template<typename ValueType>
Range<ValueType> NormalisableRange< ValueType >::getRange ( ) const
noexcept

Member Data Documentation

template<typename ValueType>
ValueType NormalisableRange< ValueType >::start
template<typename ValueType>
ValueType NormalisableRange< ValueType >::end
template<typename ValueType>
ValueType NormalisableRange< ValueType >::interval

The snapping interval that should be used (in non-normalised value).

Use 0 for a continuous range.

Referenced by NormalisableRange< float >::operator=(), and NormalisableRange< float >::snapToLegalValue().

template<typename ValueType>
ValueType NormalisableRange< ValueType >::skew

An optional skew factor that alters the way values are distribute across the range.

The skew factor lets you skew the mapping logarithmically so that larger or smaller values are given a larger proportion of the available space.

A factor of 1.0 has no skewing effect at all. If the factor is < 1.0, the lower end of the range will fill more of the slider's length; if the factor is > 1.0, the upper end of the range will be expanded.

Referenced by NormalisableRange< float >::convertFrom0to1(), NormalisableRange< float >::convertTo0to1(), and NormalisableRange< float >::operator=().


The documentation for this class was generated from the following file: