libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::CpuLoadMeter Class Reference

#include <CpuLoadMeter.h>

Public Member Functions

 CpuLoadMeter ()
 
void Init (float sampleRateInHz, int blockSizeInSamples, float smoothingFilterCutoffHz=1.0f)
 
void OnBlockStart ()
 
void OnBlockEnd ()
 
float GetAvgCpuLoad () const
 
float GetMinCpuLoad () const
 
float GetMaxCpuLoad () const
 
void Reset ()
 

Constructor & Destructor Documentation

◆ CpuLoadMeter()

daisy::CpuLoadMeter::CpuLoadMeter ( )
inline

Member Function Documentation

◆ GetAvgCpuLoad()

float daisy::CpuLoadMeter::GetAvgCpuLoad ( ) const
inline

Returns the smoothed average CPU load in the range 0..1

◆ GetMaxCpuLoad()

float daisy::CpuLoadMeter::GetMaxCpuLoad ( ) const
inline

Returns the maximum CPU load observed since the last call to Reset().

◆ GetMinCpuLoad()

float daisy::CpuLoadMeter::GetMinCpuLoad ( ) const
inline

Returns the minimun CPU load observed since the last call to Reset().

◆ Init()

void daisy::CpuLoadMeter::Init ( float  sampleRateInHz,
int  blockSizeInSamples,
float  smoothingFilterCutoffHz = 1.0f 
)
inline

Initializes the CpuLoadMeter for a particular sample rate and block size.

Parameters
sampleRateInHzThe sample rate in Hz
blockSizeInSamplesThe block size in samples
smoothingFilterCutoffHzThe cutoff frequency of the smoothing filter that's used to create the average CPU load reading.

◆ OnBlockEnd()

void daisy::CpuLoadMeter::OnBlockEnd ( )
inline

Call this at the end of your audio callback

◆ OnBlockStart()

void daisy::CpuLoadMeter::OnBlockStart ( )
inline

Call this at the beginning of your audio callback

◆ Reset()

void daisy::CpuLoadMeter::Reset ( )
inline

Resets the minimun, maximum and average load readings.


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