33 namespace SampleTypeHelpers
35 template <typename T, bool = std::is_floating_point<T>::value>
42 struct ElementType<T, false>
44 using Type =
typename T::value_type;
63 template <
typename SampleType>
67 template <
typename OtherSampleType>
68 using MayUseConvertingConstructor =
69 std::enable_if_t<std::is_same<std::remove_const_t<SampleType>,
70 std::remove_const_t<OtherSampleType>>::value
71 && std::is_const<SampleType>::value
72 && ! std::is_const<OtherSampleType>::value,
77 using NumericType =
typename SampleTypeHelpers::ElementType<SampleType>::Type;
89 size_t numberOfChannels,
size_t numberOfSamples) noexcept
90 : channels (channelData),
91 numChannels (static_cast<ChannelCountType> (numberOfChannels)),
92 numSamples (numberOfSamples)
101 constexpr
AudioBlock (SampleType*
const* channelData,
size_t numberOfChannels,
102 size_t startSampleIndex,
size_t numberOfSamples) noexcept
103 : channels (channelData),
104 numChannels (static_cast<ChannelCountType> (numberOfChannels)),
105 startSample (startSampleIndex),
106 numSamples (numberOfSamples)
116 size_t numberOfChannels,
size_t numberOfSamples,
117 size_t alignmentInBytes = defaultAlignment) noexcept
118 : numChannels (static_cast<ChannelCountType> (numberOfChannels)),
119 numSamples (numberOfSamples)
121 auto roundedUpNumSamples = (numberOfSamples + elementMask) & ~elementMask;
122 auto channelSize =
sizeof (SampleType) * roundedUpNumSamples;
123 auto channelListBytes =
sizeof (SampleType*) * numberOfChannels;
124 auto extraBytes = alignmentInBytes - 1;
126 heapBlockToUseForAllocation.malloc (channelListBytes + extraBytes + channelSize * numberOfChannels);
128 auto* chanArray =
reinterpret_cast<SampleType**
> (heapBlockToUseForAllocation.getData());
129 channels = chanArray;
131 auto* data =
reinterpret_cast<SampleType*
> (addBytesToPointer (chanArray, channelListBytes));
132 data = snapPointerToAlignment (data, alignmentInBytes);
134 for (ChannelCountType i = 0; i < numChannels; ++i)
137 data += roundedUpNumSamples;
146 template <
typename OtherSampleType>
148 : channels (buffer.getArrayOfWritePointers()),
149 numChannels (static_cast<ChannelCountType> (buffer.getNumChannels())),
150 numSamples (static_cast<size_t> (buffer.getNumSamples()))
159 template <
typename OtherSampleType>
161 : channels (buffer.getArrayOfWritePointers()),
162 numChannels (static_cast<ChannelCountType> (buffer.getNumChannels())),
163 startSample (startSampleIndex),
164 numSamples (static_cast<size_t> (buffer.getNumSamples()) - startSampleIndex)
166 jassert (startSample < static_cast<size_t> (buffer.getNumSamples()));
172 template <
typename OtherSampleType, MayUseConvertingConstructor<OtherSampleType> = 0>
174 : channels { other.channels },
175 numChannels { other.numChannels },
176 startSample { other.startSample },
177 numSamples { other.numSamples }
181 template <
typename OtherSampleType, MayUseConvertingConstructor<OtherSampleType> = 0>
191 std::swap (other.channels, channels);
192 std::swap (other.numChannels, numChannels);
193 std::swap (other.startSample, startSample);
194 std::swap (other.numSamples, numSamples);
198 template <
typename OtherSampleType>
201 return std::equal (channels,
202 channels + numChannels,
204 other.channels + other.numChannels)
205 && startSample == other.startSample
206 && numSamples == other.numSamples;
209 template <
typename OtherSampleType>
212 return ! (*
this == other);
217 constexpr
size_t getNumChannels() const noexcept {
return static_cast<size_t> (numChannels); }
225 jassert (channel < numChannels);
226 jassert (numSamples > 0);
227 return channels[channel] + startSample;
233 jassert (channel < numChannels);
234 return AudioBlock (channels + channel, 1, startSample, numSamples);
243 jassert (channelStart < numChannels);
244 jassert ((channelStart + numChannelsToUse) <= numChannels);
246 return AudioBlock (channels + channelStart, numChannelsToUse, startSample, numSamples);
254 SampleType
getSample (
int channel,
int sampleIndex)
const noexcept
256 jassert (isPositiveAndBelow (channel, numChannels));
257 jassert (isPositiveAndBelow (sampleIndex, numSamples));
258 return channels[channel][(size_t) startSample + (
size_t) sampleIndex];
266 void setSample (
int destChannel,
int destSample, SampleType newValue)
const noexcept
268 jassert (isPositiveAndBelow (destChannel, numChannels));
269 jassert (isPositiveAndBelow (destSample, numSamples));
270 channels[destChannel][(size_t) startSample + (
size_t) destSample] = newValue;
278 void addSample (
int destChannel,
int destSample, SampleType valueToAdd)
const noexcept
280 jassert (isPositiveAndBelow (destChannel, numChannels));
281 jassert (isPositiveAndBelow (destSample, numSamples));
282 channels[destChannel][(size_t) startSample + (
size_t) destSample] += valueToAdd;
288 const AudioBlock& clear()
const noexcept { clearInternal();
return *
this; }
291 AudioBlock& JUCE_VECTOR_CALLTYPE
fill (NumericType value) noexcept { fillInternal (value);
return *
this; }
292 const AudioBlock& JUCE_VECTOR_CALLTYPE fill (NumericType value)
const noexcept { fillInternal (value);
return *
this; }
295 template <
typename OtherSampleType>
297 template <
typename OtherSampleType>
306 template <
typename OtherNumericType>
308 size_t srcPos = 0,
size_t dstPos = 0,
309 size_t numElements = std::numeric_limits<size_t>::max()) { copyFromInternal (src, srcPos, dstPos, numElements);
return *
this; }
310 template <
typename OtherNumericType>
312 size_t srcPos = 0,
size_t dstPos = 0,
313 size_t numElements = std::numeric_limits<size_t>::max())
const { copyFromInternal (src, srcPos, dstPos, numElements);
return *
this; }
322 void copyTo (
AudioBuffer<
typename std::remove_const<NumericType>::type>& dst,
size_t srcPos = 0,
size_t dstPos = 0,
323 size_t numElements = std::numeric_limits<size_t>::max())
const 325 auto dstlen =
static_cast<size_t> (dst.getNumSamples()) / sizeFactor;
326 auto n =
static_cast<int> (jmin (numSamples - srcPos, dstlen - dstPos, numElements) * sizeFactor);
327 auto maxChannels = jmin (static_cast<size_t> (dst.getNumChannels()), static_cast<size_t> (numChannels));
329 for (
size_t ch = 0; ch < maxChannels; ++ch)
331 static_cast<int> (dstPos * sizeFactor)),
332 getDataPointer (ch) + (srcPos * sizeFactor),
340 size_t numElements = std::numeric_limits<size_t>::max()) noexcept { moveInternal (srcPos, dstPos, numElements);
return *
this; }
341 const AudioBlock& move (
size_t srcPos,
size_t dstPos,
342 size_t numElements = std::numeric_limits<size_t>::max())
const noexcept { moveInternal (srcPos, dstPos, numElements);
return *
this; }
356 jassert (newOffset < numSamples);
357 jassert (newOffset + newLength <= numSamples);
359 return AudioBlock (channels, numChannels, startSample + newOffset, newLength);
374 return getSubBlock (newOffset, getNumSamples() - newOffset);
379 AudioBlock& JUCE_VECTOR_CALLTYPE
add (NumericType value) noexcept { addInternal (value);
return *
this; }
380 const AudioBlock& JUCE_VECTOR_CALLTYPE add (NumericType value)
const noexcept { addInternal (value);
return *
this; }
383 template <
typename OtherSampleType>
385 template <
typename OtherSampleType>
389 template <
typename OtherSampleType>
391 template <
typename OtherSampleType>
395 template <
typename Src1SampleType,
typename Src2SampleType>
397 template <
typename Src1SampleType,
typename Src2SampleType>
402 AudioBlock& JUCE_VECTOR_CALLTYPE
subtract (NumericType value) noexcept { subtractInternal (value);
return *
this; }
403 const AudioBlock& JUCE_VECTOR_CALLTYPE subtract (NumericType value)
const noexcept { subtractInternal (value);
return *
this; }
406 template <
typename OtherSampleType>
408 template <
typename OtherSampleType>
412 template <
typename OtherSampleType>
414 template <
typename OtherSampleType>
415 const AudioBlock& JUCE_VECTOR_CALLTYPE replaceWithDifferenceOf (
AudioBlock<OtherSampleType> src, NumericType value)
const noexcept { replaceWithDifferenceOfInternal (src, value);
return *
this; }
418 template <
typename Src1SampleType,
typename Src2SampleType>
420 template <
typename Src1SampleType,
typename Src2SampleType>
425 AudioBlock& JUCE_VECTOR_CALLTYPE
multiplyBy (NumericType value) noexcept { multiplyByInternal (value);
return *
this; }
426 const AudioBlock& JUCE_VECTOR_CALLTYPE multiplyBy (NumericType value)
const noexcept { multiplyByInternal (value);
return *
this; }
429 template <
typename OtherSampleType>
431 template <
typename OtherSampleType>
435 template <
typename OtherSampleType>
437 template <
typename OtherSampleType>
438 const AudioBlock& JUCE_VECTOR_CALLTYPE replaceWithProductOf (
AudioBlock<OtherSampleType> src, NumericType value)
const noexcept { replaceWithProductOfInternal (src, value);
return *
this; }
441 template <
typename Src1SampleType,
typename Src2SampleType>
443 template <
typename Src1SampleType,
typename Src2SampleType>
448 template <
typename SmoothingType>
450 template <
typename SmoothingType>
454 template <
typename OtherSampleType,
typename SmoothingType>
456 template <
typename OtherSampleType,
typename SmoothingType>
461 template <
typename OtherSampleType>
463 template <
typename OtherSampleType>
467 template <
typename Src1SampleType,
typename Src2SampleType>
469 template <
typename Src1SampleType,
typename Src2SampleType>
475 const AudioBlock& negate()
const noexcept { negateInternal();
return *
this; }
478 template <
typename OtherSampleType>
480 template <
typename OtherSampleType>
484 template <
typename OtherSampleType>
486 template <
typename OtherSampleType>
491 template <
typename Src1SampleType,
typename Src2SampleType>
493 template <
typename Src1SampleType,
typename Src2SampleType>
497 template <
typename Src1SampleType,
typename Src2SampleType>
499 template <
typename Src1SampleType,
typename Src2SampleType>
506 if (numChannels == 0)
509 auto n =
static_cast<int> (numSamples * sizeFactor);
512 for (
size_t ch = 1; ch < numChannels; ++ch)
520 AudioBlock& JUCE_VECTOR_CALLTYPE operator+= (NumericType value) noexcept {
return add (value); }
521 const AudioBlock& JUCE_VECTOR_CALLTYPE operator+= (NumericType value)
const noexcept {
return add (value); }
526 AudioBlock& JUCE_VECTOR_CALLTYPE operator-= (NumericType value) noexcept {
return subtract (value); }
527 const AudioBlock& JUCE_VECTOR_CALLTYPE operator-= (NumericType value)
const noexcept {
return subtract (value); }
532 AudioBlock& JUCE_VECTOR_CALLTYPE operator*= (NumericType value) noexcept {
return multiplyBy (value); }
533 const AudioBlock& JUCE_VECTOR_CALLTYPE operator*= (NumericType value)
const noexcept {
return multiplyBy (value); }
538 template <
typename SmoothingType>
540 template <
typename SmoothingType>
545 static_assert (std::is_same<std::remove_const_t<SampleType>,
float>::value
546 || std::is_same<std::remove_const_t<SampleType>,
double>::value
551 ,
"AudioBlock only supports single or double precision floating point types");
558 template <
typename Src1SampleType,
typename Src2SampleType,
typename FunctionType>
567 for (ChannelCountType c = 0; c < numChans; ++c)
572 for (
size_t i = 0; i < len; ++i)
573 dst[i] =
function (src[i]);
578 NumericType* getDataPointer (
size_t channel)
const noexcept
580 return reinterpret_cast<NumericType*
> (getChannelPointer (channel));
584 void JUCE_VECTOR_CALLTYPE clearInternal()
const noexcept
586 auto n =
static_cast<int> (numSamples * sizeFactor);
588 for (
size_t ch = 0; ch < numChannels; ++ch)
592 void JUCE_VECTOR_CALLTYPE fillInternal (NumericType value)
const noexcept
594 auto n =
static_cast<int> (numSamples * sizeFactor);
596 for (
size_t ch = 0; ch < numChannels; ++ch)
600 template <
typename OtherSampleType>
603 auto maxChannels = jmin (src.numChannels, numChannels);
604 auto n =
static_cast<int> (jmin (src.numSamples * src.sizeFactor,
605 numSamples * sizeFactor));
607 for (
size_t ch = 0; ch < maxChannels; ++ch)
611 template <
typename OtherNumericType>
614 auto srclen =
static_cast<size_t> (src.
getNumSamples()) / sizeFactor;
615 auto n =
static_cast<int> (jmin (srclen - srcPos, numSamples - dstPos, numElements) * sizeFactor);
616 auto maxChannels = jmin (static_cast<size_t> (src.
getNumChannels()), static_cast<size_t> (numChannels));
618 for (
size_t ch = 0; ch < maxChannels; ++ch)
621 static_cast<int> (srcPos * sizeFactor)),
625 void moveInternal (
size_t srcPos,
size_t dstPos,
626 size_t numElements = std::numeric_limits<size_t>::max())
const noexcept
628 jassert (srcPos <= numSamples && dstPos <= numSamples);
629 auto len = jmin (numSamples - srcPos, numSamples - dstPos, numElements) *
sizeof (SampleType);
632 for (
size_t ch = 0; ch < numChannels; ++ch)
633 ::memmove (getChannelPointer (ch) + dstPos,
634 getChannelPointer (ch) + srcPos, len);
638 void JUCE_VECTOR_CALLTYPE addInternal (NumericType value)
const noexcept
640 auto n =
static_cast<int> (numSamples * sizeFactor);
642 for (
size_t ch = 0; ch < numChannels; ++ch)
646 template <
typename OtherSampleType>
649 jassert (numChannels == src.numChannels);
650 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
652 for (
size_t ch = 0; ch < numChannels; ++ch)
656 template <
typename OtherSampleType>
659 jassert (numChannels == src.numChannels);
660 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
662 for (
size_t ch = 0; ch < numChannels; ++ch)
666 template <
typename Src1SampleType,
typename Src2SampleType>
669 jassert (numChannels == src1.numChannels && src1.numChannels == src2.numChannels);
670 auto n =
static_cast<int> (jmin (numSamples, src1.numSamples, src2.numSamples) * sizeFactor);
672 for (
size_t ch = 0; ch < numChannels; ++ch)
677 constexpr
void JUCE_VECTOR_CALLTYPE subtractInternal (NumericType value)
const noexcept
679 addInternal (value * static_cast<NumericType> (-1.0));
682 template <
typename OtherSampleType>
685 jassert (numChannels == src.numChannels);
686 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
688 for (
size_t ch = 0; ch < numChannels; ++ch)
692 template <
typename OtherSampleType>
695 replaceWithSumOfInternal (src, static_cast<NumericType> (-1.0) * value);
698 template <
typename Src1SampleType,
typename Src2SampleType>
701 jassert (numChannels == src1.numChannels && src1.numChannels == src2.numChannels);
702 auto n =
static_cast<int> (jmin (numSamples, src1.numSamples, src2.numSamples) * sizeFactor);
704 for (
size_t ch = 0; ch < numChannels; ++ch)
709 void JUCE_VECTOR_CALLTYPE multiplyByInternal (NumericType value)
const noexcept
711 auto n =
static_cast<int> (numSamples * sizeFactor);
713 for (
size_t ch = 0; ch < numChannels; ++ch)
717 template <
typename OtherSampleType>
720 jassert (numChannels == src.numChannels);
721 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
723 for (
size_t ch = 0; ch < numChannels; ++ch)
727 template <
typename OtherSampleType>
730 jassert (numChannels == src.numChannels);
731 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
733 for (
size_t ch = 0; ch < numChannels; ++ch)
737 template <
typename Src1SampleType,
typename Src2SampleType>
740 jassert (numChannels == src1.numChannels && src1.numChannels == src2.numChannels);
741 auto n =
static_cast<int> (jmin (numSamples, src1.numSamples, src2.numSamples) * sizeFactor);
743 for (
size_t ch = 0; ch < numChannels; ++ch)
747 template <
typename SmoothingType>
756 for (
size_t i = 0; i < numSamples; ++i)
760 for (
size_t ch = 0; ch < numChannels; ++ch)
761 getDataPointer (ch)[i] *= scaler;
766 template <
typename OtherSampleType,
typename SmoothingType>
769 jassert (numChannels == src.numChannels);
777 auto n = jmin (numSamples, src.numSamples) * sizeFactor;
779 for (
size_t i = 0; i < n; ++i)
783 for (
size_t ch = 0; ch < numChannels; ++ch)
790 template <
typename OtherSampleType>
793 jassert (numChannels == src.numChannels);
794 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
796 for (
size_t ch = 0; ch < numChannels; ++ch)
800 template <
typename Src1SampleType,
typename Src2SampleType>
803 jassert (numChannels == src1.numChannels && src1.numChannels == src2.numChannels);
804 auto n =
static_cast<int> (jmin (numSamples, src1.numSamples, src2.numSamples) * sizeFactor);
806 for (
size_t ch = 0; ch < numChannels; ++ch)
811 constexpr
void negateInternal()
const noexcept
813 multiplyByInternal (static_cast<NumericType> (-1.0));
816 template <
typename OtherSampleType>
819 jassert (numChannels == src.numChannels);
820 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
822 for (
size_t ch = 0; ch < numChannels; ++ch)
826 template <
typename OtherSampleType>
829 jassert (numChannels == src.numChannels);
830 auto n =
static_cast<int> (jmin (numSamples, src.numSamples) * sizeFactor);
832 for (
size_t ch = 0; ch < numChannels; ++ch)
837 template <
typename Src1SampleType,
typename Src2SampleType>
840 jassert (numChannels == src1.numChannels && src1.numChannels == src2.numChannels);
841 auto n =
static_cast<int> (jmin (src1.numSamples, src2.numSamples, numSamples) * sizeFactor);
843 for (
size_t ch = 0; ch < numChannels; ++ch)
847 template <
typename Src1SampleType,
typename Src2SampleType>
850 jassert (numChannels == src1.numChannels && src1.numChannels == src2.numChannels);
851 auto n =
static_cast<int> (jmin (src1.numSamples, src2.numSamples, numSamples) * sizeFactor);
853 for (
size_t ch = 0; ch < numChannels; ++ch)
858 using ChannelCountType =
unsigned int;
861 static constexpr
size_t sizeFactor =
sizeof (SampleType) /
sizeof (NumericType);
862 static constexpr
size_t elementMask = sizeFactor - 1;
863 static constexpr
size_t byteMask = (sizeFactor *
sizeof (NumericType)) - 1;
868 static constexpr
size_t defaultAlignment =
sizeof (NumericType);
871 SampleType*
const* channels;
872 ChannelCountType numChannels = 0;
873 size_t startSample = 0, numSamples = 0;
875 template <
typename OtherSampleType>
FloatType getNextValue() noexcept
AudioBlock & copyFrom(const AudioBlock< OtherSampleType > &src) noexcept
FloatType getTargetValue() const noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE replaceWithProductOf(AudioBlock< OtherSampleType > src, NumericType value) noexcept
static void JUCE_CALLTYPE add(float *dest, float amountToAdd, int numValues) noexcept
static void JUCE_CALLTYPE copy(float *dest, const float *src, int numValues) noexcept
AudioBlock & replaceWithNegativeOf(AudioBlock< OtherSampleType > src) noexcept
AudioBlock & negate() noexcept
AudioBlock & replaceWithDifferenceOf(AudioBlock< Src1SampleType > src1, AudioBlock< Src2SampleType > src2) noexcept
AudioBlock & copyFrom(const AudioBuffer< OtherNumericType > &src, size_t srcPos=0, size_t dstPos=0, size_t numElements=std::numeric_limits< size_t >::max())
AudioBlock getSubBlock(size_t newOffset) const noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE addProductOf(AudioBlock< OtherSampleType > src, NumericType factor) noexcept
AudioBlock getSingleChannelBlock(size_t channel) const noexcept
static void JUCE_CALLTYPE fill(float *dest, float valueToFill, int numValues) noexcept
static void JUCE_CALLTYPE multiply(float *dest, const float *src, int numValues) noexcept
AudioBlock & replaceWithMaxOf(AudioBlock< Src1SampleType > src1, AudioBlock< Src2SampleType > src2) noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE fill(NumericType value) noexcept
static void process(AudioBlock< Src1SampleType > inBlock, AudioBlock< Src2SampleType > outBlock, FunctionType &&function)
Range< typename std::remove_const< NumericType >::type > findMinAndMax() const noexcept
SampleType getSample(int channel, int sampleIndex) const noexcept
bool isSmoothing() const noexcept
constexpr AudioBlock(SampleType *const *channelData, size_t numberOfChannels, size_t startSampleIndex, size_t numberOfSamples) noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE subtract(NumericType value) noexcept
constexpr size_t getNumSamples() const noexcept
AudioBlock & replaceWithMinOf(AudioBlock< Src1SampleType > src1, AudioBlock< Src2SampleType > src2) noexcept
static void JUCE_CALLTYPE abs(float *dest, const float *src, int numValues) noexcept
const Type * getReadPointer(int channelNumber) const noexcept
AudioBlock & replaceWithAbsoluteValueOf(AudioBlock< OtherSampleType > src) noexcept
AudioBlock & multiplyBy(SmoothedValue< SampleType, SmoothingType > &value) noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE replaceWithDifferenceOf(AudioBlock< OtherSampleType > src, NumericType value) noexcept
AudioBlock & replaceWithProductOf(AudioBlock< Src1SampleType > src1, AudioBlock< Src2SampleType > src2) noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE add(NumericType value) noexcept
AudioBlock & multiplyBy(AudioBlock< OtherSampleType > src) noexcept
static Range< float > JUCE_CALLTYPE findMinAndMax(const float *src, int numValues) noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE replaceWithSumOf(AudioBlock< OtherSampleType > src, NumericType value) noexcept
int getNumChannels() const noexcept
static void JUCE_CALLTYPE subtract(float *dest, const float *src, int numValues) noexcept
static void JUCE_CALLTYPE clear(float *dest, int numValues) noexcept
constexpr AudioBlock(SampleType *const *channelData, size_t numberOfChannels, size_t numberOfSamples) noexcept
AudioBlock & replaceWithSumOf(AudioBlock< Src1SampleType > src1, AudioBlock< Src2SampleType > src2) noexcept
AudioBlock & replaceWithProductOf(AudioBlock< OtherSampleType > src, SmoothedValue< SampleType, SmoothingType > &value) noexcept
static void JUCE_CALLTYPE max(float *dest, const float *src, float comp, int num) noexcept
constexpr AudioBlock(AudioBuffer< OtherSampleType > &buffer) noexcept
void setSample(int destChannel, int destSample, SampleType newValue) const noexcept
AudioBlock & addProductOf(AudioBlock< Src1SampleType > src1, AudioBlock< Src2SampleType > src2) noexcept
AudioBlock getSubBlock(size_t newOffset, size_t newLength) const noexcept
static void JUCE_CALLTYPE negate(float *dest, const float *src, int numValues) noexcept
AudioBlock &JUCE_VECTOR_CALLTYPE multiplyBy(NumericType value) noexcept
static void JUCE_CALLTYPE addWithMultiply(float *dest, const float *src, float multiplier, int numValues) noexcept
AudioBlock & clear() noexcept
SampleType * getChannelPointer(size_t channel) const noexcept
void copyTo(AudioBuffer< typename std::remove_const< NumericType >::type > &dst, size_t srcPos=0, size_t dstPos=0, size_t numElements=std::numeric_limits< size_t >::max()) const
int getNumSamples() const noexcept
static void JUCE_CALLTYPE min(float *dest, const float *src, float comp, int num) noexcept
AudioBlock(HeapBlock< char > &heapBlockToUseForAllocation, size_t numberOfChannels, size_t numberOfSamples, size_t alignmentInBytes=defaultAlignment) noexcept
AudioBlock & add(AudioBlock< OtherSampleType > src) noexcept
constexpr size_t getNumChannels() const noexcept
AudioBlock & subtract(AudioBlock< OtherSampleType > src) noexcept
AudioBlock & move(size_t srcPos, size_t dstPos, size_t numElements=std::numeric_limits< size_t >::max()) noexcept
AudioBlock(AudioBuffer< OtherSampleType > &buffer, size_t startSampleIndex) noexcept
AudioBlock getSubsetChannelBlock(size_t channelStart, size_t numChannelsToUse) const noexcept
void addSample(int destChannel, int destSample, SampleType valueToAdd) const noexcept