#include <iso_synth_buffer.h>
Inherited by iso::synth::Channel, iso::synth::Frame, iso::synth::RingBuffer, and iso::synth::Sample.
Inheritance diagram for iso::synth::Buffer:
Public Member Functions | |
Buffer () | |
default contructor | |
Buffer (sample pValue) | |
paramater based contructor | |
Buffer (unsigned int pFrameCount, unsigned int pChannelCount) | |
paramater based contructor | |
Buffer (unsigned int pFrameCount, unsigned int pChannelCount, sample pValue) | |
paramater based contructor | |
Buffer (unsigned int pFrameCount, unsigned int pChannelCount, const sample *pValues) | |
paramater based contructor | |
Buffer (unsigned int pFrameCount, unsigned int pChannelCount, double p1, double p2,...) | |
paramater based contructor | |
Buffer (const Buffer &pBuffer) | |
copy constructor | |
Buffer (const serialize::SerializeData &pSerializeData) throw (serialize::SerializeException) | |
serialization based constructor | |
virtual | ~Buffer () |
destructor | |
virtual serialize::SerializeData | serialize (const String &pSerialName=sClassName) const |
create serializeData for buffer | |
sample * | data () |
return buffer values | |
const sample * | data () const |
return buffer values | |
virtual const Buffer & | operator= (const Buffer &pBuffer) throw (SynthException) |
assignment operator | |
virtual sample | operator= (sample pValue) |
set content of buffer to one value | |
virtual bool | operator== (const Buffer &pBuffer) const |
comparison operator | |
unsigned int | frameCount () const |
return number of frames | |
unsigned int | channelCount () const |
returns number of channels | |
virtual sample | operator() (unsigned int pFrameIndex, unsigned int pChannelIndex) const throw (SynthException) |
returns sample at frame and channel | |
void | clip () |
clips buffer samples to the range of -1.0 to 1.0 | |
sample | operator() (sample pFrameIndex, unsigned int pChannelIndex) const throw (SynthException) |
returns interpolated sample value | |
virtual void | setSize (unsigned int pFrameCount, unsigned int pChannelCount) throw (SynthException) |
change buffer size | |
virtual void | setFrameCount (unsigned int pFrameCount) throw (SynthException) |
change number of frames | |
virtual void | setChannelCount (unsigned int pChannelCount) throw (SynthException) |
change number of channels | |
virtual void | appendFrames (const Buffer &pBuffer) throw (SynthException) |
append frames from pBuffer to buffer | |
virtual void | appendChannels (const Buffer &pBuffer) throw (SynthException) |
append channels from pBuffer to buffer | |
virtual const Buffer & | operator+= (sample pSample) |
+= operator | |
virtual const Buffer & | operator *= (sample pSample) |
*= operator | |
virtual const Buffer & | operator+= (const Buffer &pBuffer) throw (SynthException) |
+= operator | |
virtual const Buffer & | operator *= (const Buffer &pBuffer) throw (SynthException) |
*= operator | |
virtual String | info () const |
obtain textual buffer information | |
Static Public Member Functions | |
static serialize::Serializable * | deSerialize (const serialize::SerializeData &pSerializeData) throw (serialize::SerializeException) |
create buffer from SerializeData | |
static void | deinterleave (Buffer &pSourceBuffer, Buffer &pTargetBuffer) throw (SynthException) |
transforms an interleaves source buffer into a non-interleaved target buffer | |
static void | interleave (Buffer &pSourceBuffer, Buffer &pTargetBuffer) throw (SynthException) |
transforms a non-interleaved source buffer into an interleaved target buffer | |
Static Public Attributes | |
static const String | sClassName |
default name | |
Protected Member Functions | |
virtual void | setDim (unsigned int p_dim) |
set dimension of vector | |
Protected Attributes | |
unsigned int | mFrameCount |
frame count | |
unsigned int | mChannelCount |
channel count | |
Static Protected Attributes | |
static unsigned int | sFrameCount |
default frame count | |
static unsigned int | sChannelCount |
default channel count | |
Friends | |
std::ostream & | operator<< (std::ostream &pOstream, const Buffer &pBuffer) |
print buffer information |
audio data
The buffer class stores an arbitrary number of channels and frames of audio or control data in non-interleaved format.
i.e. when iterating over a buffers content, the channel index is the slow changing variable and the frame index is the fast changing variable
The buffer's internal datatype are samples.
Created by Daniel Bisig on 02/19/06.
Buffer::Buffer | ( | ) |
default contructor
Buffer::Buffer | ( | sample | pValue | ) |
paramater based contructor
pValue | value to fill buffer width |
Buffer::Buffer | ( | unsigned int | pFrameCount, | |
unsigned int | pChannelCount | |||
) |
paramater based contructor
pFrameCount | frame count | |
pChannelCount | channel count |
Buffer::Buffer | ( | unsigned int | pFrameCount, | |
unsigned int | pChannelCount, | |||
sample | pValue | |||
) |
paramater based contructor
pFrameCount | frame count | |
pChannelCount | channel count | |
pValue | value to fill buffer width |
Buffer::Buffer | ( | unsigned int | pFrameCount, | |
unsigned int | pChannelCount, | |||
const sample * | pValues | |||
) |
paramater based contructor
pFrameCount | frame count | |
pChannelCount | channel count | |
pValues | values to fill buffer with |
Buffer::Buffer | ( | unsigned int | pFrameCount, | |
unsigned int | pChannelCount, | |||
double | p1, | |||
double | p2, | |||
... | ||||
) |
paramater based contructor
pFrameCount | frame count | |
pChannelCount | channel count | |
p1 | start of a list of values to fill buffer with (make sure the number of values equals the number of channels) | |
p2 | next element in list of values to fill buffer with (make sure the number of values equals the number of channels) |
Buffer::Buffer | ( | const Buffer & | pBuffer | ) |
copy constructor
pBuffer | buffer to copy properties from |
Buffer::Buffer | ( | const serialize::SerializeData & | pSerializeData | ) | throw (serialize::SerializeException) |
serialization based constructor
pSerializeData | serialization data |
SerializeException | failed to create buffer |
Buffer::~Buffer | ( | ) | [virtual] |
destructor
serialize::SerializeData Buffer::serialize | ( | const String & | pSerialName = sClassName |
) | const [virtual] |
create serializeData for buffer
Reimplemented in iso::synth::Channel, iso::synth::Frame, iso::synth::RingBuffer, and iso::synth::Sample.
serialize::Serializable * Buffer::deSerialize | ( | const serialize::SerializeData & | pSerializeData | ) | throw (serialize::SerializeException) [static] |
create buffer from SerializeData
pSerializeData | SerializeData |
SerializeException | incompatible SerializeData |
Reimplemented in iso::synth::Channel, iso::synth::Frame, iso::synth::RingBuffer, and iso::synth::Sample.
sample * Buffer::data | ( | ) |
return buffer values
const sample * Buffer::data | ( | ) | const |
return buffer values
const Buffer & Buffer::operator= | ( | const Buffer & | pBuffer | ) | throw (SynthException) [virtual] |
assignment operator
pBuffer | buffer to copy properties from |
SynthException | frameCount or channelCount doesn't match |
Reimplemented in iso::synth::Channel, iso::synth::Frame, and iso::synth::Sample.
set content of buffer to one value
pValue | value to fill the buffer with |
Reimplemented in iso::synth::Frame.
bool Buffer::operator== | ( | const Buffer & | pBuffer | ) | const [virtual] |
comparison operator
pBuffer | buffer to which the comparison is made to |
Reimplemented in iso::synth::Channel, and iso::synth::Frame.
unsigned int Buffer::frameCount | ( | ) | const |
return number of frames
unsigned int Buffer::channelCount | ( | ) | const |
returns number of channels
sample Buffer::operator() | ( | unsigned int | pFrameIndex, | |
unsigned int | pChannelIndex | |||
) | const throw (SynthException) [virtual] |
returns sample at frame and channel
pFrameIndex | frame index | |
pChannelIndex | channel index |
void Buffer::clip | ( | ) |
clips buffer samples to the range of -1.0 to 1.0
sample Buffer::operator() | ( | sample | pFrameIndex, | |
unsigned int | pChannelIndex | |||
) | const throw (SynthException) |
returns interpolated sample value
pFrameIndex | selected frame | |
pChannelIndex | selected channel |
void Buffer::deinterleave | ( | Buffer & | pSourceBuffer, | |
Buffer & | pTargetBuffer | |||
) | throw (SynthException) [static] |
transforms an interleaves source buffer into a non-interleaved target buffer
pSourceBuffer | interleaved source buffer | |
pTargetBuffer | non-interleaved target buffer |
SynthException | buffers don't possess same number of frames and channels |
void Buffer::interleave | ( | Buffer & | pSourceBuffer, | |
Buffer & | pTargetBuffer | |||
) | throw (SynthException) [static] |
transforms a non-interleaved source buffer into an interleaved target buffer
pSourceBuffer | non-interleaved source buffer | |
pTargetBuffer | interleaved target buffer |
SynthException | buffers don't possess same number of frames and channels |
void Buffer::setSize | ( | unsigned int | pFrameCount, | |
unsigned int | pChannelCount | |||
) | throw (SynthException) [virtual] |
change buffer size
pFrameCount | new frame count | |
pChannelCount | new channel count |
SynthException | never throws an exception |
Reimplemented in iso::synth::Channel, iso::synth::Frame, and iso::synth::Sample.
void Buffer::setFrameCount | ( | unsigned int | pFrameCount | ) | throw (SynthException) [virtual] |
change number of frames
pFrameCount | new frameCount |
SynthException | never throws an exception |
Reimplemented in iso::synth::Frame, and iso::synth::Sample.
void Buffer::setChannelCount | ( | unsigned int | pChannelCount | ) | throw (SynthException) [virtual] |
change number of channels
pChannelCount | new channelCount |
SynthException | never throws an exception |
Reimplemented in iso::synth::Channel, and iso::synth::Sample.
void Buffer::appendFrames | ( | const Buffer & | pBuffer | ) | throw (SynthException) [virtual] |
append frames from pBuffer to buffer
pBuffer |
SynthException | channelCount doesn't match |
Reimplemented in iso::synth::Frame, and iso::synth::Sample.
void Buffer::appendChannels | ( | const Buffer & | pBuffer | ) | throw (SynthException) [virtual] |
append channels from pBuffer to buffer
pBuffer |
SynthException | frameCount doesn't match |
Reimplemented in iso::synth::Channel, and iso::synth::Sample.
+= operator
pSample | sample value to be added |
Reimplemented in iso::synth::Frame.
*= operator
pSample | sample value to be multiplied |
Reimplemented in iso::synth::Frame.
const Buffer & Buffer::operator+= | ( | const Buffer & | pBuffer | ) | throw (SynthException) [virtual] |
+= operator
pBuffer | buffer to be added |
SynthException | buffers don't possess same number of frames and channels |
Reimplemented in iso::synth::Channel, iso::synth::Frame, and iso::synth::Sample.
const Buffer & Buffer::operator *= | ( | const Buffer & | pBuffer | ) | throw (SynthException) [virtual] |
*= operator
pBuffer | buffer to be multiplied |
SynthException | buffers don't possess same number of frames and channels |
Reimplemented in iso::synth::Channel, iso::synth::Frame, and iso::synth::Sample.
String Buffer::info | ( | ) | const [virtual] |
obtain textual buffer information
Reimplemented in iso::synth::Channel, iso::synth::Frame, iso::synth::RingBuffer, and iso::synth::Sample.
void Buffer::setDim | ( | unsigned int | p_dim | ) | [protected, virtual] |
set dimension of vector
p_dim | new vector dimension |
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const Buffer & | pBuffer | |||
) | [friend] |
print buffer information
const String Buffer::sClassName [static] |
default name
Reimplemented in iso::synth::Channel, iso::synth::Frame, iso::synth::RingBuffer, and iso::synth::Sample.
unsigned int Buffer::sFrameCount [static, protected] |
default frame count
unsigned int Buffer::sChannelCount [static, protected] |
default channel count
unsigned int iso::synth::Buffer::mFrameCount [protected] |
frame count
unsigned int iso::synth::Buffer::mChannelCount [protected] |
channel count