arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
audio_tools::CachedVolumeControl Class Reference

In order to optimize the processing time we cache the last input & factor and recalculate the new factor only if the input has changed. More...

#include <VolumeControl.h>

Inheritance diagram for audio_tools::CachedVolumeControl:
audio_tools::VolumeControl

Public Member Functions

 CachedVolumeControl (VolumeControl &vc)
 
 CachedVolumeControl (VolumeControl *vc)
 
virtual float getVolumeFactor (float volume)
 determines a multiplication factor (0.0 to 1.0) from an input value (0.0 to 1.0). More...
 
void setVolumeControl (VolumeControl &vc)
 
virtual float getVolumeFactor (float volume)=0
 determines a multiplication factor (0.0 to 1.0) from an input value (0.0 to 1.0). More...
 

Protected Attributes

float in =1.0
 
float out =1.0
 
VolumeControlp_vc =nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from audio_tools::VolumeControl
virtual float limit (float in)
 limits the output to the range of 0 to 1.0
 
float map (float x, float in_min, float in_max, float out_min, float out_max)
 similar to the Arduino map function - but using floats
 

Detailed Description

In order to optimize the processing time we cache the last input & factor and recalculate the new factor only if the input has changed.

Author
Phil Schatzmann

Member Function Documentation

◆ getVolumeFactor()

virtual float audio_tools::CachedVolumeControl::getVolumeFactor ( float  volume)
inlinevirtual

determines a multiplication factor (0.0 to 1.0) from an input value (0.0 to 1.0).

Implements audio_tools::VolumeControl.


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