Cinder  0.9.1
Public Member Functions | List of all members
cinder::audio::BufferDynamicT< BufferTT > Class Template Reference

#include <Buffer.h>

Inherits BufferTT.

Public Member Functions

 BufferDynamicT (size_t numFrames=0, size_t numChannels=1)
 
void setSize (size_t numFrames, size_t numChannels)
 
void setNumFrames (size_t numFrames)
 
void setNumChannels (size_t numChannels)
 
void shrinkToFit ()
 
size_t getAllocatedSize () const
 

Detailed Description

template<typename BufferTT>
class cinder::audio::BufferDynamicT< BufferTT >

A resizable BufferT. The internally allocated buffer will grow as needed, but it will not shrink unless shrinkToFit() is called. TODO: enable move operator to convert BufferT to this.

Constructor & Destructor Documentation

template<typename BufferTT>
cinder::audio::BufferDynamicT< BufferTT >::BufferDynamicT ( size_t  numFrames = 0,
size_t  numChannels = 1 
)

Constructs a BufferDynamicT object with numFrames number of frames (default = 0) and numChannels number of channels (default = 1).

Member Function Documentation

template<typename BufferTT>
void cinder::audio::BufferDynamicT< BufferTT >::setSize ( size_t  numFrames,
size_t  numChannels 
)

Sets the new size of the buffer to numFrames number of frames and numChannels number of channels. Will only resize of the new size (frames * channels) is larger than before.

template<typename BufferTT>
void cinder::audio::BufferDynamicT< BufferTT >::setNumFrames ( size_t  numFrames)

Sets the new number of frames in the buffer to numFrames. Will only resize of the new size (frames * channels) is larger than before.

template<typename BufferTT>
void cinder::audio::BufferDynamicT< BufferTT >::setNumChannels ( size_t  numChannels)

Sets the new number of channels in the buffer to numChannels. Will only resize of the new size (frames * channels) is larger than before.

template<typename BufferTT>
void cinder::audio::BufferDynamicT< BufferTT >::shrinkToFit ( )

Shrinks the allocated size to match the specified size, freeing any extra memory.

template<typename BufferTT>
size_t cinder::audio::BufferDynamicT< BufferTT >::getAllocatedSize ( ) const

Returns the number of samples allocated in this buffer (may be larger than getSize()).


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