JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::dsp::AudioBlock< SampleType > Class Template Reference

Minimal and lightweight data-structure which contains a list of pointers to channels containing some kind of sample data. More...

#include <juce_AudioBlock.h>

Inheritance diagram for juce::dsp::AudioBlock< SampleType >:
Collaboration diagram for juce::dsp::AudioBlock< SampleType >:

Public Types

using NumericType = typename SampleTypeHelpers::ElementType< SampleType >::Type
 

Public Member Functions

forcedinline AudioBlock () noexcept
 Create a zero-sized AudioBlock. More...
 
forcedinline AudioBlock (SampleType *const *channelData, size_t numberOfChannels, size_t numberOfSamples) noexcept
 Creates an AudioBlock from a pointer to an array of channels. More...
 
forcedinline AudioBlock (SampleType *const *channelData, size_t numberOfChannels, size_t startSampleIndex, size_t numberOfSamples) noexcept
 Creates an AudioBlock from a pointer to an array of channels. More...
 
 AudioBlock (HeapBlock< char > &heapBlockToUseForAllocation, size_t numberOfChannels, size_t numberOfSamples, size_t alignmentInBytes=defaultAlignment) noexcept
 Allocates a suitable amount of space in a HeapBlock, and initialises this object to point into it. More...
 
 AudioBlock (AudioBuffer< SampleType > &buffer) noexcept
 Creates an AudioBlock that points to the data in an AudioBuffer. More...
 
 AudioBlock (AudioBuffer< SampleType > &buffer, size_t startSampleIndex) noexcept
 Creates an AudioBlock that points to the data in an AudioBuffer. More...
 
 AudioBlock (const AudioBlock &other) noexcept=default
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE add (SampleType value) noexcept
 Adds a fixed value to the receiver. More...
 
forcedinline AudioBlockadd (AudioBlock src) noexcept
 Adds the source values to the receiver. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE add (AudioBlock src, SampleType value) noexcept
 Adds a fixed value to each source value and stores it in the destination array of the receiver. More...
 
forcedinline AudioBlockadd (AudioBlock src1, AudioBlock src2) noexcept
 Adds each source1 value to the corresponding source2 value and stores it in the destination array of the receiver. More...
 
void addSample (int destChannel, int destSample, SampleType valueToAdd) noexcept
 Adds a value to a sample in the buffer. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE addWithMultiply (AudioBlock src, SampleType factor) noexcept
 Multiplies each value in src with factor and adds the result to the receiver. More...
 
forcedinline AudioBlockaddWithMultiply (AudioBlock src1, AudioBlock src2) noexcept
 Multiplies each value in srcA with the corresponding value in srcB and adds the result to the receiver. More...
 
forcedinline AudioBlockclear () noexcept
 Clear the memory described by this AudioBlock. More...
 
forcedinline AudioBlockcopy (AudioBlock src) noexcept
 Copy the values in src to the receiver. More...
 
forcedinline AudioBlockcopyFrom (const AudioBuffer< NumericType > &src, size_t srcPos=0, size_t dstPos=0, size_t numElements=std::numeric_limits< size_t >::max())
 Copy the values from a JUCE's AudioBuffer to the receiver. More...
 
forcedinline const AudioBlockcopyTo (AudioBuffer< NumericType > &dst, size_t srcPos=0, size_t dstPos=0, size_t numElements=std::numeric_limits< size_t >::max()) const
 Copy the values from the receiver to a JUCE's AudioBuffer. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE fill (SampleType value) noexcept
 Fill memory with value. More...
 
forcedinline Range< NumericTypefindMinAndMax () const noexcept
 Finds the minimum and maximum value of the buffer. More...
 
forcedinline const SampleType * getChannelPointer (size_t channel) const noexcept
 Returns a raw pointer into one of the channels in this block. More...
 
forcedinline SampleType * getChannelPointer (size_t channel) noexcept
 Returns a raw pointer into one of the channels in this block. More...
 
forcedinline size_t getNumChannels () const noexcept
 
forcedinline size_t getNumSamples () const noexcept
 
SampleType getSample (int channel, int sampleIndex) const noexcept
 Returns a sample from the buffer. More...
 
forcedinline AudioBlock getSingleChannelBlock (size_t channel) const noexcept
 Returns an AudioBlock that represents one of the channels in this block. More...
 
