csl::RingBuffer Class Reference

#include <RingBuffer.h>

Inheritance diagram for csl::RingBuffer:

csl::Effect csl::Scalable csl::Writeable csl::UnitGenerator csl::Controllable csl::Controllable csl::Model

List of all members.

Public Member Functions

 RingBuffer ()
 Constructors.
 RingBuffer (unsigned int nmChannels, unsigned int nmFrames)
 RingBuffer (UnitGenerator &input, unsigned int nmChannels, unsigned int nmFrames)
unsigned seekTo (int position) throw (CException)
void setLoopStart (unsigned frame)
void setLoopEnd (unsigned frame)
 Calls the setLoopStart of it's tap.
void nextBuffer (Buffer &outputBuffer) throw (CException)
 Calls the setLoopEnd of it's tap.
void writeBuffer (Buffer &inputBuffer) throw (CException)
 Write a buffer of data into the ring buffer.
void sumIntoBuffer (Buffer &inputBuffer) throw (CException)
 Do an adding write of data into the ring buffer.
void destructiveNextBuffer (Buffer &outputBuffer) throw (CException)
 Read a buffer zeroing as you go.
void writeBuffer (Buffer &inputBuffer, unsigned bufNum) throw (CException)
 write to the receiver
void sumIntoBuffer (Buffer &inputBuffer, unsigned bufNum) throw (CException)

Public Attributes

unsigned mCurrentWriteFrame
 state -- users can manipulate my internal tap and buffer
Buffer mBuffer
RingBufferTap mTap
 internal tap so a RingBuffer can also be a a UnitGenerator

Protected Attributes

unsigned mTempCurrentWriteFrame
 Used in next buffer to save state between calls in the same block.

Friends

class RingBufferTap
 Allow the RingBufferTap to access private members of this class.


Detailed Description

RingBuffer is the storage + a default reader

Constructor & Destructor Documentation

RingBuffer::RingBuffer (  ) 

Constructors.

References mTap, and csl::RingBufferTap::setBuffer().

RingBuffer::RingBuffer ( unsigned int  nmChannels,
unsigned int  nmFrames 
)

RingBuffer::RingBuffer ( UnitGenerator input,
unsigned int  nmChannels,
unsigned int  nmFrames 
)


Member Function Documentation

unsigned RingBuffer::seekTo ( int  position  )  throw (CException)

void csl::RingBuffer::setLoopStart ( unsigned  frame  )  [inline]

These loop setters allow for variable buffer lengths by varying the points where the buffer writes.

References mTap, and csl::RingBufferTap::setLoopStart().

void csl::RingBuffer::setLoopEnd ( unsigned  frame  )  [inline]

Calls the setLoopStart of it's tap.

References mTap, and csl::RingBufferTap::setLoopEnd().

void RingBuffer::nextBuffer ( Buffer outputBuffer  )  throw (CException) [virtual]

Calls the setLoopEnd of it's tap.

Various flavours of next buffer. Also the nextBuffer(Buffer &) has to be implemented to be able to hold state of the currentWriteFrame. Otherwise every time it's called by the super nextBuffer the currentWriteFrame would be incremented more and more, leading to erroneous results. Read a buffer from the ring buffer

Reimplemented from csl::UnitGenerator.

References CSL_INPUT, and csl::Effect::pullInput().

void RingBuffer::writeBuffer ( Buffer inputBuffer  )  throw (CException) [virtual]

Write a buffer of data into the ring buffer.

Reimplemented from csl::Writeable.

References csl::Writeable::writeBuffer().

Referenced by csl::CslRtpSession::OnRTPPacket(), and csl::ThreadedReader::readIntoBuffer().

void RingBuffer::sumIntoBuffer ( Buffer inputBuffer  )  throw (CException)

Do an adding write of data into the ring buffer.

void RingBuffer::destructiveNextBuffer ( Buffer outputBuffer  )  throw (CException)

Read a buffer zeroing as you go.

Referenced by csl::ThreadedWriter::writeToOutput().

void RingBuffer::writeBuffer ( Buffer inputBuffer,
unsigned  bufNum 
) throw (CException) [virtual]

write to the receiver

Reimplemented from csl::Writeable.

void RingBuffer::sumIntoBuffer ( Buffer inputBuffer,
unsigned  bufNum 
) throw (CException)


Friends And Related Function Documentation

friend class RingBufferTap [friend]

Allow the RingBufferTap to access private members of this class.


Member Data Documentation

state -- users can manipulate my internal tap and buffer

Referenced by csl::DelayLine::delayLength(), and csl::RingBufferTap::setOffset().

Used in next buffer to save state between calls in the same block.


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