MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostly_harmless::Parameter< SampleType > Struct Template Referencefinal

Container class for a single parameter. More...

#include <mostlyharmless_Parameters.h>

Public Member Functions

 Parameter (ParameterID parameterId_, std::string_view name_, std::string_view category_, marvin::utils::Range< SampleType > range_, SampleType defaultValue_, std::uint32_t flags_)
 
 Parameter (std::uint32_t pid_, std::string_view name_, std::string_view category_, marvin::utils::Range< SampleType > range_, SampleType defaultValue_, std::uint32_t flags_)
 

Public Attributes

std::uint32_t pid
 
std::string name
 
std::string category
 
marvin::utils::Range< SampleType > range
 
SampleType defaultValue
 
std::uint32_t flags
 
std::function< std::string(const Parameter &, double)> valueToString { nullptr }
 
SampleType value { defaultValue }
 

Detailed Description

template<marvin::FloatType SampleType>
struct mostly_harmless::Parameter< SampleType >

Container class for a single parameter.

Constructor & Destructor Documentation

◆ Parameter() [1/2]

template<marvin::FloatType SampleType>
mostly_harmless::Parameter< SampleType >::Parameter ( ParameterID parameterId_,
std::string_view name_,
std::string_view category_,
marvin::utils::Range< SampleType > range_,
SampleType defaultValue_,
std::uint32_t flags_ )

Creates a Parameter, setting the pid field based on a ParameterID instance. We'd recommend using this constructor, but the other overload is available if you want custom logic for your PIDs.

Parameters
parameterId_A ParameterID constructed with the unique internal name for your parameter. If you want to remain backwards compatible, make sure these strings do not change, and are unique.
name_The parameter's user-facing name.
category_The parameter's category - a clap feature supported by some hosts, to organise parameters in trees as opposed to an overwhelming flat list.
range_The parameter's range.
defaultValue_The parameter's default value.
flags_The parameter's clap param flags - see here for more details.

◆ Parameter() [2/2]

template<marvin::FloatType SampleType>
mostly_harmless::Parameter< SampleType >::Parameter ( std::uint32_t pid_,
std::string_view name_,
std::string_view category_,
marvin::utils::Range< SampleType > range_,
SampleType defaultValue_,
std::uint32_t flags_ )

Creates a Parameter, setting the pid directly from the pid_ arg. Most of the time, the other overload is preferable here, but if you really want to manage your own PIDs, use this one.

Parameters
pid_A unique uint32_t pid for your parameter. For backwards compatability, this must stay fixed, and must be unique.
name_The parameter's user-facing name.
category_The parameter's category - a clap feature supported by some hosts, to organise parameters in trees as opposed to an overwhelming flat list.
range_The parameter's range.
defaultValue_The parameter's default value.
flags_The parameter's clap param flags - see here for more details.

Member Data Documentation

◆ category

template<marvin::FloatType SampleType>
std::string mostly_harmless::Parameter< SampleType >::category

The parameter's category - a clap feature supported by some hosts, to organise parameters in trees as opposed to an overwhelming flat list.

◆ defaultValue

template<marvin::FloatType SampleType>
SampleType mostly_harmless::Parameter< SampleType >::defaultValue

The parameter's default value.

◆ flags

template<marvin::FloatType SampleType>
std::uint32_t mostly_harmless::Parameter< SampleType >::flags

The parameter's clap param flags - see here for more details.

◆ name

template<marvin::FloatType SampleType>
std::string mostly_harmless::Parameter< SampleType >::name

The parameter's user-facing name.

◆ pid

template<marvin::FloatType SampleType>
std::uint32_t mostly_harmless::Parameter< SampleType >::pid

The Parameter's internal ID, used for lookups, etc. CLAP requires that this stay fixed to avoid compatability issues, and it must be unique.

◆ range

template<marvin::FloatType SampleType>
marvin::utils::Range<SampleType> mostly_harmless::Parameter< SampleType >::range

The parameter's range.

◆ value

template<marvin::FloatType SampleType>
SampleType mostly_harmless::Parameter< SampleType >::value { defaultValue }

The parameter's internal value.

◆ valueToString

template<marvin::FloatType SampleType>
std::function<std::string(const Parameter&, double)> mostly_harmless::Parameter< SampleType >::valueToString { nullptr }

An optional user-provided function for custom value displaying.


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