|
| | Gain () |
| |
| | ~Gain ()=default |
| |
| void | prepare (double sampleRate, double rampTimeMs=10.0) |
| | Prepares the gain processor for playback.
|
| |
| void | prepare (const AudioSpec &spec) |
| | Prepares from AudioSpec, preserving existing ramp time.
|
| |
| void | setGainDb (T dB) noexcept |
| | Sets the target gain in decibels. (Thread-safe, callable from UI).
|
| |
| void | setGainLinear (T linear) noexcept |
| | Sets the target gain as a linear multiplier. (Thread-safe, callable from UI).
|
| |
| T | getGainDb () const noexcept |
| | Returns current target gain in dB.
|
| |
| T | getGainLinear () const noexcept |
| | Returns current target linear gain.
|
| |
| T | getCurrentGain () const noexcept |
| | Returns the current internal smoothed value.
|
| |
| void | setMuted (bool muted) noexcept |
| | Enables or disables mute smoothly. (Thread-safe, callable from UI).
|
| |
| bool | isMuted () const noexcept |
| |
| void | setInverted (bool inverted) noexcept |
| | Enables smooth phase inversion. (Thread-safe, callable from UI). Reverses polarity by ramping smoothly through zero, avoiding clicks.
|
| |
| bool | isInverted () const noexcept |
| |
| void | setRampTime (double rampTimeMs) noexcept |
| | Sets the smoothing ramp time. (Thread-safe). Non-finite values are ignored; negatives clamp to 0.
|
| |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| | Processes an AudioBufferView in-place. (Audio Thread only).
|
| |
| void | process (T *data, int numSamples) noexcept |
| | Processes an interleaved or single-channel buffer in-place.
|
| |
| void | process (T **channelData, int numChannels, int numSamples) noexcept |
| | Processes separate channel buffers in-place.
|
| |
| void | process (const T *input, T *output, int numSamples) noexcept |
| | Processes input to output (not in-place).
|
| |
| void | skipRamp () noexcept |
| | Skips smoothing - immediately sets current gain to target.
|
| |
| void | reset () noexcept |
| | Resets gain internal state to match targets immediately.
|
| |
| std::vector< uint8_t > | getState () const |
| | Serializes the parameter state (setup/UI threads; allocates).
|
| |
| bool | setState (const uint8_t *data, size_t size) |
| | Restores parameters from a blob (tolerant; rejects foreign ids).
|
| |
template<FloatType T>
class dspark::Gain< T >
Professional click-free gain processor.
Features:
- Thread-safe lock-free parameter updates.
- Exponential smoothing for perceptually uniform transitions.
- Smooth cross-zero transitions for phase inversion (no clicks).
- SIMD-accelerated bulk processing.
- Template Parameters
-
| T | Sample type (float or double). |
Definition at line 47 of file Gain.h.