Minimal and lightweight data-structure which contains a list of pointers to channels containing some kind of sample data. More...
#include <juce_AudioBlock.h>
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) 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 AudioBlock & | add (const AudioBlock &src) noexcept |
Adds the source values to the receiver. More... | |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | add (const 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 AudioBlock & | add (const AudioBlock &src1, const AudioBlock &src2) noexcept |
Adds each source1 value to the corresponding source2 value and stores it in the destination array of the receiver. More... | |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | addWithMultiply (const AudioBlock &src, SampleType factor) noexcept |
Multiplies each value in src with factor and adds the result to the receiver. More... | |
forcedinline AudioBlock & | addWithMultiply (const AudioBlock &src1, const AudioBlock &src2) noexcept |
Multiplies each value in srcA with the corresponding value in srcB and adds the result to the receiver. More... | |
forcedinline AudioBlock & | clear () noexcept |
Clear the memory described by this AudioBlock. More... | |
forcedinline AudioBlock & | copy (const AudioBlock &src) noexcept |
Copy the values in src to the receiver. More... | |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | fill (SampleType value) noexcept |
Fill memory with value. More... | |
forcedinline Range< NumericType > | findMinAndMax () 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 |
forcedinline AudioBlock< SampleType > | 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< SampleType > | getSubsetChannelBlock (size_t channelStart, size_t numChannelsToUse) noexcept |
Returns a subset of continguous channels. More... | |
forcedinline AudioBlock & | max (AudioBlock src1, AudioBlock src2) noexcept |
Each element of the receiver will be the maximum of the corresponding element of the source arrays. More... | |
forcedinline AudioBlock & | min (const AudioBlock &src1, const AudioBlock &src2) noexcept |
Each element of receiver will be the minimum of the corresponding element of the source arrays. More... | |
forcedinline AudioBlock & | move (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 AudioBlock & | multiply (const AudioBlock &src) noexcept |
Multiplies the source values to the receiver. More... | |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | multiply (const 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 AudioBlock & | multiply (const AudioBlock &src1, const AudioBlock &src2) noexcept |
Multiplies each source1 value to the corresponding source2 value and stores it in the destination array of the receiver. More... | |
forcedinline AudioBlock & | negate () noexcept |
Negates each value of the receiver. More... | |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | operator*= (SampleType src) noexcept |
forcedinline AudioBlock & | operator*= (AudioBlock src) noexcept |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | operator+= (SampleType src) noexcept |
forcedinline AudioBlock & | operator+= (AudioBlock src) noexcept |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | operator-= (SampleType src) noexcept |
forcedinline AudioBlock & | operator-= (AudioBlock src) noexcept |
AudioBlock & | operator= (const AudioBlock &other) noexcept=default |
forcedinline AudioBlock & | replaceWithAbsoluteValueOf (const AudioBlock &src) noexcept |
Takes the absolute value of each element of src and stores it inside the receiver. More... | |
forcedinline AudioBlock & | replaceWithNegativeOf (const AudioBlock &src) noexcept |
Negates each value of source and stores it in the receiver. More... | |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | subtract (SampleType value) noexcept |
Subtracts a fixed value from the receiver. More... | |
forcedinline AudioBlock & | subtract (const AudioBlock &src) noexcept |
Subtracts the source values from the receiver. More... | |
forcedinline AudioBlock &JUCE_VECTOR_CALLTYPE | subtract (const 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 AudioBlock & | subtract (const AudioBlock &src1, const 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 (const AudioBlock< SampleType > &inBlock, AudioBlock< SampleType > &outBlock, const FunctionType &function) |
Private Types | |
using | ChannelCountType = unsigned int |
Private Member Functions | |
NumericType * | channelPtr (size_t ch) noexcept |
const NumericType * | channelPtr (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 | elementMask = sizeFactor - 1 |
static constexpr size_t | sizeFactor = sizeof (SampleType) / sizeof (NumericType) |
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 AudioSampleBuffer 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.
|
private |
using AudioBlock< SampleType >::NumericType = typename SampleTypeHelpers::ElementType<SampleType>::Type |
|
inlinenoexcept |
Create a zero-sized AudioBlock.
|
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.
|
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.
|
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.
References addBytesToPointer(), and snapPointerToAlignment().
|
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.
|
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.
References jassert.
|
defaultnoexcept |
|
inlinenoexcept |
Adds a fixed value to the receiver.
References FloatVectorOperations::add().
|
inlinenoexcept |
Adds the source values to the receiver.
References FloatVectorOperations::add(), jassert, and juce::jmin().
|
inlinenoexcept |
Adds a fixed value to each source value and stores it in the destination array of the receiver.
References FloatVectorOperations::add(), jassert, and juce::jmin().
|
inlinenoexcept |
Adds each source1 value to the corresponding source2 value and stores it in the destination array of the receiver.
References FloatVectorOperations::add(), jassert, and juce::jmin().
|
inlinenoexcept |
Multiplies each value in src with factor and adds the result to the receiver.
References FloatVectorOperations::addWithMultiply(), jassert, and juce::jmin().
|
inlinenoexcept |
Multiplies each value in srcA with the corresponding value in srcB and adds the result to the receiver.
References FloatVectorOperations::addWithMultiply(), jassert, and juce::jmin().
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
inlinenoexcept |
Clear the memory described by this AudioBlock.
References FloatVectorOperations::clear().
|
inlinenoexcept |
Copy the values in src to the receiver.
References FloatVectorOperations::copy(), and juce::jmin().
|
inlinenoexcept |
Fill memory with value.
References FloatVectorOperations::fill().
|
inlinenoexcept |
Finds the minimum and maximum value of the buffer.
References FloatVectorOperations::findMinAndMax(), and Range< ValueType >::getUnionWith().
|
inlinenoexcept |
Returns a raw pointer into one of the channels in this block.
References jassert.
Referenced by AudioBlock< SampleType >::process().
|
inlinenoexcept |
Returns a raw pointer into one of the channels in this block.
References jassert.
|
inlinenoexcept |
Referenced by AudioBlock< SampleType >::process().
|
inlinenoexcept |
Referenced by AudioBlock< SampleType >::process().
|
inlinenoexcept |
Returns an AudioBlock that represents one of the channels in this block.
References jassert.
|
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.
newOffset | The index of an element inside the reciever which will will become the first element of the return value. |
newLength | The number of elements of the newly created sub-block. |
References jassert.
|
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.
newOffset | The index of an element inside the reciever which will will become the first element of the return value. The return value will include all subsequent elements of the receiver. |
|
inlinenoexcept |
Returns a subset of continguous channels.
channelStart | First channel of the subset |
numChannelsToUse | Count of channels in the subset |
References jassert.
|
inlinenoexcept |
Each element of the receiver will be the maximum of the corresponding element of the source arrays.
References jassert, juce::jmin(), and FloatVectorOperations::max().
|
inlinenoexcept |
Each element of receiver will be the minimum of the corresponding element of the source arrays.
References jassert, juce::jmin(), and FloatVectorOperations::min().
|
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.
References jassert, and juce::jmin().
|
inlinenoexcept |
Multiplies a fixed value to the receiver.
References FloatVectorOperations::multiply().
|
inlinenoexcept |
Multiplies the source values to the receiver.
References jassert, juce::jmin(), and FloatVectorOperations::multiply().
|
inlinenoexcept |
Multiplies a fixed value to each source value and stores it in the destination array of the receiver.
References jassert, juce::jmin(), and FloatVectorOperations::multiply().
|
inlinenoexcept |
Multiplies each source1 value to the corresponding source2 value and stores it in the destination array of the receiver.
References jassert, juce::jmin(), and FloatVectorOperations::multiply().
|
inlinenoexcept |
Negates each value of the receiver.
|
inlinenoexcept |
|
inlinenoexcept |
References JUCE_USE_SIMD.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
defaultnoexcept |
|
inlinestatic |
|
inlinenoexcept |
Takes the absolute value of each element of src and stores it inside the receiver.
References FloatVectorOperations::abs(), jassert, and juce::jmin().
|
inlinenoexcept |
Negates each value of source and stores it in the receiver.
References jassert, juce::jmin(), and FloatVectorOperations::negate().
|
inlinenoexcept |
Subtracts a fixed value from the receiver.
|
inlinenoexcept |
Subtracts the source values from the receiver.
References jassert, juce::jmin(), and FloatVectorOperations::subtract().
|
inlinenoexcept |
Subtracts a fixed value from each source value and stores it in the destination array of the receiver.
|
inlinenoexcept |
Subtracts each source2 value from the corresponding source1 value and stores it in the destination array of the receiver.
References jassert, juce::jmin(), and FloatVectorOperations::subtract().
|
staticprivate |
|
private |
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
private |