36template <
typename FloatType>
88 template <
typename SampleType>
91 return s *
gain.getNextValue();
95 template <
typename ProcessContext>
96 void process (
const ProcessContext& context)
noexcept
98 auto&& inBlock = context.getInputBlock();
99 auto&& outBlock = context.getOutputBlock();
101 jassert (inBlock.getNumChannels() == outBlock.getNumChannels());
102 jassert (inBlock.getNumSamples() == outBlock.getNumSamples());
104 auto len = inBlock.getNumSamples();
105 auto numChannels = inBlock.getNumChannels();
107 if (context.isBypassed)
109 gain.skip (
static_cast<int> (len));
111 if (context.usesSeparateInputAndOutputBlocks())
112 outBlock.copyFrom (inBlock);
117 if (numChannels == 1)
119 auto* src = inBlock.getChannelPointer (0);
120 auto* dst = outBlock.getChannelPointer (0);
122 for (
size_t i = 0;
i < len; ++
i)
123 dst[
i] = src[
i] *
gain.getNextValue();
128 auto* gains =
static_cast<FloatType*
> (alloca (
sizeof (FloatType) * len));
130 for (
size_t i = 0;
i < len; ++
i)
131 gains[
i] =
gain.getNextValue();
134 for (
size_t chan = 0; chan < numChannels; ++chan)
135 FloatVectorOperations::multiply (outBlock.getChannelPointer (chan),
136 inBlock.getChannelPointer (chan),
137 gains,
static_cast<int> (len));
#define noexcept
Definition DistrhoDefines.h:72
static Type decibelsToGain(Type decibels, Type minusInfinityDb=Type(defaultMinusInfinitydB))
Definition juce_Decibels.h:42
static Type gainToDecibels(Type gain, Type minusInfinityDb=Type(defaultMinusInfinitydB))
Definition juce_Decibels.h:56
Definition juce_SmoothedValue.h:227
FloatType getGainDecibels() const noexcept
Definition juce_Gain.h:53
double rampDurationSeconds
Definition juce_Gain.h:144
FloatType getGainLinear() const noexcept
Definition juce_Gain.h:50
double sampleRate
Definition juce_Gain.h:144
void prepare(const ProcessSpec &spec) noexcept
Definition juce_Gain.h:73
double getRampDurationSeconds() const noexcept
Definition juce_Gain.h:66
bool isSmoothing() const noexcept
Definition juce_Gain.h:69
void setGainLinear(FloatType newGain) noexcept
Definition juce_Gain.h:44
SampleType JUCE_VECTOR_CALLTYPE processSample(SampleType s) noexcept
Definition juce_Gain.h:89
void reset() noexcept
Definition juce_Gain.h:80
void process(const ProcessContext &context) noexcept
Definition juce_Gain.h:96
SmoothedValue< FloatType > gain
Definition juce_Gain.h:143
void setRampDurationSeconds(double newDurationSeconds) noexcept
Definition juce_Gain.h:56
void setGainDecibels(FloatType newGainDecibels) noexcept
Definition juce_Gain.h:47
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
#define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings)
Definition juce_CompilerWarnings.h:198
#define JUCE_END_IGNORE_WARNINGS_MSVC
Definition juce_CompilerWarnings.h:199
#define JUCE_VECTOR_CALLTYPE
Definition juce_dsp.h:100
Definition juce_AudioBlock.h:29
Definition carla_juce.cpp:31
Definition juce_ProcessContext.h:38
#define const
Definition zconf.h:137