JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::RangedAudioParameterAttributes< Derived, Value > Class Template Reference

#include <juce_RangedAudioParameter.h>

Inheritance diagram for juce::RangedAudioParameterAttributes< Derived, Value >:
Collaboration diagram for juce::RangedAudioParameterAttributes< Derived, Value >:

Public Types

using Category = AudioProcessorParameter::Category
 
using StringFromValue = std::function< String(Value, int)>
 
using ValueFromString = std::function< Value(const String &)>
 

Public Member Functions

const auto & getAudioProcessorParameterWithIDAttributes () const
 Gets attributes that would also apply to an AudioProcessorParameterWithID.
 
const auto & getStringFromValueFunction () const
 An optional lambda function that converts a non-normalised value to a string with a maximum length.
 
const auto & getValueFromStringFunction () const
 An optional lambda function that parses a string and converts it into a non-normalised value.
 
auto withAutomatable (bool x) const
 See AudioProcessorParameter::isAutomatable()
 
auto withCategory (Category x) const
 See AudioProcessorParameterWithIDAttributes::withCategory()
 
auto withInverted (bool x) const
 See AudioProcessorParameter::isOrientationInverted()
 
auto withLabel (String x) const
 See AudioProcessorParameterWithIDAttributes::withLabel()
 
auto withMeta (bool x) const
 See AudioProcessorParameter::isMetaParameter()
 
auto withStringFromValueFunction (StringFromValue x) const
 An optional lambda function that converts a non-normalised value to a string with a maximum length.
 
auto withValueFromStringFunction (ValueFromString x) const
 An optional lambda function that parses a string and converts it into a non-normalised value.
 

Private Types

using This = RangedAudioParameterAttributes
 

Private Member Functions

auto & asDerived () const
 

Private Attributes

AudioProcessorParameterWithIDAttributes attributes
 
StringFromValue stringFromValue
 
ValueFromString valueFromString
 

Detailed Description

template<typename Derived, typename Value>
class juce::RangedAudioParameterAttributes< Derived, Value >

Holds common attributes of audio parameters.

CRTP is used here because we want the Attributes types for each parameter (Float, Bool, Choice, Int) to be distinct and extensible in the future. i.e. the identifiers AudioParameterFloatAttributes and RangedAudioParameterAttributes<float> should not be interchangable because we might need to add float-specific attributes in the future. Users should not refer directly to RangedAudioParameterAttributes.

@tags{Audio}

Member Typedef Documentation

◆ Category

template<typename Derived , typename Value >
using juce::RangedAudioParameterAttributes< Derived, Value >::Category = AudioProcessorParameter::Category

◆ StringFromValue

template<typename Derived , typename Value >
using juce::RangedAudioParameterAttributes< Derived, Value >::StringFromValue = std::function<String (Value, int)>

◆ This

template<typename Derived , typename Value >
using juce::RangedAudioParameterAttributes< Derived, Value >::This = RangedAudioParameterAttributes
private

◆ ValueFromString

template<typename Derived , typename Value >
using juce::RangedAudioParameterAttributes< Derived, Value >::ValueFromString = std::function<Value (const String&)>

Member Function Documentation

◆ asDerived()

◆ getAudioProcessorParameterWithIDAttributes()

template<typename Derived , typename Value >
const auto & juce::RangedAudioParameterAttributes< Derived, Value >::getAudioProcessorParameterWithIDAttributes ( ) const
inline

◆ getStringFromValueFunction()

template<typename Derived , typename Value >
const auto & juce::RangedAudioParameterAttributes< Derived, Value >::getStringFromValueFunction ( ) const
inline

An optional lambda function that converts a non-normalised value to a string with a maximum length.

This may be used by hosts to display the parameter's value.

References juce::RangedAudioParameterAttributes< Derived, Value >::stringFromValue.

◆ getValueFromStringFunction()

template<typename Derived , typename Value >
const auto & juce::RangedAudioParameterAttributes< Derived, Value >::getValueFromStringFunction ( ) const
inline

An optional lambda function that parses a string and converts it into a non-normalised value.

Some hosts use this to allow users to type in parameter values.

References juce::RangedAudioParameterAttributes< Derived, Value >::valueFromString.

◆ withAutomatable()

◆ withCategory()

◆ withInverted()

◆ withLabel()

◆ withMeta()

◆ withStringFromValueFunction()

template<typename Derived , typename Value >
auto juce::RangedAudioParameterAttributes< Derived, Value >::withStringFromValueFunction ( StringFromValue  x) const
inline

An optional lambda function that converts a non-normalised value to a string with a maximum length.

This may be used by hosts to display the parameter's value.

References juce::RangedAudioParameterAttributes< Derived, Value >::asDerived(), and juce::withMember().

Referenced by juce::AudioProcessorValueTreeStateParameterAttributes::withStringFromValueFunction().

◆ withValueFromStringFunction()

template<typename Derived , typename Value >
auto juce::RangedAudioParameterAttributes< Derived, Value >::withValueFromStringFunction ( ValueFromString  x) const
inline

An optional lambda function that parses a string and converts it into a non-normalised value.

Some hosts use this to allow users to type in parameter values.

References juce::RangedAudioParameterAttributes< Derived, Value >::asDerived(), and juce::withMember().

Referenced by juce::AudioProcessorValueTreeStateParameterAttributes::withValueFromStringFunction().

Member Data Documentation

◆ attributes

◆ stringFromValue

template<typename Derived , typename Value >
StringFromValue juce::RangedAudioParameterAttributes< Derived, Value >::stringFromValue
private

◆ valueFromString

template<typename Derived , typename Value >
ValueFromString juce::RangedAudioParameterAttributes< Derived, Value >::valueFromString
private

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