Jamba C++ API  5.1.1
BooleanParamConverter Class Reference

Manages the very common case when a param represents a boolean value. More...

#include <ParamConverters.h>

Inherits IParamConverter< bool >.

Public Member Functions

 BooleanParamConverter (VstString16 iFalseString=STR16("Off"), VstString16 iTrueString=STR16("On"))
 
bool denormalize (ParamValue iNormalizedValue) const override
 
int32 getStepCount () const override
 
ParamValue normalize (bool const &iValue) const override
 
void toString (bool const &iValue, String128 oString, int32) const override
 
- Public Member Functions inherited from IParamConverter< bool >
virtual std::string toString (ParamType const &iValue, int32 iPrecision) const
 

Static Public Member Functions

static bool toBoolean (ParamValue iNormalizedValue)
 Converts a normalized value to a boolean according to the rule: false for [0.0, 0.5[ and true for [0.5, 1.0] More...
 

Protected Attributes

VstString16 fFalseString
 
VstString16 fTrueString
 

Additional Inherited Members

- Public Types inherited from IParamConverter< bool >
using ParamType = bool
 

Detailed Description

Manages the very common case when a param represents a boolean value.

To denormalize the range [0.0,1.0] this implementation uses false for [0.0, 0.5[ and true for [0.5, 1.0] so that it matches a DiscreteValueParamConverter with a step count of 1.

Constructor & Destructor Documentation

◆ BooleanParamConverter()

BooleanParamConverter ( VstString16  iFalseString = STR16("Off"),
VstString16  iTrueString = STR16("On") 
)
inlineexplicit

Member Function Documentation

◆ denormalize()

bool denormalize ( ParamValue  iNormalizedValue) const
inlineoverridevirtual

◆ getStepCount()

int32 getStepCount ( ) const
inlineoverridevirtual

Reimplemented from IParamConverter< bool >.

◆ normalize()

ParamValue normalize ( bool const &  iValue) const
inlineoverridevirtual

◆ toBoolean()

static bool toBoolean ( ParamValue  iNormalizedValue)
inlinestatic

Converts a normalized value to a boolean according to the rule: false for [0.0, 0.5[ and true for [0.5, 1.0]

◆ toString()

void toString ( bool const &  iValue,
String128  oString,
int32   
) const
inlineoverridevirtual

Reimplemented from IParamConverter< bool >.

Member Data Documentation

◆ fFalseString

VstString16 fFalseString
protected

◆ fTrueString

VstString16 fTrueString
protected

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