Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
EnumParamConverter< Enum, MaxValue > Class Template Reference

A converter to deal with an enum (assumes that the enum is contiguous, starts at 0 and that MaxValue is the latest value in the enum). More...

#include <ParamConverters.h>

Inherits IParamConverter< Enum >.

Public Types

using ConstructorType = std::array<VstString16, MaxValue + 1> const &
 Defines the type for the constructor argument.
using IntType = std::underlying_type_t<Enum>
using ParamType = Enum
Public Types inherited from IParamConverter< Enum >
using ParamType

Public Member Functions

ParamType denormalize (ParamValue iNormalizedValue) const override
 EnumParamConverter (ConstructorType iToStringValues)
 EnumParamConverter (IntType iToStringOffset=0)
 EnumParamConverter (VstString16 iFormat, IntType iToStringOffset=0)
int32 getStepCount () const override
ParamValue normalize (ParamType const &iDiscreteValue) const override
void toString (ParamType const &iValue, String128 oString, int32 iPrecision) const override

Private Attributes

DiscreteValueParamConverter< MaxValue, IntTypefConverter

Detailed Description

template<typename Enum, Enum MaxValue>
class pongasoft::VST::EnumParamConverter< Enum, MaxValue >

A converter to deal with an enum (assumes that the enum is contiguous, starts at 0 and that MaxValue is the latest value in the enum).

Note that you can also use DiscreteTypeParamConverter<Enum> instead in case your enum is not contiguous, you want to select only some values of the enum, or you want a simpler way to initialize it.

Member Typedef Documentation

◆ ConstructorType

template<typename Enum, Enum MaxValue>
using ConstructorType = std::array<VstString16, MaxValue + 1> const &

Defines the type for the constructor argument.

Example: { STR16("abc"), ... }

◆ IntType

template<typename Enum, Enum MaxValue>
using IntType = std::underlying_type_t<Enum>

◆ ParamType

template<typename Enum, Enum MaxValue>
using ParamType = Enum

Constructor & Destructor Documentation

◆ EnumParamConverter() [1/3]

template<typename Enum, Enum MaxValue>
EnumParamConverter ( IntType iToStringOffset = 0)
inlineexplicit

◆ EnumParamConverter() [2/3]

template<typename Enum, Enum MaxValue>
EnumParamConverter ( VstString16 iFormat,
IntType iToStringOffset = 0 )
inlineexplicit

◆ EnumParamConverter() [3/3]

template<typename Enum, Enum MaxValue>
EnumParamConverter ( ConstructorType iToStringValues)
inlineexplicit

Member Function Documentation

◆ denormalize()

template<typename Enum, Enum MaxValue>
ParamType denormalize ( ParamValue iNormalizedValue) const
inlineoverridevirtual

◆ getStepCount()

template<typename Enum, Enum MaxValue>
int32 getStepCount ( ) const
inlineoverridevirtual

Reimplemented from IParamConverter< Enum >.

◆ normalize()

template<typename Enum, Enum MaxValue>
ParamValue normalize ( ParamType const & iDiscreteValue) const
inlineoverridevirtual

◆ toString()

template<typename Enum, Enum MaxValue>
void toString ( ParamType const & iValue,
String128 oString,
int32 iPrecision ) const
inlineoverridevirtual

Reimplemented from IParamConverter< Enum >.

Member Data Documentation

◆ fConverter

template<typename Enum, Enum MaxValue>
DiscreteValueParamConverter<MaxValue, IntType> fConverter
private

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