OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
juce::AudioProcessLoadMeasurer Class Reference

`#include <juce_AudioProcessLoadMeasurer.h>`

## Classes
struct | ScopedTimer

## Public Member Functions
| ~AudioProcessLoadMeasurer ()
void | reset ()
void | reset (double sampleRate, int blockSize)
double | getLoadAsProportion () const
double | getLoadAsPercentage () const
int | getXRunCount () const
void | registerBlockRenderTime (double millisecondsTaken)
void | registerRenderTime (double millisecondsTaken, int numSamples)

## Detailed Description

Maintains an ongoing measurement of the proportion of time which is being spent inside an audio callback.

Definition at line 33 of file juce_AudioProcessLoadMeasurer.h.

## Constructor & Destructor Documentation

## ◆ ~AudioProcessLoadMeasurer()

juce::AudioProcessLoadMeasurer::~AudioProcessLoadMeasurer | ( |  | ) |
| default

Destructor.

## Member Function Documentation

## ◆ getLoadAsPercentage()

double juce::AudioProcessLoadMeasurer::getLoadAsPercentage | ( |  | ) | const

Returns the current load as a percentage 0 to 100.0

Definition at line 77 of file juce_AudioProcessLoadMeasurer.cpp.

## ◆ getLoadAsProportion()

double juce::AudioProcessLoadMeasurer::getLoadAsProportion | ( |  | ) | const

Returns the current load as a proportion 0 to 1.0

Definition at line 76 of file juce_AudioProcessLoadMeasurer.cpp.

Referenced by juce::AudioDeviceManager::getCpuUsage(), and getLoadAsPercentage().

## ◆ getXRunCount()

int juce::AudioProcessLoadMeasurer::getXRunCount | ( |  | ) | const

Returns the number of over- (or under-) runs recorded since the state was reset.

Definition at line 79 of file juce_AudioProcessLoadMeasurer.cpp.

Referenced by juce::AudioDeviceManager::getXRunCount().

## ◆ registerBlockRenderTime()

void juce::AudioProcessLoadMeasurer::registerBlockRenderTime | ( | double | millisecondsTaken | ) |

Can be called manually to add the time of a callback to the stats. Normally you probably would never call this - it's simpler and more robust to use a ScopedTimer to measure the time using an RAII pattern.

Definition at line 45 of file juce_AudioProcessLoadMeasurer.cpp.

## ◆ registerRenderTime()

void juce::AudioProcessLoadMeasurer::registerRenderTime | ( | double | millisecondsTaken,
|  | int | numSamples )

Can be called manually to add the time of a callback to the stats. Normally you probably would never call this - it's simpler and more robust to use a ScopedTimer to measure the time using an RAII pattern.

Definition at line 53 of file juce_AudioProcessLoadMeasurer.cpp.

## ◆ reset() [1/2]

void juce::AudioProcessLoadMeasurer::reset | ( |  | ) |

Resets the state.

Definition at line 29 of file juce_AudioProcessLoadMeasurer.cpp.

Referenced by juce::AudioDeviceManager::closeAudioDevice(), and reset().

## ◆ reset() [2/2]

void juce::AudioProcessLoadMeasurer::reset | ( | double | sampleRate,
|  | int | blockSize )

Resets the counter, in preparation for use with the given sample rate and block size.

Definition at line 34 of file juce_AudioProcessLoadMeasurer.cpp.

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

- juce_AudioProcessLoadMeasurer.h
- juce_AudioProcessLoadMeasurer.cpp