Jamba C++ API  5.1.1
VstParamDef< T > Class Template Reference

Typed parameter definition. More...

#include <ParamDef.h>

Inherits RawVstParamDef.

Public Types

using ParamType = T
 
- Public Types inherited from IParamDef
enum  Owner { kRT, kGUI }
 Who owns the parameter (mostly for state saving purposes) More...
 

Public Member Functions

ParamType denormalize (ParamValue iNormalizedValue) const
 
ParamType getDefaultValue () const
 
ParamValue normalize (ParamType const &iValue) const
 
ParamType readFromState (NormalizedState const &iState) const
 Read the value from the (normalized) state. More...
 
void toString (ParamValue iNormalizedValue, String128 iString) const override
 Using fConverter::toString More...
 
std::string toUTF8String (ParamValue iNormalizedValue, int32 iPrecision) const override
 Return the value as a utf-8 string. More...
 
 VstParamDef (ParamID const iParamID, VstString16 iTitle, VstString16 iUnits, ParamType const iDefaultValue, int32 const iFlags, UnitID const iUnitID, VstString16 iShortTitle, int32 const iPrecision, Owner const iOwner, bool const iTransient, int16 const iDeprecatedSince, std::shared_ptr< IParamConverter< ParamType >> iConverter)
 
tresult writeToState (ParamType const &iValue, NormalizedState &oState) const
 Writes the provided value to the (normalized) state. More...
 
- Public Member Functions inherited from RawVstParamDef
 RawVstParamDef (ParamID const iParamID, VstString16 iTitle, VstString16 iUnits, ParamValue const iDefaultNormalizedValue, int32 const iStepCount, int32 const iFlags, UnitID const iUnitID, VstString16 iShortTitle, int32 const iPrecision, Owner const iOwner, bool const iTransient, int16 const iDeprecatedSince)
 
ParamValue readFromState (NormalizedState const &iState) const
 Read the value from the (normalized) state. More...
 
ParamValue readFromStream (IBStreamer &iStreamer) const
 
tresult writeToState (ParamValue iValue, NormalizedState &oState) const
 Writes the provided value to the (normalized) state. More...
 
- Public Member Functions inherited from IParamDef
 IParamDef (ParamID const iParamID, VstString16 iTitle, Owner const iOwner, bool const iTransient, int16 const iDeprecatedSince)
 
bool isDeprecated () const
 Returns true if the parameter is deprecated (meaning it can only be used to upgrade to latest version) More...
 
virtual ~IParamDef ()=default
 

Public Attributes

const std::shared_ptr< IParamConverter< ParamType > > fConverter
 
const ParamType fDefaultValue
 
- Public Attributes inherited from RawVstParamDef
const ParamValue fDefaultValue
 
const int32 fFlags
 
const int32 fPrecision
 
const VstString16 fShortTitle
 
const int32 fStepCount
 
const UnitID fUnitID
 
const VstString16 fUnits
 
- Public Attributes inherited from IParamDef
const int16 fDeprecatedSince
 
const Owner fOwner
 
const ParamID fParamID
 
const VstString16 fTitle
 
const bool fTransient
 

Additional Inherited Members

- Static Public Attributes inherited from IParamDef
static constexpr int16 kVersionNotDeprecated = -1
 Special version indicating the parameter is not deprecated. More...
 

Detailed Description

template<typename T>
class pongasoft::VST::GUI::VstParamDef< T >

Typed parameter definition.

Template Parameters
Tthe underlying type of the param

Member Typedef Documentation

◆ ParamType

using ParamType = T

Constructor & Destructor Documentation

◆ VstParamDef()

VstParamDef ( ParamID const  iParamID,
VstString16  iTitle,
VstString16  iUnits,
ParamType const  iDefaultValue,
int32 const  iFlags,
UnitID const  iUnitID,
VstString16  iShortTitle,
int32 const  iPrecision,
Owner const  iOwner,
bool const  iTransient,
int16 const  iDeprecatedSince,
std::shared_ptr< IParamConverter< ParamType >>  iConverter 
)
inline

Member Function Documentation

◆ denormalize()

ParamType denormalize ( ParamValue  iNormalizedValue) const
inline

◆ getDefaultValue()

ParamType getDefaultValue ( ) const
inline

◆ normalize()

ParamValue normalize ( ParamType const &  iValue) const
inline

◆ readFromState()

ParamType readFromState ( NormalizedState const &  iState) const
inline

Read the value from the (normalized) state.

◆ toString()

void toString ( ParamValue  iNormalizedValue,
String128  iString 
) const
inlineoverridevirtual

Using fConverter::toString

Reimplemented from RawVstParamDef.

◆ toUTF8String()

std::string toUTF8String ( ParamValue  iNormalizedValue,
int32  iPrecision 
) const
inlineoverridevirtual

Return the value as a utf-8 string.

Parameters
iNormalizedValuethe (normalized) value to process
iPrecisionif < 0 uses fPrecision otherwise use the one provided

Reimplemented from RawVstParamDef.

◆ writeToState()

tresult writeToState ( ParamType const &  iValue,
NormalizedState oState 
) const
inline

Writes the provided value to the (normalized) state.

Member Data Documentation

◆ fConverter

const std::shared_ptr<IParamConverter<ParamType> > fConverter

◆ fDefaultValue

const ParamType fDefaultValue

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