JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
juce::SmoothedValueBase< SmoothedValueType > Class Template Reference

A base class for the smoothed value classes. More...

#include "juce_SmoothedValue.h"

Inheritance diagram for juce::SmoothedValueBase< SmoothedValueType >:
juce::SmoothedValue< float > juce::SmoothedValue< SampleType, juce::ValueSmoothingTypes::Linear > juce::SmoothedValue< SampleType > juce::SmoothedValue< NumericType > juce::SmoothedValue< FloatType, SmoothingType >

Public Types

using FloatType = typename FloatTypeHelper< SmoothedValueType >::Type
 

Public Member Functions

 SmoothedValueBase ()=default
 Constructor.
 
bool isSmoothing () const noexcept
 Returns true if the current value is currently being interpolated.
 
FloatType getCurrentValue () const noexcept
 Returns the current value of the ramp.
 
FloatType getTargetValue () const noexcept
 Returns the target value towards which the smoothed value is currently moving.
 
void setCurrentAndTargetValue (FloatType newValue)
 Sets the current value and the target value.
 
void applyGain (FloatType *samples, int numSamples) noexcept
 Applies a smoothed gain to a stream of samples S[i] *= gain.
 
void applyGain (FloatType *samplesOut, const FloatType *samplesIn, int numSamples) noexcept
 Computes output as a smoothed gain applied to a stream of samples.
 
void applyGain (AudioBuffer< FloatType > &buffer, int numSamples) noexcept
 Applies a smoothed gain to a buffer.
 

Protected Attributes

FloatType currentValue
 
FloatType target
 
int countdown
 

Detailed Description

template<typename SmoothedValueType>
class juce::SmoothedValueBase< SmoothedValueType >

A base class for the smoothed value classes.

This class is used to provide common functionality to the SmoothedValue and dsp::LogRampedValue classes.

@tags{Audio}

Definition at line 36 of file juce_SmoothedValue.h.

Member Typedef Documentation

◆ FloatType

Definition at line 55 of file juce_SmoothedValue.h.

Member Function Documentation

◆ applyGain() [1/3]

void juce::SmoothedValueBase< SmoothedValueType >::applyGain ( AudioBuffer< FloatType > &  buffer,
int  numSamples 
)
noexcept

Applies a smoothed gain to a buffer.

Definition at line 124 of file juce_SmoothedValue.h.

◆ applyGain() [2/3]

void juce::SmoothedValueBase< SmoothedValueType >::applyGain ( FloatType *  samples,
int  numSamples 
)
noexcept

Applies a smoothed gain to a stream of samples S[i] *= gain.

Parameters
samplesPointer to a raw array of samples
numSamplesLength of array of samples

Definition at line 87 of file juce_SmoothedValue.h.

◆ applyGain() [3/3]

void juce::SmoothedValueBase< SmoothedValueType >::applyGain ( FloatType *  samplesOut,
const FloatType *  samplesIn,
int  numSamples 
)
noexcept

Computes output as a smoothed gain applied to a stream of samples.

Sout[i] = Sin[i] * gain

Parameters
samplesOutA pointer to a raw array of output samples
samplesInA pointer to a raw array of input samples
numSamplesThe length of the array of samples

Definition at line 108 of file juce_SmoothedValue.h.

◆ getCurrentValue()

FloatType juce::SmoothedValueBase< SmoothedValueType >::getCurrentValue ( ) const
noexcept

Returns the current value of the ramp.

Definition at line 66 of file juce_SmoothedValue.h.

◆ getTargetValue()

FloatType juce::SmoothedValueBase< SmoothedValueType >::getTargetValue ( ) const
noexcept

Returns the target value towards which the smoothed value is currently moving.

Definition at line 70 of file juce_SmoothedValue.h.

◆ isSmoothing()

bool juce::SmoothedValueBase< SmoothedValueType >::isSmoothing ( ) const
noexcept

Returns true if the current value is currently being interpolated.

Definition at line 63 of file juce_SmoothedValue.h.

◆ setCurrentAndTargetValue()

void juce::SmoothedValueBase< SmoothedValueType >::setCurrentAndTargetValue ( FloatType  newValue)

Sets the current value and the target value.

Parameters
newValuethe new value to take

Definition at line 75 of file juce_SmoothedValue.h.

Member Data Documentation

◆ countdown

Definition at line 165 of file juce_SmoothedValue.h.

◆ currentValue

FloatType juce::SmoothedValueBase< SmoothedValueType >::currentValue
protected

Definition at line 163 of file juce_SmoothedValue.h.

◆ target

FloatType juce::SmoothedValueBase< SmoothedValueType >::target
protected

Definition at line 164 of file juce_SmoothedValue.h.


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