Jamba  3.2.0
pongasoft::VST::Parameters Class Reference

#include <Parameters.h>

Classes

class  IChangeListener
 
struct  JmbParamDefBuilder
 
struct  RawVstParamDefBuilder
 
struct  VstParamDefBuilder
 

Public Types

using ChangeCallback = std::function< void()>
 
template<typename Param >
using ChangeCallback1 = std::function< void(Param &)>
 
template<typename TView , typename Param >
using ChangeCallback2 = std::function< void(TView *, Param &)>
 

Public Member Functions

std::vector< ParamID > const & getAllRegistrationOrder () const
 
NormalizedState::SaveOrder const & getGUISaveStateOrder () const
 
std::shared_ptr< IJmbParamDefgetJmbParamDef (ParamID iParamID) const
 
std::shared_ptr< RawVstParamDefgetRawVstParamDef (ParamID iParamID) const
 
NormalizedState::SaveOrder const & getRTSaveStateOrder () const
 
std::vector< ParamID > const & getVstRegistrationOrder () const
 
template<typename ParamSerializer , typename... Args>
JmbParamDefBuilder< typename ParamSerializer::ParamType > jmb (ParamID iParamID, VstString16 iTitle, Args... iSerializerArgs)
 
template<typename T >
JmbParamDefBuilder< T > jmbFromType (ParamID iParamID, VstString16 iTitle)
 
virtual std::unique_ptr< NormalizedStatenewRTState () const
 
 Parameters ()=default
 
RawVstParamDefBuilder raw (ParamID iParamID, VstString16 iTitle)
 
virtual ParamValue readNormalizedValue (ParamID iParamID, IBStreamer &iStreamer) const
 
virtual tresult readRTState (IBStreamer &iStreamer, NormalizedState *oNormalizedState) const
 
void registerVstParameters (Vst::ParameterContainer &iParameterContainer) const
 
template<typename... Args>
tresult setGUISaveStateOrder (int16 iVersion, Args... args)
 
tresult setGUISaveStateOrder (NormalizedState::SaveOrder const &iSaveOrder)
 
template<typename... Args>
tresult setRTSaveStateOrder (int16 iVersion, Args... args)
 
tresult setRTSaveStateOrder (NormalizedState::SaveOrder const &iSaveOrder)
 
template<typename ParamConverter , typename... Args>
VstParamDefBuilder< typename ParamConverter::ParamType > vst (ParamID iParamID, VstString16 iTitle, Args... iConverterArgs)
 
template<typename T >
VstParamDefBuilder< T > vstFromType (ParamID iParamID, VstString16 iTitle)
 
virtual tresult writeRTState (NormalizedState const *iNormalizedState, IBStreamer &oStreamer) const
 
virtual ~Parameters ()=default
 

Protected Member Functions

RawVstParam add (RawVstParamDefBuilder const &iBuilder)
 
template<typename T >
VstParam< T > add (VstParamDefBuilder< T > const &iBuilder)
 
template<typename T >
JmbParam< T > add (JmbParamDefBuilder< T > const &iBuilder)
 
tresult addJmbParamDef (std::shared_ptr< IJmbParamDef > iParamDef)
 
tresult addVstParamDef (std::shared_ptr< RawVstParamDef > iParamDef)
 

Private Member Functions

tresult buildParamIDs (std::vector< ParamID > &iParamIDs)
 
template<typename... Args>
tresult buildParamIDs (std::vector< ParamID > &iParamIDs, ParamID id, Args... args)
 
template<typename... Args>
tresult buildParamIDs (std::vector< ParamID > &iParamIDs, std::shared_ptr< IJmbParamDef > &iParamDef, Args... args)
 
template<typename T , typename... Args>
tresult buildParamIDs (std::vector< ParamID > &iParamIDs, std::shared_ptr< JmbParamDef< T >> &iParamDef, Args... args)
 
template<typename ParamConverver , typename... Args>
tresult buildParamIDs (std::vector< ParamID > &iParamIDs, std::shared_ptr< VstParamDef< ParamConverver >> &iParamDef, Args... args)
 
template<typename... Args>
tresult buildParamIDs (std::vector< ParamID > &iParamIDs, std::shared_ptr< RawVstParamDef > &iParamDef, Args... args)
 

Private Attributes

std::vector< ParamID > fAllRegistrationOrder {}
 
NormalizedState::SaveOrder fGUISaveStateOrder {}
 
std::map< ParamID, std::shared_ptr< IJmbParamDef > > fJmbParams {}
 
NormalizedState::SaveOrder fRTSaveStateOrder {}
 
std::map< ParamID, std::shared_ptr< RawVstParamDef > > fVstParams {}
 
std::vector< ParamID > fVstRegistrationOrder {}
 

Friends

class Debug::ParamDisplay
 

Detailed Description

This is the class which maintains all the registered parameters

Member Typedef Documentation

◆ ChangeCallback

