Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
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 class  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.
void toString (ParamValue iNormalizedValue, String128 iString) const override
 Using fConverter::toString.
std::string toUTF8String (ParamValue iNormalizedValue, int32 iPrecision) const override
 Return the value as a utf-8 string.
 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.
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.
ParamValue readFromStream (IBStreamer &iStreamer) const
tresult writeToState (ParamValue iValue, NormalizedState &oState) const
 Writes the provided value to the (normalized) state.
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).
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.

Detailed Description

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

Typed parameter definition.

Template Parameters
Tthe underlying type of the param

Member Typedef Documentation

◆ ParamType

template<typename T>
using ParamType = T

Constructor & Destructor Documentation

◆ VstParamDef()

template<typename T>
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()

template<typename T>
ParamType denormalize ( ParamValue iNormalizedValue) const
inline

◆ getDefaultValue()

template<typename T>
ParamType getDefaultValue ( ) const
inline

◆ normalize()

template<typename T>
ParamValue normalize ( ParamType const & iValue) const
inline

◆ readFromState()

template<typename T>
ParamType readFromState ( NormalizedState const & iState) const
inline

Read the value from the (normalized) state.

◆ toString()

template<typename T>
void toString ( ParamValue iNormalizedValue,
String128 iString ) const
inlineoverridevirtual

Using fConverter::toString.

Reimplemented from RawVstParamDef.

◆ toUTF8String()

template<typename T>
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()

template<typename T>
tresult writeToState ( ParamType const & iValue,
NormalizedState & oState ) const
inline

Writes the provided value to the (normalized) state.

Member Data Documentation

◆ fConverter

template<typename T>
const std::shared_ptr<IParamConverter<ParamType> > fConverter

◆ fDefaultValue

template<typename T>
const ParamType fDefaultValue

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