34template <
typename FloatType>
38 Gain()
noexcept =
default;
73 sampleRate =
spec.sampleRate;
81 gain.reset (sampleRate, rampDurationSeconds);
86 template <
typename SampleType>
89 return s * gain.getNextValue();
93 template <
typename ProcessContext>
103 auto numChannels =
inBlock.getNumChannels();
107 gain.skip (
static_cast<int> (
len));
109 if (
context.usesSeparateInputAndOutputBlocks())
115 if (numChannels == 1)
120 for (
size_t i = 0; i <
len; ++i)
121 dst[i] =
src[i] * gain.getNextValue();
125 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (6255 6386)
126 auto*
gains =
static_cast<FloatType*
> (
alloca (
sizeof (FloatType) *
len));
128 for (
size_t i = 0; i <
len; ++i)
129 gains[i] = gain.getNextValue();
130 JUCE_END_IGNORE_WARNINGS_MSVC
133 FloatVectorOperations::multiply (
outBlock.getChannelPointer (
chan),
142 double sampleRate = 0, rampDurationSeconds = 0;
FloatType getGainDecibels() const noexcept
FloatType getGainLinear() const noexcept
void prepare(const ProcessSpec &spec) noexcept
double getRampDurationSeconds() const noexcept
bool isSmoothing() const noexcept
void setGainLinear(FloatType newGain) noexcept
SampleType JUCE_VECTOR_CALLTYPE processSample(SampleType s) noexcept
void process(const ProcessContext &context) noexcept
void setRampDurationSeconds(double newDurationSeconds) noexcept
void setGainDecibels(FloatType newGainDecibels) noexcept