using pongasoft::VST::Parameters::ChangeCallback = std::function<void()>

A callback that will be invoked for changes. Note that unlike the IChangeListener, there is no parameter since it is expected to be used like this:

fMyParam = registerVstParam(myParamId, [this]() { .... ; });

◆ ChangeCallback1

template<typename Param >
using pongasoft::VST::Parameters::ChangeCallback1 = std::function<void(Param &)>

A callback which will be invoked for changes with the param as an argument.

◆ ChangeCallback2

template<typename TView , typename Param >
using pongasoft::VST::Parameters::ChangeCallback2 = std::function<void(TView *, Param &)>

A callback which will be invoked for changes with the view and param as arguments.

Constructor & Destructor Documentation

◆ Parameters()

pongasoft::VST::Parameters::Parameters ( )
explicitdefault

◆ ~Parameters()

virtual pongasoft::VST::Parameters::~Parameters ( )
virtualdefault

Member Function Documentation

◆ add() [1/3]

RawVstParam pongasoft::VST::Parameters::add ( RawVstParamDefBuilder const &  iBuilder)
protected

◆ add() [2/3]

template<typename T >
VstParam< T > pongasoft::VST::Parameters::add ( VstParamDefBuilder< T > const &  iBuilder)
protected

◆ add() [3/3]

template<typename T >
JmbParam< T > pongasoft::VST::Parameters::add ( Parameters::JmbParamDefBuilder< T > const &  iBuilder)
protected

◆ addJmbParamDef()

tresult pongasoft::VST::Parameters::addJmbParamDef ( std::shared_ptr< IJmbParamDef iParamDef)
protected

◆ addVstParamDef()

tresult pongasoft::VST::Parameters::addVstParamDef ( std::shared_ptr< RawVstParamDef iParamDef)
protected

◆ buildParamIDs() [1/6]

tresult pongasoft::VST::Parameters::buildParamIDs ( std::vector< ParamID > &  iParamIDs)
inlineprivate

◆ buildParamIDs() [2/6]

template<typename... Args>
tresult pongasoft::VST::Parameters::buildParamIDs ( std::vector< ParamID > &  iParamIDs,
ParamID  id,
Args...  args 
)
private

◆ buildParamIDs() [3/6]

template<typename... Args>
tresult pongasoft::VST::Parameters::buildParamIDs ( std::vector< ParamID > &  iParamIDs,
std::shared_ptr< IJmbParamDef > &  iParamDef,
Args...  args 
)
inlineprivate

◆ buildParamIDs() [4/6]

template<typename T , typename... Args>
tresult pongasoft::VST::Parameters::buildParamIDs ( std::vector< ParamID > &  iParamIDs,
std::shared_ptr< JmbParamDef< T >> &  iParamDef,
Args...  args 
)
inlineprivate

◆ buildParamIDs() [5/6]

template<typename ParamConverver , typename... Args>
tresult pongasoft::VST::Parameters::buildParamIDs ( std::vector< ParamID > &  iParamIDs,
std::shared_ptr< VstParamDef< ParamConverver >> &  iParamDef,
Args...  args 
)
inlineprivate

◆ buildParamIDs() [6/6]

template<typename... Args>
tresult pongasoft::VST::Parameters::buildParamIDs ( std::vector< ParamID > &  iParamIDs,
std::shared_ptr< RawVstParamDef > &  iParamDef,
Args...  args 
)
inlineprivate

◆ getAllRegistrationOrder()

std::vector<ParamID> const& pongasoft::VST::Parameters::getAllRegistrationOrder ( ) const
inline

◆ getGUISaveStateOrder()

NormalizedState::SaveOrder const& pongasoft::VST::Parameters::getGUISaveStateOrder ( ) const
inline
Returns
the order used when saving the GUI state (getState/setState in the controller)

◆ getJmbParamDef()

std::shared_ptr< IJmbParamDef > pongasoft::VST::Parameters::getJmbParamDef ( ParamID  iParamID) const

◆ getRawVstParamDef()

std::shared_ptr< RawVstParamDef > pongasoft::VST::Parameters::getRawVstParamDef ( ParamID  iParamID) const

◆ getRTSaveStateOrder()

NormalizedState::SaveOrder const& pongasoft::VST::Parameters::getRTSaveStateOrder ( ) const
inline
Returns
the order used when saving the RT state (getState/setState in the processor, setComponentState in the controller)

◆ getVstRegistrationOrder()

std::vector<ParamID> const& pongasoft::VST::Parameters::getVstRegistrationOrder ( ) const
inline

◆ jmb()

template<typename ParamSerializer , typename... Args>
Parameters::JmbParamDefBuilder< typename ParamSerializer::ParamType > pongasoft::VST::Parameters::jmb ( ParamID  iParamID,
VstString16  iTitle,
Args...  iSerializerArgs 
)

Used from derived classes to build a non vst parameter (not convertible to a ParamValue)

◆ jmbFromType()

template<typename T >
Parameters::JmbParamDefBuilder< T > pongasoft::VST::Parameters::jmbFromType ( ParamID  iParamID,
VstString16  iTitle 
)

Used from derived classes to build a non vst parameter (not convertible to a ParamValue). Use this version if you want to provide a different serializer.

◆ newRTState()

std::unique_ptr< NormalizedState > pongasoft::VST::Parameters::newRTState ( ) const
virtual
Returns
a new normalized state for RT (can be overridden to return a subclass!)

◆ raw()

Parameters::RawVstParamDefBuilder pongasoft::VST::Parameters::raw ( ParamID  iParamID,
VstString16  iTitle 
)

Used from derived classes to build a parameter backed by a raw VST parameter

◆ readNormalizedValue()

ParamValue pongasoft::VST::Parameters::readNormalizedValue ( ParamID  iParamID,
IBStreamer &  iStreamer 
) const
virtual
Returns
normalized value read from the stream for the given parameter

◆ readRTState()

tresult pongasoft::VST::Parameters::readRTState ( IBStreamer &  iStreamer,
NormalizedState oNormalizedState 
) const
virtual

This method is called to read the RTState from the stream

Todo:
handle multiple versions

◆ registerVstParameters()

void pongasoft::VST::Parameters::registerVstParameters ( Vst::ParameterContainer &  iParameterContainer) const

This method is called from the GUI controller to register all the parameters to the ParameterContainer class which is the class managing the parameters in the vst sdk

◆ setGUISaveStateOrder() [1/2]

template<typename... Args>
tresult pongasoft::VST::Parameters::setGUISaveStateOrder ( int16  iVersion,
Args...  args 
)

Used to change the default order (registration order) used when saving the GUI state (getState/setState in the controller)

Parameters
iVersionshould be a >= 0 number. If negative it will be ignored
argscan be any combination of ParamID, RawVstParamDef, VstParamDef, JmbParamDef

◆ setGUISaveStateOrder() [2/2]

tresult pongasoft::VST::Parameters::setGUISaveStateOrder ( NormalizedState::SaveOrder const &  iSaveOrder)

Used to change the default order (registration order) used when saving the GUI state (getState/setState in the controller)

◆ setRTSaveStateOrder() [1/2]

template<typename... Args>
tresult pongasoft::VST::Parameters::setRTSaveStateOrder ( int16  iVersion,
Args...  args 
)

Used to change the default order (registration order) used when saving the RT state (getState/setState in the processor, setComponentState in the controller)

Parameters
iVersionshould be a >= 0 number. If negative it will be ignored
argscan be any combination of ParamID, RawVstParamDef, VstParamDef, JmbParamDef

◆ setRTSaveStateOrder() [2/2]

tresult pongasoft::VST::Parameters::setRTSaveStateOrder ( NormalizedState::SaveOrder const &  iSaveOrder)

Used to change the default order (registration order) used when saving the RT state (getState/setState in the processor, setComponentState in the controller)

◆ vst()

template<typename ParamConverter , typename... Args>
Parameters::VstParamDefBuilder< typename ParamConverter::ParamType > pongasoft::VST::Parameters::vst ( ParamID  iParamID,
VstString16  iTitle,
Args...  iConverterArgs 
)

Used from derived classes to build a parameter backed by a VST parameter

◆ vstFromType()

template<typename T >
Parameters::VstParamDefBuilder< T > pongasoft::VST::Parameters::vstFromType ( ParamID  iParamID,
VstString16  iTitle 
)

Used from derived classes to build a parameter backed by a VST parameter. Use this version if you want to provide a different converter.

◆ writeRTState()

tresult pongasoft::VST::Parameters::writeRTState ( NormalizedState const *  iNormalizedState,
IBStreamer &  oStreamer 
) const
virtual

This method is called to write the NormalizedState to the stream

Friends And Related Function Documentation

◆ Debug::ParamDisplay

friend class Debug::ParamDisplay
friend

Member Data Documentation

◆ fAllRegistrationOrder

std::vector<ParamID> pongasoft::VST::Parameters::fAllRegistrationOrder {}
private

◆ fGUISaveStateOrder

NormalizedState::SaveOrder pongasoft::VST::Parameters::fGUISaveStateOrder {}
private

◆ fJmbParams

std::map<ParamID, std::shared_ptr<IJmbParamDef> > pongasoft::VST::Parameters::fJmbParams {}
private

◆ fRTSaveStateOrder

NormalizedState::SaveOrder pongasoft::VST::Parameters::fRTSaveStateOrder {}
private
Todo:
Handle multiple versions with upgrade

◆ fVstParams

std::map<ParamID, std::shared_ptr<RawVstParamDef> > pongasoft::VST::Parameters::fVstParams {}
private

◆ fVstRegistrationOrder

std::vector<ParamID> pongasoft::VST::Parameters::fVstRegistrationOrder {}
private

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