csl::Buffer Class Reference

#include <CSL_Core.h>

Inheritance diagram for csl::Buffer:

csl::BufferCMap

List of all members.

Public Member Functions

 Buffer (unsigned numChannels=1, unsigned numFrames=CGestalt::blockSize())
 Constructors: default is mono and default-size.
 ~Buffer ()
 Destructor.
void setSize (unsigned numChannels, unsigned numFrames)
void setSizeOnly (unsigned numChannels, unsigned numFrames)
 this version doesn't even allocate the pointers
void allocateBuffers () throw (MemoryError)
 fcn to malloc storage buffers
void freeBuffers ()
 fcn to free them
void zeroBuffers ()
 fill all data with 0
void fillWith (sample value)
 fill data with the given value
void copyFrom (Buffer &src) throw (RunTimeError)
 import data from the given buffer
void copySamplesFrom (Buffer &src) throw (RunTimeError)
 import data from the given buffer
SampleBuffer monoBuffer (unsigned bufNum)
 convenience accessor for sample buffers

Public Attributes

SampleBufferVector mBuffers
 the storage vector -- pointers to (SampleBuffer) buffers
unsigned mNumChannels
 num channels in buffer (num mono buffers)
unsigned mNumFrames
 num frames in each buffer
unsigned mMonoBufferByteSize
 size of each buffer in bytes
unsigned mSequence
 sequential serial number
Timestamp mTimestamp
 the buffer's most recent timestamp
bool mAreBuffersAllocated
 are the buffers allocated?
bool mDidIAllocateBuffers
 who allocated my data buffers?
bool mIsPopulated
 does the buffer have data?
bool mAreBuffersZero
 have the buffers been zeroed out?
BufferContentType mType


Detailed Description

Buffer -- the multi-channel sample buffer class (passed around between generators and IO guys).

Buffers have an opaque pointer () to their data () and know their # channels and frames. They have Boolean aspects about their buffer allocation, and can allocate, free, zero, and check their data.

Note that this is a "record" class in that its members are all public and it has no accessor functions or complicated methods. It does handle sample buffer allocation and has Boolean members to determine what its pointer state is.


Constructor & Destructor Documentation

Buffer::Buffer ( unsigned  numChannels = 1,
unsigned  numFrames = CGestalt::blockSize() 
)

Constructors: default is mono and default-size.

References setSize().

Buffer::~Buffer (  ) 

Destructor.

References freeBuffers(), and mDidIAllocateBuffers.


Member Function Documentation

void Buffer::setSize ( unsigned  numChannels,
unsigned  numFrames 
)

void Buffer::setSizeOnly ( unsigned  numChannels,
unsigned  numFrames 
)

this version doesn't even allocate the pointers

References mMonoBufferByteSize, mNumChannels, and mNumFrames.

Referenced by csl::CslRtpSession::OnRTPPacket().

void Buffer::allocateBuffers (  )  throw (MemoryError)

void Buffer::freeBuffers (  ) 

void Buffer::zeroBuffers (  ) 

void Buffer::fillWith ( sample  value  ) 

fill data with the given value

References mAreBuffersZero, mBuffers, mNumChannels, and mNumFrames.

void Buffer::copyFrom ( Buffer src  )  throw (RunTimeError)

import data from the given buffer

Referenced by csl::Abst_SoundFile::mergeToMono().

void Buffer::copySamplesFrom ( Buffer src  )  throw (RunTimeError)

import data from the given buffer

SampleBuffer csl::Buffer::monoBuffer ( unsigned  bufNum  )  [inline]


Member Data Documentation

sequential serial number

the buffer's most recent timestamp

have the buffers been zeroed out?

Referenced by fillWith(), csl::WavetableOscillator::setWaveform(), and zeroBuffers().


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

Generated on Thu Sep 17 23:14:17 2009 for CSL by  doxygen 1.5.8