Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cinder::audio::BufferBaseT< T > Class Template Reference

Base class for the various Buffer classes. The template parameter T defined the sample type (precision). More...

#include <Buffer.h>

Inheritance diagram for cinder::audio::BufferBaseT< T >:
[legend]

Public Types

typedef T SampleType
 The compile-time defined type of samples contained in the buffer. More...
 

Public Member Functions

size_t getNumFrames () const
 Returns the number of frames in the buffer. More...
 
size_t getNumChannels () const
 Returns the number of channels in the buffer. More...
 
size_t getSize () const
 Returns the total size of the buffer (frames * channels). More...
 
bool isEmpty () const
 Returns true if number of frames is zero, false otherwise. More...
 
T * getData ()
 Returns a pointer to the first sample in the data buffer. More...
 
const T * getData () const
 Returns a const pointer to the first sample in the data buffer. More...
 
T & operator[] (size_t n)
 
const T & operator[] (size_t n) const
 
void zero ()
 Sets all samples to the value zero. More...
 

Protected Member Functions

 BufferBaseT (size_t numFrames, size_t numChannels)
 

Protected Attributes

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

Detailed Description

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

Base class for the various Buffer classes. The template parameter T defined the sample type (precision).

Member Typedef Documentation

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

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

Constructor & Destructor Documentation

template<typename T>
cinder::audio::BufferBaseT< T >::BufferBaseT ( size_t  numFrames,
size_t  numChannels 
)
protected

Member Function Documentation

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

Returns the number of frames in the buffer.

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

Returns the number of channels in the buffer.

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

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

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

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

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

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

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

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

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

Sets all samples to the value zero.

Member Data Documentation

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

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