Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

syn::SampleBuffer Class Template Reference

a buffer of audio samples. More...

#include <SampleBuffer.h>

Collaboration diagram for syn::SampleBuffer:

Collaboration graph
[legend]
List of all members.

Public Types

typedef DATA_TYPE DataType

Public Methods

 SampleBuffer ()
unsigned int size () const
 amount of data contained (num samples). More...

void resize (unsigned int x)
 change size. More...

unsigned int bytes () const
 amount of data contained (num bytes). More...

unsigned int capacity () const
 amount of data this buffer can hold. More...

void recapacity (unsigned int x)
 change capacity. More...

DATA_TYPE* data ()
 returns the data ptr. More...

DATA_TYPE& operator[] (unsigned int x)
 access individual samples. More...

const DATA_TYPE& operator[] (unsigned int x) const
 access individual samples (const version). More...

DATA_TYPE* frame (unsigned int x)
 jump to frame number x. More...

const DATA_TYPE* frame (unsigned int x) const
 jump to frame number x (const version). More...

iterator begin ()
 get the beginning read iterator. More...

iterator end ()
 get the ending write iterator. More...

frame_iterator fbegin ()
 get the beginning read iterator. More...

frame_iterator fend ()
 get the ending write iterator. More...

void fill (iterator pos, iterator f, iterator l)
 do a memcopy from f to l starting at position pos. More...

void fill (iterator pos, DATA_TYPE *d, unsigned int size)
 do a memcopy from f to l starting at position pos. More...


Detailed Description

template<typename DATA_TYPE = float, int CHAN = 1> class syn::SampleBuffer

a buffer of audio samples.

Definition at line 46 of file SampleBuffer.h.


Member Typedef Documentation

template<typename DATA_TYPE = float, int CHAN = 1>
typedef DATA_TYPE syn::SampleBuffer<DATA_TYPE, CHAN>::DataType
 

Definition at line 49 of file SampleBuffer.h.


Constructor & Destructor Documentation

template<typename DATA_TYPE = float, int CHAN = 1>
syn::SampleBuffer<DATA_TYPE, CHAN>::SampleBuffer<DATA_TYPE, CHAN> ( ) [inline]
 

Definition at line 51 of file SampleBuffer.h.


Member Function Documentation

template<typename DATA_TYPE = float, int CHAN = 1>
unsigned int syn::SampleBuffer<DATA_TYPE, CHAN>::size ( ) const [inline]
 

amount of data contained (num samples).

Definition at line 56 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
void syn::SampleBuffer<DATA_TYPE, CHAN>::resize ( unsigned int x ) [inline]
 

change size.

Definition at line 62 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
unsigned int syn::SampleBuffer<DATA_TYPE, CHAN>::bytes ( ) const [inline]
 

amount of data contained (num bytes).

Definition at line 70 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
unsigned int syn::SampleBuffer<DATA_TYPE, CHAN>::capacity ( ) const [inline]
 

amount of data this buffer can hold.

Definition at line 76 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
void syn::SampleBuffer<DATA_TYPE, CHAN>::recapacity ( unsigned int x ) [inline]
 

change capacity.

Definition at line 82 of file SampleBuffer.h.

Referenced by resize().

template<typename DATA_TYPE = float, int CHAN = 1>
DATA_TYPE * syn::SampleBuffer<DATA_TYPE, CHAN>::data ( ) [inline]
 

returns the data ptr.

Definition at line 89 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
DATA_TYPE & syn::SampleBuffer<DATA_TYPE, CHAN>::operator[] ( unsigned int x ) [inline]
 

access individual samples.

Definition at line 95 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
const DATA_TYPE & syn::SampleBuffer<DATA_TYPE, CHAN>::operator[] ( unsigned int x ) const [inline]
 

access individual samples (const version).

Definition at line 101 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
DATA_TYPE * syn::SampleBuffer<DATA_TYPE, CHAN>::frame ( unsigned int x ) [inline]
 

jump to frame number x.

a frame is one sample of data over all channels. for stereo this returns the first of a pair of samples. for mono, it just returns a pointer to one sample. for quad, it returns the first of 4 samples.

Definition at line 112 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
const DATA_TYPE * syn::SampleBuffer<DATA_TYPE, CHAN>::frame ( unsigned int x ) const [inline]
 

jump to frame number x (const version).

Definition at line 118 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
iterator syn::SampleBuffer<DATA_TYPE, CHAN>::begin ( ) [inline]
 

get the beginning read iterator.

Definition at line 155 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
iterator syn::SampleBuffer<DATA_TYPE, CHAN>::end ( ) [inline]
 

get the ending write iterator.

Definition at line 160 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
frame_iterator syn::SampleBuffer<DATA_TYPE, CHAN>::fbegin ( ) [inline]
 

get the beginning read iterator.

Definition at line 197 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
frame_iterator syn::SampleBuffer<DATA_TYPE, CHAN>::fend ( ) [inline]
 

get the ending write iterator.

Definition at line 202 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
void syn::SampleBuffer<DATA_TYPE, CHAN>::fill ( iterator pos,
iterator f,
iterator l ) [inline]
 

do a memcopy from f to l starting at position pos.

Definition at line 209 of file SampleBuffer.h.

template<typename DATA_TYPE = float, int CHAN = 1>
void syn::SampleBuffer<DATA_TYPE, CHAN>::fill ( iterator pos,
DATA_TYPE * d,
unsigned int size ) [inline]
 

do a memcopy from f to l starting at position pos.

Definition at line 218 of file SampleBuffer.h.


The documentation for this class was generated from the following file:
Generated at Mon Apr 15 09:28:05 2002 for subsynth by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001