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, 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 AudioBlock & | add (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 AudioBlock & | add (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 AudioBlock & | addWithMultiply (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 AudioBlock & | clear () noexcept |
Clear the memory described by this AudioBlock. More... | |
forcedinline AudioBlock & | copy (AudioBlock src) noexcept |
Copy the values in src to the receiver. More... | |
forcedinline AudioBlock & | copyFrom (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 AudioBlock & | copyTo (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< 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 |
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 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 (AudioBlock src1, 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 (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 AudioBlock & | multiply (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... | |
AudioBlock & | multiply (LinearSmoothedValue< SampleType > &value) noexcept |
Multiplies all channels of the AudioBlock by a smoothly changing value and stores them . More... | |
AudioBlock & | multiply (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 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 & | operator*= (LinearSmoothedValue< SampleType > &value) 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 (AudioBlock src) noexcept |
Takes the absolute value of each element of src and stores it inside the receiver. More... | |
forcedinline AudioBlock & | replaceWithNegativeOf (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 AudioBlock & | subtract (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 AudioBlock & | subtract (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 | |
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 | defaultAlignment = sizeof (NumericType) |
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 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}
|
private |
using juce::dsp::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 |
|
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.
|
defaultnoexcept |
|
inlinenoexcept |
Adds a fixed value to the receiver.
|
inlinenoexcept |
Adds the source values to the receiver.
|
inlinenoexcept |
Adds a fixed value to each source value and stores it in the destination array of the receiver.
|
inlinenoexcept |
Adds each source1 value to the corresponding source2 value and stores it in the destination array of the receiver.
|
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.
|
inlinenoexcept |
Multiplies each value in src with factor and adds the result to the receiver.
|
inlinenoexcept |
Multiplies each value in srcA with the corresponding value in srcB and adds the result to the receiver.
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
inlinenoexcept |
Clear the memory described by this AudioBlock.
|
inlinenoexcept |
Copy the values in src to the receiver.
|
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.
|
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.
|
inlinenoexcept |
Fill memory with value.
|
inlinenoexcept |
Finds the minimum and maximum value of the buffer.
|
inlinenoexcept |
Returns a raw pointer into one of the channels in this block.
Referenced by juce::dsp::AudioBlock< float >::process().
|
inlinenoexcept |
Returns a raw pointer into one of the channels in this block.
|
inlinenoexcept |
Referenced by juce::dsp::AudioBlock< float >::process().
|
inlinenoexcept |
Referenced by juce::dsp::AudioBlock< float >::process().
|
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.
|
inlinenoexcept |
Returns an AudioBlock that represents one of the channels in this block.
|
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 receiver which will will become the first element of the return value. |
newLength | The number of elements of the newly created sub-block. |
|
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 receiver 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 |
|
inlinenoexcept |
Each element of the receiver will be the maximum of the corresponding element of the source arrays.
|
inlinenoexcept |
Each element of receiver will be the minimum of the corresponding element of the source arrays.
|
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.
|
inlinenoexcept |
Multiplies a fixed value to the receiver.
|
inlinenoexcept |
Multiplies the source values to the receiver.
|
inlinenoexcept |
Multiplies a fixed value to each source value and stores it in the destination array of the receiver.
|
inlinenoexcept |
Multiplies each source1 value to the corresponding source2 value and stores it in the destination array of the receiver.
|
inlinenoexcept |
Multiplies all channels of the AudioBlock by a smoothly changing value and stores them .
|
inlinenoexcept |
Multiplies all channels of the source by a smoothly changing value and stores them in the receiver.
|
inlinenoexcept |
Negates each value of the receiver.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
defaultnoexcept |
|
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().
|
inlinenoexcept |
Takes the absolute value of each element of src and stores it inside the receiver.
|
inlinenoexcept |
Negates each value of source and stores it in the receiver.
|
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.
|
inlinenoexcept |
Subtracts a fixed value from the receiver.
|
inlinenoexcept |
Subtracts the source values from the receiver.
|
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.
|
staticprivate |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
private |