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

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. More...

#include <Buffer.h>

Inheritance diagram for cinder::audio::BufferDynamicT< BufferTT >:
[legend]

Public Member Functions

 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). More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
void shrinkToFit ()
 Shrinks the allocated size to match the specified size, freeing any extra memory. More...
 
size_t getAllocatedSize () const
 Returns the number of samples allocated in this buffer (may be larger than getSize()). More...
 

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: