:)
Loading...
Searching...
No Matches
RustyModulator Class Referenceabstract

PARENT - Modulator unit (RustyModulators) parent class. More...

#include <RustyModulator.hpp>

Inheritance diagram for RustyModulator:
RustyLFO

Public Member Functions

virtual double getCurrentValue ()=0
 Returns a modulator value for use on a RustyProcessor.
 
virtual void updateState ()=0
 Update modulator state and iterate forward a step.
 
virtual void setParameter (std::string parameter, std::string value)=0
 Sets RustyModulator parameter to new value.
 
void addReference ()
 Tells RustyModulator that a RustyProcessor has been attached.
 
void removeReference ()
 Tells RustyModulator that a RustyProcessor has been removed.
 
void usedByProcessor ()
 Called after every modulator read.
 
bool isNumeric (const std::string &str)
 Function to test if value contains numeric characters.
 
virtual std::string getModulatorType ()=0
 Function to get modulator type.
 
virtual std::string getParams ()=0
 Function to get modulator params.
 

Protected Attributes

int _refCount = 0
 Count of RustyProcessors that modulator is attached to.
 
int _useCount = 0
 Count of RustyProcessors usage at that moment in time.
 

Detailed Description

PARENT - Modulator unit (RustyModulators) parent class.

Standardises modulator behaviour within the library. All modulator classes inherit from this base class.

RustyModulator uses getCurrentValue() to return the current position of the modulator and then updateState() to iterate the modulator one step when all processors that are attached to the modulator have used that value.

Definition at line 26 of file RustyModulator.hpp.

Constructor & Destructor Documentation

◆ ~RustyModulator()

virtual RustyModulator::~RustyModulator ( )
inlinevirtual

Definition at line 29 of file RustyModulator.hpp.

Member Function Documentation

◆ getCurrentValue()

virtual double RustyModulator::getCurrentValue ( )
pure virtual

Returns a modulator value for use on a RustyProcessor.


This pure virtual function will get the state of the modulator at that moment in time. Ie. LFO position.

Returns
Double corresponding to a modulator position.

Implemented in RustyLFO.

◆ updateState()

virtual void RustyModulator::updateState ( )
pure virtual

Update modulator state and iterate forward a step.


This function iterates the modulator. This isn't called directly by any RustyProcessor but is instead called from within the RustyModulator when it has been informed that all attached processors have used the modulator.

See also
usedByProcessor()

Implemented in RustyLFO.

◆ setParameter()

virtual void RustyModulator::setParameter ( std::string  parameter,
std::string  value 
)
pure virtual

Sets RustyModulator parameter to new value.


This is pure virtual function that assigns a new value to a parameter of RustyModulator derived units. This function is used at runtime from CLI interaction.

Parameters
parameterString of the parameter to affect.
modulatorPointer to instance of RustyModulator.

Implemented in RustyLFO.

◆ addReference()

void RustyModulator::addReference ( )
inline

Tells RustyModulator that a RustyProcessor has been attached.


This function keeps track of how many processor units have parameters bound to an instance of a RustyModulator derived class. This is so update state isn't called after every read of the RustyModulator.

See also
removeReference()
updateState()
usedByProcessor()

Definition at line 79 of file RustyModulator.hpp.

◆ removeReference()

void RustyModulator::removeReference ( )
inline

Tells RustyModulator that a RustyProcessor has been removed.


This function removes a processor reference. This function isn't actually used at any point but was added to allow for expansion in the future.

See also
removeReference()
updateState()
usedByProcessor()

Definition at line 92 of file RustyModulator.hpp.

◆ usedByProcessor()

void RustyModulator::usedByProcessor ( )
inline

Called after every modulator read.


This function keeps track of whether all RustyProcessors have read the RustyModulator at that point in time. This was necessary as if there was more than one processor using the same LFO, how else would it know when to update.

See also
removeReference()
updateState()
usedByProcessor()

Definition at line 107 of file RustyModulator.hpp.

◆ isNumeric()

bool RustyModulator::isNumeric ( const std::string &  str)
inline

Function to test if value contains numeric characters.

Function takes a const reference to string and checks it's component chars with std::isDigit(). If there are any values that are non-numeric and could cause a conversion error at runtime the function return false. Else it returns true.

Parameters
strConstant reference of a string.
Returns
Returns true if string characters are numerical.

Definition at line 126 of file RustyModulator.hpp.

◆ getModulatorType()

virtual std::string RustyModulator::getModulatorType ( )
pure virtual

Function to get modulator type.


Simple function allows CLI to test modulator types for user interaction.

Returns
Returns string of RustyModulator child type.

Implemented in RustyLFO.

◆ getParams()

virtual std::string RustyModulator::getParams ( )
pure virtual

Function to get modulator params.


Simple function allows CLI to get available params for RustyModulator child.

Returns
Returns string of parameters available for RustyModulator child.

Implemented in RustyLFO.

Member Data Documentation

◆ _refCount

int RustyModulator::_refCount = 0
protected

Count of RustyProcessors that modulator is attached to.

Definition at line 156 of file RustyModulator.hpp.

◆ _useCount

int RustyModulator::_useCount = 0
protected

Count of RustyProcessors usage at that moment in time.

Definition at line 157 of file RustyModulator.hpp.


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