Switchboard SDK
Loading...
Searching...
No Matches
switchboard::GeneratorNode Class Reference

Generates a specified signal to the output. More...

#include <GeneratorNode.hpp>

Inheritance diagram for switchboard::GeneratorNode:

Public Member Functions

 GeneratorNode (GeneratorType generatorType)
 Creates a GeneratorNode instance.
 
float getFrequency () const
 Gets the current frequency value of the generated signal.
 
void setFrequency (const float frequency)
 Sets the frequency of the generated signal.
 
float getAmplitude () const
 Gets the current amplitude value of the generated signal.
 
void setAmplitude (const float amplitude)
 Sets the amplitude of the generated signal.
 
float getDutyCycle () const
 Gets the current duty cycle of the generated signal.
 
void setDutyCycle (const float dutyCycle)
 Sets the duty cycle of the generated signal.
 
bool setBusFormat (AudioBusFormat &busFormat) override
 
bool produce (AudioBus &bus) override
 

Detailed Description

Generates a specified signal to the output.

GeneratorNode class

Constructor & Destructor Documentation

◆ GeneratorNode()

switchboard::GeneratorNode::GeneratorNode ( GeneratorType generatorType)

Creates a GeneratorNode instance.

Parameters
generatorTypeThe type of the generator.

Member Function Documentation

◆ getAmplitude()

float switchboard::GeneratorNode::getAmplitude ( ) const

Gets the current amplitude value of the generated signal.

Returns
The amplitude value.

◆ getDutyCycle()

float switchboard::GeneratorNode::getDutyCycle ( ) const

Gets the current duty cycle of the generated signal.

Note
Only used by square wave generator.
Returns
The duty cycle value.

◆ getFrequency()

float switchboard::GeneratorNode::getFrequency ( ) const

Gets the current frequency value of the generated signal.

Note
No effect on noise generators.
Returns
The frequency value in Hz.

◆ setAmplitude()

void switchboard::GeneratorNode::setAmplitude ( const float amplitude)

Sets the amplitude of the generated signal.

Parameters
amplitudeThe new amplitude value. Should be between 0 and 1.

◆ setDutyCycle()

void switchboard::GeneratorNode::setDutyCycle ( const float dutyCycle)

Sets the duty cycle of the generated signal.

Note
Only used by square wave generator.
Parameters
dutyCycleThe new duty cycle value. Should be between 0 and 1.

◆ setFrequency()

void switchboard::GeneratorNode::setFrequency ( const float frequency)

Sets the frequency of the generated signal.

Note
No effect on noise generators.
Parameters
frequencyThe new frequency value in Hz.