#include <CSL_Core.h>

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 |
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.
| Buffer::Buffer | ( | unsigned | numChannels = 1, |
|
| unsigned | numFrames = CGestalt::blockSize() | |||
| ) |
| Buffer::~Buffer | ( | ) |
| void Buffer::setSize | ( | unsigned | numChannels, | |
| unsigned | numFrames | |||
| ) |
References freeBuffers(), mAreBuffersAllocated, mBuffers, mDidIAllocateBuffers, mIsPopulated, mMonoBufferByteSize, mNumChannels, and mNumFrames.
Referenced by csl::UnitGenerator::addOutput(), csl::Mixer::allocateOpBuffer(), csl::BlockResizer::BlockResizer(), Buffer(), csl::Port::checkBuffer(), csl::Abst_SoundFile::checkBuffer(), csl::DelayLine::DelayLine(), csl::WavetableOscillator::fillSine(), csl::ThreadedWriter::init(), csl::ThreadedReader::init(), csl::KarplusString::initDelayLine(), csl::FDN::initDelayLines(), csl::PAIO::initialize(), csl::LPCFilter::LPCFilter(), csl::Joiner::nextBuffer(), csl::FileIO::open(), csl::ThreadUtil::setSize(), csl::Window::setSize(), csl::SpatialPanner::SpatialPanner(), and csl::WavetableOscillator::WavetableOscillator().
| 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) |
fcn to malloc storage buffers
References mAreBuffersAllocated, mBuffers, mDidIAllocateBuffers, mNumChannels, mNumFrames, and SAFE_MALLOC.
Referenced by csl::UnitGenerator::addOutput(), csl::Mixer::allocateOpBuffer(), csl::BinauralPanner::BinauralPanner(), csl::BlockResizer::BlockResizer(), csl::Port::checkBuffer(), csl::Abst_SoundFile::checkBuffer(), csl::CompOrCacheOscillator::createCache(), csl::DelayLine::DelayLine(), csl::WavetableOscillator::fillSine(), csl::Filter::init(), csl::RemoteIO::init_io(), csl::KarplusString::initDelayLine(), csl::FDN::initDelayLines(), csl::AmbisonicMixer::initialize(), csl::Convolver::initialize(), csl::WaveShaper::initWaveTable(), csl::LPCAnalyzer::LPCAnalyzer(), csl::LPCFilter::LPCFilter(), csl::Abst_SoundFile::mergeToMono(), csl::PAIO::open(), csl::FileIO::open(), csl::Port::Port(), csl::RingBuffer::RingBuffer(), csl::Window::setSize(), csl::SpatialPanner::SpatialPanner(), csl::ThreadUtil::start(), and csl::PAIO::test().
| void Buffer::freeBuffers | ( | ) |
fcn to free them
References csl::logMsg(), mAreBuffersAllocated, mBuffers, mDidIAllocateBuffers, mNumChannels, and mNumFrames.
Referenced by csl::Port::checkBuffer(), csl::Abst_SoundFile::checkBuffer(), csl::PAIO::close(), csl::FileIO::close(), csl::Abst_SoundFile::freeBuffer(), csl::PAIO::open(), csl::FileIO::open(), csl::Window::setSize(), setSize(), csl::WavetableOscillator::setWaveform(), csl::BlockResizer::~BlockResizer(), ~Buffer(), csl::Mixer::~Mixer(), csl::SpatialPanner::~SpatialPanner(), csl::ThreadedReader::~ThreadedReader(), csl::ThreadedWriter::~ThreadedWriter(), and csl::Window::~Window().
| void Buffer::zeroBuffers | ( | ) |
fill all data with 0
References mAreBuffersAllocated, mAreBuffersZero, mBuffers, mMonoBufferByteSize, and mNumChannels.
Referenced by csl::Filter::clear(), csl::FDN::initDelayLines(), and csl::FileIO::writeNextBuffer().
| void Buffer::fillWith | ( | sample | value | ) |
| void Buffer::copyFrom | ( | Buffer & | src | ) | throw (RunTimeError) |
| void Buffer::copySamplesFrom | ( | Buffer & | src | ) | throw (RunTimeError) |
import data from the given buffer
| SampleBuffer csl::Buffer::monoBuffer | ( | unsigned | bufNum | ) | [inline] |
convenience accessor for sample buffers
Reimplemented in csl::BufferCMap.
References mBuffers.
Referenced by csl::CompOrCacheOscillator::createCache(), csl::WavetableOscillator::fillSine(), csl::Convolver::initialize(), csl::WaveShaper::initWaveTable(), csl::Splitter::nextBuffer(), csl::Port::Port(), csl::LSoundFile::readBufferFromFile(), csl::JSoundFile::readBufferFromFile(), csl::CASoundFile::readBufferFromFile(), csl::Port::resetPtr(), and csl::UnitGenerator::zeroBuffer().
the storage vector -- pointers to (SampleBuffer) buffers
Referenced by allocateBuffers(), csl::JUCEIO::audioDeviceIOCallback(), csl::WavetableOscillator::fillSine(), csl::WelchWindow::fillWindow(), csl::BlackmanHarrisWindow::fillWindow(), csl::BlackmanWindow::fillWindow(), csl::HannWindow::fillWindow(), csl::HammingWindow::fillWindow(), csl::RectangularWindow::fillWindow(), csl::Window::fillWindow(), fillWith(), freeBuffers(), csl::HRTF::HRTF(), csl::LPCAnalyzer::LPCAnalyzer(), csl::Abst_SoundFile::mergeToMono(), csl::WaveShaper::mono_next_buffer(), csl::BufferCMap::monoBuffer(), monoBuffer(), csl::AmbisonicRotator::nextBuffer(), csl::AmbisonicDecoder::nextBuffer(), csl::AmbisonicEncoder::nextBuffer(), csl::LPCAnalyzer::nextBuffer(), csl::InOut::nextBuffer(), csl::Joiner::nextBuffer(), csl::Port::nextFrame(), csl::AirAbsorptionCue::process(), csl::IntensityAttenuationCue::process(), csl::Effect::pullInput(), csl::JSoundFile::readBufferFromFile(), csl::CASoundFile::readBufferFromFile(), RenderCallback(), setSize(), csl::WavetableOscillator::setWaveform(), csl::Window::window(), and zeroBuffers().
| unsigned csl::Buffer::mNumChannels |
num channels in buffer (num mono buffers)
Referenced by allocateBuffers(), csl::Port::checkBuffer(), fillWith(), freeBuffers(), csl::IO::getInput(), csl::AUIO::getInput(), JackCallback(), csl::Port::nextFrame(), setSize(), setSizeOnly(), csl::WavetableOscillator::setWaveform(), and zeroBuffers().
| unsigned csl::Buffer::mNumFrames |
num frames in each buffer
Referenced by allocateBuffers(), csl::JUCEIO::audioDeviceIOCallback(), csl::Port::checkBuffer(), csl::Abst_SoundFile::checkBuffer(), csl::CompOrCacheOscillator::createCache(), csl::BufferStream::duration(), csl::RingBufferTap::duration(), csl::ThreadedWriter::FeederFunction(), csl::ThreadedReader::FeederFunction(), fillWith(), freeBuffers(), csl::IO::getInput(), csl::AUIO::getInput(), csl::Abst_SoundFile::isCached(), JackCallback(), csl::Abst_SoundFile::mergeToMono(), csl::WaveShaper::mono_next_buffer(), csl::AmbisonicRotator::nextBuffer(), csl::AmbisonicDecoder::nextBuffer(), csl::AmbisonicEncoder::nextBuffer(), pa_callback(), csl::AirAbsorptionCue::process(), csl::IntensityAttenuationCue::process(), csl::Controllable::pullInput(), csl::ThreadedReader::readIntoBuffer(), csl::RingBufferTap::setOffset(), setSize(), setSizeOnly(), csl::WavetableOscillator::setWaveform(), csl::WavetableOscillator::WavetableOscillator(), csl::ThreadedWriter::writeBuffer(), csl::FileIO::writeNextBuffer(), and csl::ThreadedWriter::writeToOutput().
| unsigned csl::Buffer::mMonoBufferByteSize |
size of each buffer in bytes
Referenced by setSize(), setSizeOnly(), csl::WavetableOscillator::setWaveform(), csl::UnitGenerator::zeroBuffer(), and zeroBuffers().
| unsigned csl::Buffer::mSequence |
sequential serial number
the buffer's most recent timestamp
are the buffers allocated?
Referenced by allocateBuffers(), csl::Abst_SoundFile::checkBuffer(), csl::PAIO::close(), csl::FileIO::close(), csl::WavetableOscillator::fillSine(), csl::Abst_SoundFile::freeBuffer(), freeBuffers(), csl::Abst_SoundFile::mergeToMono(), csl::PAIO::open(), csl::FileIO::open(), RenderCallback(), setSize(), csl::WavetableOscillator::setWaveform(), csl::ThreadUtil::start(), zeroBuffers(), csl::ThreadedReader::~ThreadedReader(), and csl::ThreadedWriter::~ThreadedWriter().
who allocated my data buffers?
Referenced by allocateBuffers(), csl::WavetableOscillator::fillSine(), freeBuffers(), csl::Abst_SoundFile::mergeToMono(), csl::LSoundFile::openForRead(), RenderCallback(), setSize(), csl::WavetableOscillator::setWaveform(), and ~Buffer().
does the buffer have data?
Referenced by csl::AmbisonicRotator::nextBuffer(), csl::AmbisonicDecoder::nextBuffer(), csl::AmbisonicEncoder::nextBuffer(), csl::Controllable::pullInput(), RenderCallback(), setSize(), and csl::WavetableOscillator::setWaveform().
have the buffers been zeroed out?
Referenced by fillWith(), csl::WavetableOscillator::setWaveform(), and zeroBuffers().
Data type flag set the internal size variables (no buffer allocation takes place)
Referenced by csl::BinauralPanner::BinauralPanner(), csl::LPCAnalyzer::LPCAnalyzer(), csl::AmbisonicRotator::nextBuffer(), csl::AmbisonicDecoder::nextBuffer(), csl::AmbisonicEncoder::nextBuffer(), and csl::Controllable::pullInput().
1.5.8