Switchboard SDK
Loading...
Searching...
No Matches
switchboard::Parameter Class Referenceabstract

Parameter class. Represents an adjustable config value in an audio node. More...

#include <Parameter.hpp>

Inheritance diagram for switchboard::Parameter:
switchboard::BoolParameter switchboard::FloatParameter switchboard::IntParameter switchboard::StringParameter switchboard::UIntParameter switchboard::BoolCallbackParameter< T > switchboard::BoolPointerParameter switchboard::BoolStoredParameter switchboard::FloatCallbackParameter< T > switchboard::FloatPointerParameter switchboard::FloatStoredParameter switchboard::IntCallbackParameter< T > switchboard::IntPointerParameter switchboard::IntStoredParameter switchboard::StringCallbackParameter< T > switchboard::StringPointerParameter switchboard::StringStoredParameter switchboard::UIntCallbackParameter< T > switchboard::UIntPointerParameter switchboard::UIntStoredParameter

Public Types

enum class  Type {
  Float , Bool , Int , UInt ,
  String
}
 

Public Member Functions

 Parameter (const Type type, const std::string &id, const std::string &name, const std::string &description)
 Construct a new Parameter object.
 
virtual ~Parameter ()=default
 Parameter destructor.
 
Type getType () const
 Gets the type of the parameter.
 
const std::string & getID () const
 Gets the unique identifier of the parameter.
 
const std::string & getName () const
 Gets the name of the parameter.
 
const std::string & getDescription () const
 Gets the description of the parameter.
 
virtual void setValue (std::any newValue)=0
 Sets the value of the parameter.
 

Protected Attributes

Type type
 
std::string id
 
std::string name
 
std::string description
 

Detailed Description

Parameter class. Represents an adjustable config value in an audio node.

Constructor & Destructor Documentation

◆ Parameter()

switchboard::Parameter::Parameter ( const Type type,
const std::string & id,
const std::string & name,
const std::string & description )

Construct a new Parameter object.

Parameters
typeThe type of the parameter.
idThe unique identifier of the parameter.
nameThe name of the parameter.
descriptionThe description of the parameter.

Member Function Documentation

◆ getDescription()

const std::string & switchboard::Parameter::getDescription ( ) const

Gets the description of the parameter.

Returns
The description of the parameter.

◆ getID()

const std::string & switchboard::Parameter::getID ( ) const

Gets the unique identifier of the parameter.

Returns
The unique identifier of the parameter.

◆ getName()

const std::string & switchboard::Parameter::getName ( ) const

Gets the name of the parameter.

Returns
The name of the parameter.

◆ getType()

Parameter::Type switchboard::Parameter::getType ( ) const

Gets the type of the parameter.

Returns
The type of the parameter.

◆ setValue()

virtual void switchboard::Parameter::setValue ( std::any newValue)
pure virtual

Sets the value of the parameter.

Parameters
newValueThe new value for the parameter.

Implemented in switchboard::BoolParameter, switchboard::FloatParameter, switchboard::IntParameter, switchboard::StringParameter, and switchboard::UIntParameter.