ape  0.5.0
Audio Programming Environment
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ape::ParameterBase< Type, Derived > Class Template Reference

Shared functionality for all specializations of parameters.

See also
ParameterBase
More...

#include <parameter.h>

Inheritance diagram for ape::ParameterBase< Type, Derived >:
ape::UIObject

Public Member Functions

int id () const noexcept
 A unique identifier for this parameter More...
 
bool changed () const noexcept
 Whether the parameter has changed in this processing frame. Only sensible when called from within Processor::process More...
 
 operator Type () const noexcept
 Evaluate the value of the parameter at the start of this processing frame. More...
 
template<typename Index >
Type operator[] (Index idx) const noexcept
 Alias for at(). More...
 
template<typename Index >
Type at (Index idx) const noexcept
 Evaluate the value of the parameter at at a specific sample index, where 0 equals the start of the processing frame. More...
 
Derived & operator= (Type t) noexcept
 Assign a value to this parameter. Depending on host support, this might only make sense inside the constructor of a Effect or Generator (so it is a way of setting default / initial value of a parameter). More...
 
 ~ParameterBase ()
 Delete this parameter instance. More...
 
auto getRange () const noexcept
 Returns the Range this parameter was constructed with. More...
 

Static Public Member Functions

static Type convert (PFloat normalized) noexcept
 Convert an engine PFloat to the native Type of this parameter.

See also
representationFor
More...
 
static PFloat representationFor (Type value) noexcept
 Convert a native Type to an engine PFloat type.

See also
convert
More...
 

Protected Member Functions

 ParameterBase (const std::string_view paramName="", const Range parameterRange=Range())
 Constructs a named parameter. More...
 

Protected Attributes

APE_Parameter param
 
const Range range
 
std::string name
 

Detailed Description

template<class Type, class Derived>
class ape::ParameterBase< Type, Derived >

Shared functionality for all specializations of parameters.

See also
ParameterBase
Template Parameters
TypeAny type the Derived class can convert and automate.
See also
Param<float>
DerivedThe sub class of this that statically provides the following functions: convert representationFor

Constructor & Destructor Documentation

◆ ParameterBase()

template<class Type, class Derived>
ape::ParameterBase< Type, Derived >::ParameterBase ( const std::string_view  paramName = "",
const Range  parameterRange = Range() 
)
inlineprotected

Constructs a named parameter.

◆ ~ParameterBase()

template<class Type, class Derived>
ape::ParameterBase< Type, Derived >::~ParameterBase ( )
inline

Delete this parameter instance.

Member Function Documentation

◆ at()

template<class Type, class Derived>
template<typename Index >
Type ape::ParameterBase< Type, Derived >::at ( Index  idx) const
inlinenoexcept

Evaluate the value of the parameter at at a specific sample index, where 0 equals the start of the processing frame.

Only sensible when called from within Processor::process

◆ changed()

template<class Type, class Derived>
bool ape::ParameterBase< Type, Derived >::changed ( ) const
inlinenoexcept

Whether the parameter has changed in this processing frame. Only sensible when called from within Processor::process

Only sensible when called from within Processor::process

◆ convert()

template<class Type, class Derived>
static Type ape::ParameterBase< Type, Derived >::convert ( PFloat  normalized)
inlinestaticnoexcept

Convert an engine PFloat to the native Type of this parameter.

See also
representationFor

◆ getRange()

template<class Type, class Derived>
auto ape::ParameterBase< Type, Derived >::getRange ( ) const
inlinenoexcept

Returns the Range this parameter was constructed with.

◆ id()

template<class Type, class Derived>
int ape::ParameterBase< Type, Derived >::id ( ) const
inlinenoexcept

A unique identifier for this parameter

◆ operator Type()

template<class Type, class Derived>
ape::ParameterBase< Type, Derived >::operator Type ( ) const
inlinenoexcept

Evaluate the value of the parameter at the start of this processing frame.

Only sensible when called from within Processor::process

◆ operator=()

template<class Type, class Derived>
Derived& ape::ParameterBase< Type, Derived >::operator= ( Type  t)
inlinenoexcept

Assign a value to this parameter. Depending on host support, this might only make sense inside the constructor of a Effect or Generator (so it is a way of setting default / initial value of a parameter).

◆ operator[]()

template<class Type, class Derived>
template<typename Index >
Type ape::ParameterBase< Type, Derived >::operator[] ( Index  idx) const
inlinenoexcept

Alias for at().

◆ representationFor()

template<class Type, class Derived>
static PFloat ape::ParameterBase< Type, Derived >::representationFor ( Type  value)
inlinestaticnoexcept

Convert a native Type to an engine PFloat type.

See also
convert

Member Data Documentation

◆ name

template<class Type, class Derived>
std::string ape::ParameterBase< Type, Derived >::name
protected

◆ param

template<class Type, class Derived>
APE_Parameter ape::ParameterBase< Type, Derived >::param
protected

◆ range

template<class Type, class Derived>
const Range ape::ParameterBase< Type, Derived >::range
protected

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