OpenShot Library | libopenshot-audio
0.1.9
|
A base class for the smoothed value classes. More...
#include <juce_SmoothedValue.h>
Public Types | |
using | FloatType = typename FloatTypeHelper< SmoothedValueType >::Type |
Public Member Functions | |
SmoothedValueBase ()=default | |
Constructor. More... | |
bool | isSmoothing () const noexcept |
Returns true if the current value is currently being interpolated. More... | |
FloatType | getCurrentValue () const noexcept |
Returns the current value of the ramp. More... | |
FloatType | getTargetValue () const noexcept |
Returns the target value towards which the smoothed value is currently moving. More... | |
void | setCurrentAndTargetValue (FloatType newValue) |
Sets the current value and the target value. More... | |
void | applyGain (FloatType *samples, int numSamples) noexcept |
Applies a smoothed gain to a stream of samples S[i] *= gain. More... | |
void | applyGain (FloatType *samplesOut, const FloatType *samplesIn, int numSamples) noexcept |
Computes output as a smoothed gain applied to a stream of samples. More... | |
void | applyGain (AudioBuffer< FloatType > &buffer, int numSamples) noexcept |
Applies a smoothed gain to a buffer. | |
Protected Attributes | |
FloatType | currentValue = 0 |
FloatType | target = currentValue |
int | countdown = 0 |
A base class for the smoothed value classes.
This class is used to provide common functionality to the SmoothedValue and dsp::LogRampedValue classes.
Definition at line 40 of file juce_SmoothedValue.h.
|
default |
Constructor.
|
inlinenoexcept |
Returns true if the current value is currently being interpolated.
Definition at line 69 of file juce_SmoothedValue.h.
Referenced by juce::SmoothedValueBase< SmoothedValue< FloatType, SmoothingType > >::applyGain(), and juce::SmoothedValue< float >::getNextValue().
|
inlinenoexcept |
Returns the current value of the ramp.
Definition at line 72 of file juce_SmoothedValue.h.
|
inlinenoexcept |
Returns the target value towards which the smoothed value is currently moving.
Definition at line 76 of file juce_SmoothedValue.h.
|
inline |
Sets the current value and the target value.
newValue | the new value to take |
Definition at line 81 of file juce_SmoothedValue.h.
Referenced by juce::SmoothedValue< float >::reset(), juce::SmoothedValue< float >::setTargetValue(), and juce::SmoothedValue< float >::skip().
|
inlinenoexcept |
Applies a smoothed gain to a stream of samples S[i] *= gain.
samples | Pointer to a raw array of samples |
numSamples | Length of array of samples |
Definition at line 93 of file juce_SmoothedValue.h.
|
inlinenoexcept |
Computes output as a smoothed gain applied to a stream of samples.
Sout[i] = Sin[i] * gain
samplesOut | A pointer to a raw array of output samples |
samplesIn | A pointer to a raw array of input samples |
numSamples | The length of the array of samples |
Definition at line 114 of file juce_SmoothedValue.h.