AudioBlock getSubBlock (size_t newOffset, size_t newLength) const noexcept
 Return a new AudioBlock pointing to a sub-block inside the receiver. More...
 
AudioBlock getSubBlock (size_t newOffset) const noexcept
 Return a new AudioBlock pointing to a sub-block inside the receiver. More...
 
forcedinline AudioBlock getSubsetChannelBlock (size_t channelStart, size_t numChannelsToUse) noexcept
 Returns a subset of continguous channels. More...
 
forcedinline AudioBlockmax (AudioBlock src1, AudioBlock src2) noexcept
 Each element of the receiver will be the maximum of the corresponding element of the source arrays. More...
 
forcedinline AudioBlockmin (AudioBlock src1, AudioBlock src2) noexcept
 Each element of receiver will be the minimum of the corresponding element of the source arrays. More...
 
forcedinline AudioBlockmove (size_t srcPos, size_t dstPos, size_t numElements=std::numeric_limits< size_t >::max()) noexcept
 Move memory within the receiver from the position srcPos to the position dstPos. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE multiply (SampleType value) noexcept
 Multiplies a fixed value to the receiver. More...
 
forcedinline AudioBlockmultiply (AudioBlock src) noexcept
 Multiplies the source values to the receiver. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE multiply (AudioBlock src, SampleType value) noexcept
 Multiplies a fixed value to each source value and stores it in the destination array of the receiver. More...
 
forcedinline AudioBlockmultiply (AudioBlock src1, AudioBlock src2) noexcept
 Multiplies each source1 value to the corresponding source2 value and stores it in the destination array of the receiver. More...
 
AudioBlockmultiply (LinearSmoothedValue< SampleType > &value) noexcept
 Multiplies all channels of the AudioBlock by a smoothly changing value and stores them . More...
 
AudioBlockmultiply (AudioBlock src, LinearSmoothedValue< SampleType > &value) noexcept
 Multiplies all channels of the source by a smoothly changing value and stores them in the receiver. More...
 
forcedinline AudioBlocknegate () noexcept
 Negates each value of the receiver. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE operator*= (SampleType src) noexcept
 
forcedinline AudioBlockoperator*= (AudioBlock src) noexcept
 
forcedinline AudioBlockoperator*= (LinearSmoothedValue< SampleType > &value) noexcept
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE operator+= (SampleType src) noexcept
 
forcedinline AudioBlockoperator+= (AudioBlock src) noexcept
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE operator-= (SampleType src) noexcept
 
forcedinline AudioBlockoperator-= (AudioBlock src) noexcept
 
AudioBlockoperator= (const AudioBlock &other) noexcept=default
 
forcedinline AudioBlockreplaceWithAbsoluteValueOf (AudioBlock src) noexcept
 Takes the absolute value of each element of src and stores it inside the receiver. More...
 
forcedinline AudioBlockreplaceWithNegativeOf (AudioBlock src) noexcept
 Negates each value of source and stores it in the receiver. More...
 
void setSample (int destChannel, int destSample, SampleType newValue) noexcept
 Modifies a sample in the buffer. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE subtract (SampleType value) noexcept
 Subtracts a fixed value from the receiver. More...
 
forcedinline AudioBlocksubtract (AudioBlock src) noexcept
 Subtracts the source values from the receiver. More...
 
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE subtract (AudioBlock src, SampleType value) noexcept
 Subtracts a fixed value from each source value and stores it in the destination array of the receiver. More...
 
forcedinline AudioBlocksubtract (AudioBlock src1, AudioBlock src2) noexcept
 Subtracts each source2 value from the corresponding source1 value and stores it in the destination array of the receiver. More...
 

Static Public Member Functions

template<typename FunctionType >
static void process (AudioBlock inBlock, AudioBlock outBlock, FunctionType &&function)
 Applies a function to each value in an input block, putting the result into an output block. More...
 

Private Types

using ChannelCountType = unsigned int
 

Private Member Functions

NumericTypechannelPtr (size_t ch) noexcept
 
const NumericTypechannelPtr (size_t ch) const noexcept
 

Private Attributes

SampleType *const * channels
 
ChannelCountType numChannels = 0
 
size_t numSamples = 0
 
size_t startSample = 0
 

Static Private Attributes

static constexpr size_t byteMask = (sizeFactor * sizeof (NumericType)) - 1
 
static constexpr size_t defaultAlignment = sizeof (NumericType)
 
