![]() |
Cinder
0.9.1
|
#include <Buffer.h>
Inherits cinder::audio::BufferBaseT< T >.
Inherited by cinder::audio::BufferSpectralT< T >.
Public Types | |
typedef T | SampleType |
Public Member Functions | |
BufferT (size_t numFrames=0, size_t numChannels=1) | |
T * | getChannel (size_t ch) |
const T * | getChannel (size_t ch) const |
void | zero (size_t startFrame, size_t numFrames) |
void | zeroChannel (size_t ch) |
void | copy (const BufferT< T > &other) |
void | copy (const BufferT< T > &other, size_t numFrames) |
void | copyOffset (const BufferT< T > &other, size_t numFrames, size_t frameOffset, size_t otherFrameOffset) |
void | copyChannel (size_t channel, const T *otherChannel) |
size_t | getNumFrames () const |
size_t | getNumChannels () const |
size_t | getSize () const |
bool | isEmpty () const |
T * | getData () |
const T * | getData () const |
T & | operator[] (size_t n) |
const T & | operator[] (size_t n) const |
void | zero () |
Protected Attributes | |
std::vector< T > | mData |
size_t | mNumChannels |
size_t | mNumFrames |
Audio buffer that stores its channels of type T contiguously (ie. the first sample of channel 1 is directly after the last sample of channel 0). Bounds checking is accomplished with assertions that are disabled in release mode by default.
|
inherited |
The compile-time defined type of samples contained in the buffer.
cinder::audio::BufferT< T >::BufferT | ( | size_t | numFrames = 0 , |
size_t | numChannels = 1 |
||
) |
Constructs a BufferT object with numFrames number of frames (default = 0) and numChannels number of channels (default = 1).
T* cinder::audio::BufferT< T >::getChannel | ( | size_t | ch | ) |
Returns a pointer offset to the first sample of channel ch.
const T* cinder::audio::BufferT< T >::getChannel | ( | size_t | ch | ) | const |
Returns a const pointer offset to the first sample of channel ch.
void cinder::audio::BufferT< T >::zero | ( | size_t | startFrame, |
size_t | numFrames | ||
) |
Assigns zero to numFrames frames starting at startFrame.
void cinder::audio::BufferT< T >::zeroChannel | ( | size_t | ch | ) |
Assigns zero to all samples in channel channel.
void cinder::audio::BufferT< T >::copy | ( | const BufferT< T > & | other | ) |
Copies min( this, other ) channels and frames from other to internal storage.
void cinder::audio::BufferT< T >::copy | ( | const BufferT< T > & | other, |
size_t | numFrames | ||
) |
Copies numFrames frames from other into internal storage.
void cinder::audio::BufferT< T >::copyOffset | ( | const BufferT< T > & | other, |
size_t | numFrames, | ||
size_t | frameOffset, | ||
size_t | otherFrameOffset | ||
) |
Copies numFrames frames from other offset by otherFrameOffset into internal storage offset by frameOffset.
void cinder::audio::BufferT< T >::copyChannel | ( | size_t | channel, |
const T * | otherChannel | ||
) |
Copies otherChannel to the internal channel channel. Assumes there is at least getNumFrames()
samples in otherChannel.
|
inherited |
Returns the number of frames in the buffer.
|
inherited |
Returns the number of channels in the buffer.
|
inherited |
Returns the total size of the buffer (frames * channels).
|
inherited |
Returns true if number of frames is zero, false otherwise.
|
inherited |
Returns a pointer to the first sample in the data buffer.
|
inherited |
Returns a const pointer to the first sample in the data buffer.
|
inherited |
|
inherited |
|
inherited |
Sets all samples to the value zero.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |