NAP
Public Member Functions | Public Attributes | List of all members
ControlNode Class Reference

#include <audio/node/controlnode.h>

Public Member Functions

 ControlNode (NodeManager &manager)
 
void setValue (ControllerValue value)
 
ControllerValue getValue () const
 
ControllerValue getRawValue () const
 
void ramp (ControllerValue destination, TimeValue time, RampMode mode=RampMode::Linear)
 
bool isRamping () const
 
void stop ()
 
void setTranslator (SafePtr< Translator< ControllerValue >> &translator)
 
bool hasTranslator () const
 
- Public Member Functions inherited from Node
 Node (NodeManager &manager)
 
const std::set< OutputPin * > & getOutputs () const
 
const std::set< InputPinBase * > & getInputs () const
 
- Public Member Functions inherited from Process
 Process (NodeManager &nodeManager)
 
 Process (ParentProcess &parent)
 
 Process (const Process &)=delete
 
Processoperator= (const Process &)=delete
 
virtual ~Process ()
 
void update ()
 
NodeManagergetNodeManager () const
 
int getBufferSize () const
 
float getSampleRate () const
 
DiscreteTimeValue getSampleTime () const
 

Public Attributes

OutputPin output = {this}
 
nap::Signal< ControlNode & > rampFinishedSignal
 

Additional Inherited Members

- Protected Member Functions inherited from Node
SampleBuffergetOutputBuffer (OutputPin &output)
 
- Protected Member Functions inherited from Process
virtual void sampleRateChanged (float sampleRate)
 
virtual void bufferSizeChanged (int bufferSize)
 
bool isRegisteredWithNodeManager () const
 

Description

Used to generate a control signal by ramping between different values. Ramps can be either linear or exponential. Optionally a lookup table can be used to shape the output signal.

Inheritance diagram for ControlNode:
[legend]
Collaboration diagram for ControlNode:
[legend]

Constructor & Destructor Documentation

◆ ControlNode()

ControlNode ( NodeManager manager)
Parameters
managerNodeManager this node runs on

Member Function Documentation

◆ getRawValue()

ControllerValue getRawValue ( ) const
Returns
the output value bypassing the loopkup translator.

◆ getValue()

ControllerValue getValue ( ) const
Returns
the output value, optionally shaped by the lookup translator.

◆ hasTranslator()

bool hasTranslator ( ) const
Returns
: wether this node uses a translator lookup table to shape it's output values.

◆ isRamping()

bool isRamping ( ) const
Returns
: wether the object is currently ramping to a new value.

◆ ramp()

void ramp ( ControllerValue  destination,
TimeValue  time,
RampMode  mode = RampMode::Linear 
)

Starts a ramp

Parameters
destinationthe destination value of the ramp
timein milliseconds to reach the destination
modechoose between linear or exponential curvature

◆ setTranslator()

void setTranslator ( SafePtr< Translator< ControllerValue >> &  translator)

Assign a translator to this node to shape the output value.

◆ setValue()

void setValue ( ControllerValue  value)

Order the node's output to start ramping to the specified value using the current ramp time.

◆ stop()

void stop ( )

Stops the current ramp (if any) and stays on the current value.

Member Data Documentation

◆ output

OutputPin output = {this}

The output signal pin

◆ rampFinishedSignal

nap::Signal<ControlNode&> rampFinishedSignal

Signal that is emitted when the destination of a ramp has been reached.