static constexpr size_t elementMask = sizeFactor - 1
 
static constexpr size_t sizeFactor = sizeof (SampleType) / sizeof (NumericType)
 

Detailed Description

template<typename SampleType>
class juce::dsp::AudioBlock< SampleType >

Minimal and lightweight data-structure which contains a list of pointers to channels containing some kind of sample data.

This class doesn't own any of the data which it points to, it's simply a view into data that is owned elsewhere. You can construct one from some raw data that you've allocated yourself, or give it a HeapBlock to use, or give it an AudioBuffer which it can refer to, but in all cases the user is responsible for making sure that the data doesn't get deleted while there's still an AudioBlock using it.

{DSP}

Member Typedef Documentation

◆ ChannelCountType

template<typename SampleType>
using juce::dsp::AudioBlock< SampleType >::ChannelCountType = unsigned int
private

◆ NumericType

template<typename SampleType>
using juce::dsp::AudioBlock< SampleType >::NumericType = typename SampleTypeHelpers::ElementType<SampleType>::Type

Constructor & Destructor Documentation

◆ AudioBlock() [1/7]

template<typename SampleType>
forcedinline juce::dsp::AudioBlock< SampleType >::AudioBlock ( )
inlinenoexcept

Create a zero-sized AudioBlock.

◆ AudioBlock() [2/7]

template<typename SampleType>
forcedinline juce::dsp::AudioBlock< SampleType >::AudioBlock ( SampleType *const *  channelData,
size_t  numberOfChannels,
size_t  numberOfSamples 
)
inlinenoexcept

Creates an AudioBlock from a pointer to an array of channels.

AudioBlock does not copy nor own the memory pointed to by dataToUse. Therefore it is the user's responsibility to ensure that the memory is retained throughout the life-time of the AudioBlock and released when no longer needed.

◆ AudioBlock() [3/7]

template<typename SampleType>
forcedinline juce::dsp::AudioBlock< SampleType >::AudioBlock ( SampleType *const *  channelData,
size_t  numberOfChannels,
size_t  startSampleIndex,
size_t  numberOfSamples 
)
inlinenoexcept

Creates an AudioBlock from a pointer to an array of channels.

AudioBlock does not copy nor own the memory pointed to by dataToUse. Therefore it is the user's responsibility to ensure that the memory is retained throughout the life-time of the AudioBlock and released when no longer needed.

◆ AudioBlock() [4/7]

template<typename SampleType>
juce::dsp::AudioBlock< SampleType >::AudioBlock ( HeapBlock< char > &  heapBlockToUseForAllocation,
size_t  numberOfChannels,
size_t  numberOfSamples,
size_t  alignmentInBytes = defaultAlignment 
)
inlinenoexcept

Allocates a suitable amount of space in a HeapBlock, and initialises this object to point into it.

The HeapBlock must of course not be freed or re-allocated while this object is still in use, because it will be referencing its data.

◆ AudioBlock() [5/7]

template<typename SampleType>
juce::dsp::AudioBlock< SampleType >::AudioBlock ( AudioBuffer< SampleType > &  buffer)
inlinenoexcept

Creates an AudioBlock that points to the data in an AudioBuffer.

AudioBlock does not copy nor own the memory pointed to by dataToUse. Therefore it is the user's responsibility to ensure that the buffer is retained throughout the life-time of the AudioBlock without being modified.

◆ AudioBlock() [6/7]

template<typename SampleType>
juce::dsp::AudioBlock< SampleType >::AudioBlock ( AudioBuffer< SampleType > &  buffer,
size_t  startSampleIndex 
)
inlinenoexcept

Creates an AudioBlock that points to the data in an AudioBuffer.

AudioBlock does not copy nor own the memory pointed to by dataToUse. Therefore it is the user's responsibility to ensure that the buffer is retained throughout the life-time of the AudioBlock without being modified.

◆ AudioBlock() [7/7]

template<typename SampleType>
juce::dsp::AudioBlock< SampleType >::AudioBlock ( const AudioBlock< SampleType > &  other)
defaultnoexcept

Member Function Documentation

◆ add() [1/4]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::add ( SampleType  value)
inlinenoexcept

Adds a fixed value to the receiver.

◆ add() [2/4]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::add ( AudioBlock< SampleType >  src)
inlinenoexcept

Adds the source values to the receiver.

◆ add() [3/4]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::add ( AudioBlock< SampleType >  src,
SampleType  value 
)
inlinenoexcept

