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

#include <audio/node/levelmeternode.h>

Public Types

enum  Type { PEAK, RMS }
 

Public Member Functions

 LevelMeterNode (NodeManager &nodeManager, TimeValue analysisWindowSize=10, bool rootProcess=true)
 
virtual ~LevelMeterNode ()
 
float getLevel ()
 
void setType (Type type)
 
void process () override
 
void sampleRateChanged (float sampleRate) override
 
- 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

InputPin input = {this}
 

Additional Inherited Members

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

Description

Node to measure the amplitude level of an audio signal. Can be used for VU meters or envelope followers for example. Can switch between measuring peaks of the signal or the root mean square.

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

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
PEAK 
RMS 

Constructor & Destructor Documentation

◆ LevelMeterNode()

LevelMeterNode ( NodeManager nodeManager,
TimeValue  analysisWindowSize = 10,
bool  rootProcess = true 
)
Parameters
nodeManagerthe node manager
analysisWindowSizethe time window in milliseconds that will be used to generate one single output value. Also the period that corresponds to the analysis frequency.
rootProcessindicates that the node is registered as root process with the AudioNodeManager and is processed automatically.

◆ ~LevelMeterNode()

virtual ~LevelMeterNode ( )
virtual

Member Function Documentation

◆ getLevel()

float getLevel ( )
Returns
: The current level of the analyzed signal.

◆ process()

void process ( )
overridevirtual

Has to be overwritted by descendants to specify the actual process.

Reimplemented from Node.

◆ sampleRateChanged()

void sampleRateChanged ( float  sampleRate)
overridevirtual

Called whenever the sample rate that the node system runs on changes. Can be overwritten to respond to changes

Parameters
sampleRatethen new sample rate

Reimplemented from Process.

◆ setType()

void setType ( Type  type)

Set the Type of the analysis. PEAK means the highest absolute amplitude within the analyzed window will be output. RMS means the root mean square of all values within the analyzed window will be output.

Member Data Documentation

◆ input

InputPin input = {this}

The input for the audio signal that will be analyzed.