Cinder  0.9.1
Public Types | Public Member Functions | Protected Attributes | List of all members
cinder::audio::BufferSpectralT< T > Class Template Reference

#include <Buffer.h>

Inherits cinder::audio::BufferT< T >.

Public Types

typedef T SampleType
 

Public Member Functions

 BufferSpectralT (size_t numFrames=0)
 
T * getReal ()
 
const T * getReal () const
 
T * getImag ()
 
const T * getImag () const
 
T * getChannel (size_t ch)
 
const T * getChannel (size_t ch) const
 
void zero (size_t startFrame, size_t numFrames)
 
void zero ()
 
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
 

Protected Attributes

std::vector< T > mData
 
size_t mNumChannels
 
size_t mNumFrames
 

Detailed Description

template<typename T>
class cinder::audio::BufferSpectralT< T >

A buffer that contains frequency domain audio data.

The channels relate to the results of an FFT transform, channel = 0 is real and channel = 1 is imaginary. The reasoning for subclassing BufferT is in part for clarity and also so that a BufferSpectralT can be handled by generic processing Node's as well, which can operate on both time and frequency domain signals.

Member Typedef Documentation

template<typename T>
typedef T cinder::audio::BufferBaseT< T >::SampleType
inherited

The compile-time defined type of samples contained in the buffer.

Constructor & Destructor Documentation

template<typename T>
cinder::audio::BufferSpectralT< T >::BufferSpectralT ( size_t  numFrames = 0)

Constructs a BufferSpectralT object of frames numFrames. There is always two channels, where channel 0 is the real component and 1 is the imaginary component.

Member Function Documentation

template<typename T>
T* cinder::audio::BufferSpectralT< T >::getReal ( )

Returns a pointer to the first sample in the real component channel.

template<typename T>
const T* cinder::audio::BufferSpectralT< T >::getReal ( ) const

Returns a const pointer to the first sample in the real component channel.

template<typename T>
T* cinder::audio::BufferSpectralT< T >::getImag ( )

Returns a pointer to the first sample in the imaginary component channel.

template<typename T>
const T* cinder::audio::BufferSpectralT< T >::getImag ( ) const

Returns a const pointer to the first sample in the imaginary component channel.

template<typename T>
T* cinder::audio::BufferT< T >::getChannel ( size_t  ch)
inherited

Returns a pointer offset to the first sample of channel ch.

template<typename T>
const T* cinder::audio::BufferT< T >::getChannel ( size_t  ch) const
inherited

Returns a const pointer offset to the first sample of channel ch.

template<typename T>
void cinder::audio::BufferT< T >::zero ( size_t  startFrame,
size_t  numFrames 
)
inherited

Assigns zero to numFrames frames starting at startFrame.

template<typename T>
void cinder::audio::BufferBaseT< T >::zero ( )
inherited

Sets all samples to the value zero.

template<typename T>
void cinder::audio::BufferT< T >::zeroChannel ( size_t  ch)
inherited

Assigns zero to all samples in channel channel.

template<typename T>
void cinder::audio::BufferT< T >::copy ( const BufferT< T > &  other)
inherited

Copies min( this, other ) channels and frames from other to internal storage.

template<typename T>
void cinder::audio::BufferT< T >::copy ( const BufferT< T > &  other,
size_t  numFrames 
)
inherited

Copies numFrames frames from other into internal storage.

Note
requires channel counts to match.
template<typename T>
void cinder::audio::BufferT< T >::copyOffset ( const BufferT< T > &  other,
size_t  numFrames,
size_t  frameOffset,
size_t  otherFrameOffset 
)
inherited

Copies numFrames frames from other offset by otherFrameOffset into internal storage offset by frameOffset.

Note
requires channel counts to match.
template<typename T>
void cinder::audio::BufferT< T >::copyChannel ( size_t  channel,
const T *  otherChannel 
)
inherited

Copies otherChannel to the internal channel channel. Assumes there is at least getNumFrames() samples in otherChannel.

template<typename T>
size_t cinder::audio::BufferBaseT< T >::getNumFrames ( ) const
inherited

Returns the number of frames in the buffer.

template<typename T>
size_t cinder::audio::BufferBaseT< T >::getNumChannels ( ) const
inherited

Returns the number of channels in the buffer.

template<typename T>
size_t cinder::audio::BufferBaseT< T >::getSize ( ) const
inherited

Returns the total size of the buffer (frames * channels).

template<typename T>
bool cinder::audio::BufferBaseT< T >::isEmpty ( ) const
inherited

Returns true if number of frames is zero, false otherwise.

template<typename T>
T* cinder::audio::BufferBaseT< T >::getData ( )
inherited

Returns a pointer to the first sample in the data buffer.

template<typename T>
const T* cinder::audio::BufferBaseT< T >::getData ( ) const
inherited

Returns a const pointer to the first sample in the data buffer.

template<typename T>
T& cinder::audio::BufferBaseT< T >::operator[] ( size_t  n)
inherited
template<typename T>
const T& cinder::audio::BufferBaseT< T >::operator[] ( size_t  n) const
inherited

Member Data Documentation

template<typename T>
std::vector<T> cinder::audio::BufferBaseT< T >::mData
protectedinherited
template<typename T>
size_t cinder::audio::BufferBaseT< T >::mNumChannels
protectedinherited
template<typename T>
size_t cinder::audio::BufferBaseT< T >::mNumFrames
protectedinherited

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