Adds a fixed value to each source value and stores it in the destination array of the receiver.

◆ add() [4/4]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::add ( AudioBlock< SampleType >  src1,
AudioBlock< SampleType >  src2 
)
inlinenoexcept

Adds each source1 value to the corresponding source2 value and stores it in the destination array of the receiver.

◆ addSample()

template<typename SampleType>
void juce::dsp::AudioBlock< SampleType >::addSample ( int  destChannel,
int  destSample,
SampleType  valueToAdd 
)
inlinenoexcept

Adds a value to a sample in the buffer.

The channel and index are not checked - they are expected to be in-range. If not, an assertion will be thrown, but in a release build, you're into 'undefined behaviour' territory.

◆ addWithMultiply() [1/2]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::addWithMultiply ( AudioBlock< SampleType >  src,
SampleType  factor 
)
inlinenoexcept

Multiplies each value in src with factor and adds the result to the receiver.

◆ addWithMultiply() [2/2]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::addWithMultiply ( AudioBlock< SampleType >  src1,
AudioBlock< SampleType >  src2 
)
inlinenoexcept

Multiplies each value in srcA with the corresponding value in srcB and adds the result to the receiver.

◆ channelPtr() [1/2]

template<typename SampleType>
NumericType* juce::dsp::AudioBlock< SampleType >::channelPtr ( size_t  ch)
inlineprivatenoexcept

◆ channelPtr() [2/2]

template<typename SampleType>
const NumericType* juce::dsp::AudioBlock< SampleType >::channelPtr ( size_t  ch) const
inlineprivatenoexcept

◆ clear()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::clear ( )
inlinenoexcept

Clear the memory described by this AudioBlock.

◆ copy()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::copy ( AudioBlock< SampleType >  src)
inlinenoexcept

Copy the values in src to the receiver.

◆ copyFrom()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::copyFrom ( const AudioBuffer< NumericType > &  src,
size_t  srcPos = 0,
size_t  dstPos = 0,
size_t  numElements = std::numeric_limits<size_t>::max() 
)
inline

Copy the values from a JUCE's AudioBuffer to the receiver.

All indices and sizes are in the receiver's units, i.e. if SampleType is a SIMDRegister then incrementing srcPos by one will increase the sample position in the AudioBuffer's units by a factor of SIMDRegister<SampleType>::SIMDNumElements.

◆ copyTo()

template<typename SampleType>
forcedinline const AudioBlock& juce::dsp::AudioBlock< SampleType >::copyTo ( AudioBuffer< NumericType > &  dst,
size_t  srcPos = 0,
size_t  dstPos = 0,
size_t  numElements = std::numeric_limits<size_t>::max() 
) const
inline

Copy the values from the receiver to a JUCE's AudioBuffer.

All indices and sizes are in the receiver's units, i.e. if SampleType is a SIMDRegister then incrementing dstPos by one will increase the sample position in the AudioBuffer's units by a factor of SIMDRegister<SampleType>::SIMDNumElements.

◆ fill()

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::fill ( SampleType  value)
inlinenoexcept

Fill memory with value.

◆ findMinAndMax()

template<typename SampleType>
forcedinline Range<NumericType> juce::dsp::AudioBlock< SampleType >::findMinAndMax ( ) const
inlinenoexcept

Finds the minimum and maximum value of the buffer.

◆ getChannelPointer() [1/2]

template<typename SampleType>
forcedinline const SampleType* juce::dsp::AudioBlock< SampleType >::getChannelPointer ( size_t  channel) const
inlinenoexcept

Returns a raw pointer into one of the channels in this block.

Referenced by juce::dsp::AudioBlock< float >::process().

◆ getChannelPointer() [2/2]

template<typename SampleType>
forcedinline SampleType* juce::dsp::AudioBlock< SampleType >::getChannelPointer ( size_t  channel)
inlinenoexcept

Returns a raw pointer into one of the channels in this block.

◆ getNumChannels()

template<typename SampleType>
forcedinline size_t juce::dsp::AudioBlock< SampleType >::getNumChannels ( ) const
inlinenoexcept

◆ getNumSamples()

template<typename SampleType>
forcedinline size_t juce::dsp::AudioBlock< SampleType >::getNumSamples ( ) const
inlinenoexcept

◆ getSample()

template<typename SampleType>
SampleType juce::dsp::AudioBlock< SampleType >::getSample ( int  channel,
int  sampleIndex 
) const
inlinenoexcept

Returns a sample from the buffer.

The channel and index are not checked - they are expected to be in-range. If not, an assertion will be thrown, but in a release build, you're into 'undefined behaviour' territory.

◆ getSingleChannelBlock()

template<typename SampleType>
forcedinline AudioBlock juce::dsp::AudioBlock< SampleType >::getSingleChannelBlock ( size_t  channel) const
inlinenoexcept

Returns an AudioBlock that represents one of the channels in this block.

◆ getSubBlock() [1/2]

template<typename SampleType>
AudioBlock juce::dsp::AudioBlock< SampleType >::getSubBlock ( size_t  newOffset,
size_t  newLength 
) const
inlinenoexcept

Return a new AudioBlock pointing to a sub-block inside the receiver.

This function does not copy the memory and you must ensure that the original memory pointed to by the receiver remains valid through-out the life-time of the returned sub-block.

Parameters
newOffsetThe index of an element inside the receiver which will will become the first element of the return value.
newLengthThe number of elements of the newly created sub-block.

◆ getSubBlock() [2/2]

template<typename SampleType>
AudioBlock juce::dsp::AudioBlock< SampleType >::getSubBlock ( size_t  newOffset) const
inlinenoexcept

Return a new AudioBlock pointing to a sub-block inside the receiver.

This function does not copy the memory and you must ensure that the original memory pointed to by the receiver remains valid through-out the life-time of the returned sub-block.

Parameters
newOffsetThe index of an element inside the receiver which will will become the first element of the return value. The return value will include all subsequent elements of the receiver.

◆ getSubsetChannelBlock()

template<typename SampleType>
forcedinline AudioBlock juce::dsp::AudioBlock< SampleType >::getSubsetChannelBlock ( size_t  channelStart,
size_t  numChannelsToUse 
)
inlinenoexcept

Returns a subset of continguous channels.

Parameters
channelStartFirst channel of the subset
numChannelsToUseCount of channels in the subset

◆ max()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::max ( AudioBlock< SampleType >  src1,
AudioBlock< SampleType >  src2 
)
inlinenoexcept

Each element of the receiver will be the maximum of the corresponding element of the source arrays.

◆ min()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::min ( AudioBlock< SampleType >  src1,
AudioBlock< SampleType >  src2 
)
inlinenoexcept

Each element of receiver will be the minimum of the corresponding element of the source arrays.

◆ move()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::move ( size_t  srcPos,
size_t  dstPos,
size_t  numElements = std::numeric_limits<size_t>::max() 
)
inlinenoexcept

Move memory within the receiver from the position srcPos to the position dstPos.

If numElements is not specified then move will move the maximum amount of memory.

◆ multiply() [1/6]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::multiply ( SampleType  value)
inlinenoexcept

Multiplies a fixed value to the receiver.

◆ multiply() [2/6]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::multiply ( AudioBlock< SampleType >  src)
inlinenoexcept

Multiplies the source values to the receiver.

◆ multiply() [3/6]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::multiply ( AudioBlock< SampleType >  src,
SampleType  value 
)
inlinenoexcept

Multiplies a fixed value to each source value and stores it in the destination array of the receiver.

◆ multiply() [4/6]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::multiply ( AudioBlock< SampleType >  src1,
AudioBlock< SampleType >  src2 
)
inlinenoexcept

Multiplies each source1 value to the corresponding source2 value and stores it in the destination array of the receiver.

◆ multiply() [5/6]

template<typename SampleType>
AudioBlock& juce::dsp::AudioBlock< SampleType >::multiply ( LinearSmoothedValue< SampleType > &  value)
inlinenoexcept

Multiplies all channels of the AudioBlock by a smoothly changing value and stores them .

◆ multiply() [6/6]

template<typename SampleType>
AudioBlock& juce::dsp::AudioBlock< SampleType >::multiply ( AudioBlock< SampleType >  src,
LinearSmoothedValue< SampleType > &  value 
)
inlinenoexcept

Multiplies all channels of the source by a smoothly changing value and stores them in the receiver.

◆ negate()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::negate ( )
inlinenoexcept

Negates each value of the receiver.

◆ operator*=() [1/3]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::operator*= ( SampleType  src)
inlinenoexcept

◆ operator*=() [2/3]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::operator*= ( AudioBlock< SampleType >  src)
inlinenoexcept

