HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
AudioBuffer< SampleType > Class Template Reference

#include <hart_audio_buffer.hpp>

Public Member Functions

 AudioBuffer (size_t numChannels=0, size_t numFrames=0)
 
 AudioBuffer (const AudioBuffer &other)
 
 AudioBuffer (AudioBuffer &&other)
 
 ~AudioBuffer ()=default
 
AudioBufferoperator= (const AudioBuffer &other)
 
AudioBufferoperator= (AudioBuffer &&other)
 
const SampleType *constgetArrayOfReadPointers () const
 
SampleType *constgetArrayOfWritePointers ()
 
size_t getNumChannels () const
 
size_t getNumFrames () const
 
SampleTypeoperator[] (size_t channel)
 
const SampleTypeoperator[] (size_t channel) const
 
void appendFrom (const AudioBuffer< SampleType > &otherBuffer)
 
void erase ()
 
SampleType getMagnitude (size_t channel, size_t startFrame, size_t numFrames) const
 
SampleType getMagnitude (size_t startFrame, size_t numFrames) const
 
void copyFrom (size_t destChannel, size_t destStartFrame, const AudioBuffer &source, size_t sourceChannel, size_t sourceStartFrame, size_t numFrames)
 Copies audio from another buffer.
 
void clear ()
 Clears the entire buffer.
 
void clear (size_t channel, size_t startFrame, size_t numFrames)
 Clears a specific section of a given channel.
 

Static Public Member Functions

static AudioBuffer emptyLike (const AudioBuffer &other)
 

Detailed Description

template<typename SampleType>
class hart::AudioBuffer< SampleType >

Definition at line 11 of file hart_audio_buffer.hpp.

Constructor & Destructor Documentation

◆ AudioBuffer() [1/3]

template<typename SampleType >
AudioBuffer ( size_t  numChannels = 0,
size_t  numFrames = 0 
)
inline

Definition at line 14 of file hart_audio_buffer.hpp.

◆ AudioBuffer() [2/3]

template<typename SampleType >
AudioBuffer ( const AudioBuffer< SampleType > &  other)
inline

Definition at line 23 of file hart_audio_buffer.hpp.

◆ AudioBuffer() [3/3]

template<typename SampleType >
AudioBuffer ( AudioBuffer< SampleType > &&  other)
inline

Definition at line 32 of file hart_audio_buffer.hpp.

◆ ~AudioBuffer()

template<typename SampleType >
~AudioBuffer ( )
default

Member Function Documentation

◆ operator=() [1/2]

template<typename SampleType >
AudioBuffer & operator= ( const AudioBuffer< SampleType > &  other)
inline

Definition at line 43 of file hart_audio_buffer.hpp.

◆ operator=() [2/2]

template<typename SampleType >
AudioBuffer & operator= ( AudioBuffer< SampleType > &&  other)
inline

Definition at line 59 of file hart_audio_buffer.hpp.

◆ getArrayOfReadPointers()

template<typename SampleType >
const SampleType *const * getArrayOfReadPointers ( ) const
inline

Definition at line 75 of file hart_audio_buffer.hpp.

◆ getArrayOfWritePointers()

template<typename SampleType >
SampleType *const * getArrayOfWritePointers ( )
inline

Definition at line 80 of file hart_audio_buffer.hpp.

◆ emptyLike()

template<typename SampleType >
static AudioBuffer emptyLike ( const AudioBuffer< SampleType > &  other)
inlinestatic

Definition at line 85 of file hart_audio_buffer.hpp.

◆ getNumChannels()

template<typename SampleType >
size_t getNumChannels ( ) const
inline

Definition at line 90 of file hart_audio_buffer.hpp.

◆ getNumFrames()

template<typename SampleType >
size_t getNumFrames ( ) const
inline

Definition at line 91 of file hart_audio_buffer.hpp.

◆ operator[]() [1/2]

template<typename SampleType >
SampleType * operator[] ( size_t  channel)
inline

Definition at line 93 of file hart_audio_buffer.hpp.

◆ operator[]() [2/2]

template<typename SampleType >
const SampleType * operator[] ( size_t  channel) const
inline

Definition at line 98 of file hart_audio_buffer.hpp.

◆ appendFrom()

template<typename SampleType >
void appendFrom ( const AudioBuffer< SampleType > &  otherBuffer)
inline

Definition at line 103 of file hart_audio_buffer.hpp.

◆ erase()

template<typename SampleType >
void erase ( )
inline

Definition at line 126 of file hart_audio_buffer.hpp.

◆ getMagnitude() [1/2]

template<typename SampleType >
SampleType getMagnitude ( size_t  channel,
size_t  startFrame,
size_t  numFrames 
) const
inline

Definition at line 138 of file hart_audio_buffer.hpp.

◆ getMagnitude() [2/2]

template<typename SampleType >
SampleType getMagnitude ( size_t  startFrame,
size_t  numFrames 
) const
inline

Definition at line 156 of file hart_audio_buffer.hpp.

◆ copyFrom()

template<typename SampleType >
void copyFrom ( size_t  destChannel,
size_t  destStartFrame,
const AudioBuffer< SampleType > &  source,
size_t  sourceChannel,
size_t  sourceStartFrame,
size_t  numFrames 
)
inline

Copies audio from another buffer.

Parameters
destChannelChannel within this buffer to copy the frames to
destStartFrameStart frame within this buffer's channel
sourceSource buffer to read from
sourceChannelChannel within the source buffer to read from
sourceStartFrameOffset within the source buffer's channel to start reading frames from
numFramesNumber of frames to copy

Definition at line 186 of file hart_audio_buffer.hpp.

◆ clear() [1/2]

template<typename SampleType >
void clear ( )
inline

Clears the entire buffer.

Sets all frames in all channels to zeros

Definition at line 203 of file hart_audio_buffer.hpp.

◆ clear() [2/2]

template<typename SampleType >
void clear ( size_t  channel,
size_t  startFrame,
size_t  numFrames 
)
inline

Clears a specific section of a given channel.

Overwrites a selected section of the channel with zeros

Parameters
channelCnannel in which to clear a frame range
startFrameStart of the frame range to clear (inclusive)
numFramesAmount of frames to clear

Definition at line 213 of file hart_audio_buffer.hpp.


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