◆ operator*=() [3/3]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::operator*= ( LinearSmoothedValue< SampleType > &  value)
inlinenoexcept

◆ operator+=() [1/2]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::operator+= ( SampleType  src)
inlinenoexcept

◆ operator+=() [2/2]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::operator+= ( AudioBlock< SampleType >  src)
inlinenoexcept

◆ operator-=() [1/2]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::operator-= ( SampleType  src)
inlinenoexcept

◆ operator-=() [2/2]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::operator-= ( AudioBlock< SampleType >  src)
inlinenoexcept

◆ operator=()

template<typename SampleType>
AudioBlock& juce::dsp::AudioBlock< SampleType >::operator= ( const AudioBlock< SampleType > &  other)
defaultnoexcept

◆ process()

template<typename SampleType>
template<typename FunctionType >
static void juce::dsp::AudioBlock< SampleType >::process ( AudioBlock< SampleType >  inBlock,
AudioBlock< SampleType >  outBlock,
FunctionType &&  function 
)
inlinestatic

Applies a function to each value in an input block, putting the result into an output block.

The function supplied must take a SampleType as its parameter, and return a SampleType. The two blocks must have the same number of channels and samples.

Referenced by juce::dsp::WaveShaper< FloatType, Function >::process().

◆ replaceWithAbsoluteValueOf()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::replaceWithAbsoluteValueOf ( AudioBlock< SampleType >  src)
inlinenoexcept

Takes the absolute value of each element of src and stores it inside the receiver.

◆ replaceWithNegativeOf()

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::replaceWithNegativeOf ( AudioBlock< SampleType >  src)
inlinenoexcept

Negates each value of source and stores it in the receiver.

◆ setSample()

template<typename SampleType>
void juce::dsp::AudioBlock< SampleType >::setSample ( int  destChannel,
int  destSample,
SampleType  newValue 
)
inlinenoexcept

Modifies a sample in the buffer.

The channel and index are not checked - they are expected to be in-range. If not, an assertion will be thrown, but in a release build, you're into 'undefined behaviour' territory.

◆ subtract() [1/4]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::subtract ( SampleType  value)
inlinenoexcept

Subtracts a fixed value from the receiver.

◆ subtract() [2/4]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::subtract ( AudioBlock< SampleType >  src)
inlinenoexcept

Subtracts the source values from the receiver.

◆ subtract() [3/4]

template<typename SampleType>
forcedinline AudioBlock& JUCE_VECTOR_CALLTYPE juce::dsp::AudioBlock< SampleType >::subtract ( AudioBlock< SampleType >  src,
SampleType  value 
)
inlinenoexcept

Subtracts a fixed value from each source value and stores it in the destination array of the receiver.

◆ subtract() [4/4]

template<typename SampleType>
forcedinline AudioBlock& juce::dsp::AudioBlock< SampleType >::subtract ( AudioBlock< SampleType >  src1,
AudioBlock< SampleType >  src2 
)
inlinenoexcept

Subtracts each source2 value from the corresponding source1 value and stores it in the destination array of the receiver.

Member Data Documentation

◆ byteMask

template<typename SampleType>
constexpr size_t juce::dsp::AudioBlock< SampleType >::byteMask = (sizeFactor * sizeof (NumericType)) - 1
staticprivate

◆ channels

template<typename SampleType>
SampleType* const* juce::dsp::AudioBlock< SampleType >::channels
private

◆ defaultAlignment

template<typename SampleType>
constexpr size_t juce::dsp::AudioBlock< SampleType >::defaultAlignment = sizeof (NumericType)
staticprivate

◆ elementMask

template<typename SampleType>
constexpr size_t juce::dsp::AudioBlock< SampleType >::elementMask = sizeFactor - 1
staticprivate

◆ numChannels

template<typename SampleType>
ChannelCountType juce::dsp::AudioBlock< SampleType >::numChannels = 0
private

◆ numSamples

template<typename SampleType>
size_t juce::dsp::AudioBlock< SampleType >::numSamples = 0
private

◆ sizeFactor

template<typename SampleType>
constexpr size_t juce::dsp::AudioBlock< SampleType >::sizeFactor = sizeof (SampleType) / sizeof (NumericType)
staticprivate

◆ startSample

template<typename SampleType>
size_t juce::dsp::AudioBlock< SampleType >::startSample = 0
private

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