iso::synth::Channel Class Reference

storage for audio data that contains one channel of samples More...

#include <iso_synth_channel.h>

Inherits iso::synth::Buffer.

Inheritance diagram for iso::synth::Channel:

Inheritance graph
[legend]
Collaboration diagram for iso::synth::Channel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Channel ()
 default contructor
 Channel (sample pValue)
 paramater based contructor
 Channel (unsigned int pFrameCount)
 paramater based contructor
 Channel (int pFrameCount)
 paramater based contructor
 Channel (unsigned int pFrameCount, sample pValue)
 paramater based contructor
 Channel (unsigned int pFrameCount, const sample *pValues)
 paramater based contructor
 Channel (unsigned int pFrameCount, double pValue1, double pValue2,...)
 paramater based contructor
 Channel (const Channel &pChannel)
 copy constructor
 Channel (const math::Vector< sample > &pVector)
 copy constructor
 Channel (const Buffer &pBuffer, unsigned int pChannelIndex) throw (SynthException)
 copy constructor
 Channel (const serialize::SerializeData &pSerializeData) throw (serialize::SerializeException)
 serialization based constructor
 ~Channel ()
 destructor
virtual serialize::SerializeData serialize (const String &pSerialName=sClassName) const
 create serializeData for channel
void copyTo (Buffer &pBuffer, unsigned int pChannelIndex) throw (SynthException)
 copy channel into buffer
void copyFrom (Buffer &pBuffer, unsigned int pChannelIndex) throw (SynthException)
 copy buffer into channel
const Channeloperator= (const Channel &pChannel) throw (SynthException)
 assignment operator
const Bufferoperator= (const Buffer &pBuffer) throw (SynthException)
 assignment operator
bool operator== (const Channel &pChannel) const
 comparison operator
bool operator== (const Buffer &pBuffer) const
 comparison operator
sampleoperator[] (unsigned int pFrameIndex) throw (SynthException)
 returns sample
const sampleoperator[] (unsigned int pFrameIndex) const throw (SynthException)
 returns sample
sample operator() (unsigned int pFrameIndex) const throw (SynthException)
 returns truncated sample
sample operator() (sample pFrameIndex) const throw (SynthException)
 returns interpolated sample
const Channeloperator+= (const Channel &pChannel) throw (SynthException)
 += operator
const Channeloperator+= (const Buffer &pBuffer) throw (SynthException)
 += operator
const Channeloperator *= (const Channel &pChannel) throw (SynthException)
 *= operator
const Channeloperator *= (const Buffer &pBuffer) throw (SynthException)
 *= operator
virtual void setSize (unsigned int pFrameCount, unsigned int pChannelCount) throw (SynthException)
 change buffer size
virtual void setChannelCount (unsigned int pChannelCount) throw (SynthException)
 change number of channels
void appendChannels (const Buffer &pBuffer) throw (SynthException)
 append channels from pBuffer to channel
String info () const
 obtain textual channel information

Static Public Member Functions

static serialize::Serializable * deSerialize (const serialize::SerializeData &pSerializeData) throw (serialize::SerializeException)
 create channel from SerializeData

Static Public Attributes

static const String sClassName
 default name

Friends

std::ostream & operator<< (std::ostream &pOstream, const Channel &pChannel)
 print channel information

Detailed Description

storage for audio data that contains one channel of samples

audio data that contains one channel of samples

Created by Daniel Bisig on 06/18/06.


Constructor & Destructor Documentation

Channel::Channel (  ) 

default contructor

Channel::Channel ( sample  pValue  ) 

paramater based contructor

Parameters:
pValue value to fill channel with

Channel::Channel ( unsigned int  pFrameCount  ) 

paramater based contructor

Parameters:
pFrameCount frame count

Channel::Channel ( int  pFrameCount  ) 

paramater based contructor

Parameters:
pFrameCount frame count
to avoid implicit casting conflicts with Channel( sample pValue );

Channel::Channel ( unsigned int  pFrameCount,
sample  pValue 
)

paramater based contructor

Parameters:
pFrameCount frame count
pValue value to fill channel with

Channel::Channel ( unsigned int  pFrameCount,
const sample pValues 
)

paramater based contructor

Parameters:
pChannelCount channel count
pValues values to fill frame with

Channel::Channel ( unsigned int  pFrameCount,
double  pValue1,
double  pValue2,
  ... 
)

paramater based contructor

Parameters:
pFrameCount frame count
pValue1 first value of a series of values to fill channel with
pValue2 second value of a series of values to fill channel with

Channel::Channel ( const Channel pChannel  ) 

copy constructor

Parameters:
pChannel channel to copy properties from

Channel::Channel ( const math::Vector< sample > &  pVector  ) 

copy constructor

Parameters:
pVector vector to copy properties from

Channel::Channel ( const Buffer pBuffer,
unsigned int  pChannelIndex 
) throw (SynthException)

copy constructor

Parameters:
pBuffer buffer to copy properties from
pChannelIndex channel index of buffer
Exceptions:
SynthException channel index out of range

Channel::Channel ( const serialize::SerializeData &  pSerializeData  )  throw (serialize::SerializeException)

serialization based constructor

Parameters:
pSerializeData serialization data
Exceptions:
SerializeException failed to create channel

Channel::~Channel (  ) 

destructor


Member Function Documentation

serialize::SerializeData Channel::serialize ( const String pSerialName = sClassName  )  const [virtual]

create serializeData for channel

Returns:
serializeData

Reimplemented from iso::synth::Buffer.

serialize::Serializable * Channel::deSerialize ( const serialize::SerializeData &  pSerializeData  )  throw (serialize::SerializeException) [static]

create channel from SerializeData

Parameters:
pSerializeData SerializeData
Returns:
Serializable
Exceptions:
SerializeException incompatible SerializeData

Reimplemented from iso::synth::Buffer.

void Channel::copyTo ( Buffer pBuffer,
unsigned int  pChannelIndex 
) throw (SynthException)

copy channel into buffer

Parameters:
pBuffer target buffer
pChannelIndex target channel
Exceptions:
SynthException channel out of bounds or frameCount doesn't match

void Channel::copyFrom ( Buffer pBuffer,
unsigned int  pChannelIndex 
) throw (SynthException)

copy buffer into channel

Parameters:
pBuffer source buffer
pChannelIndex source channel
Exceptions:
SynthException channel out of bounds or frameCount doesn't match

const Channel & Channel::operator= ( const Channel pChannel  )  throw (SynthException)

assignment operator

Parameters:
pChannel channel to copy properties from
Returns:
channel
Exceptions:
SynthException framecount doesn't match

const Buffer & Channel::operator= ( const Buffer pBuffer  )  throw (SynthException) [virtual]

assignment operator

Parameters:
pBuffer buffer to copy properties from
Returns:
buffer
Exceptions:
SynthException framecount doesn't match

Reimplemented from iso::synth::Buffer.

bool Channel::operator== ( const Channel pChannel  )  const

comparison operator

Parameters:
pChannel channel to which the comparison is made to
Returns:
true, if FrameCount of both buffers are identical, otherwise false

bool Channel::operator== ( const Buffer pBuffer  )  const [virtual]

comparison operator

Parameters:
pBuffer buffer to which the comparison is made to
Returns:
true, if FrameCount of both buffers are identical, otherwise false

Reimplemented from iso::synth::Buffer.

sample & Channel::operator[] ( unsigned int  pFrameIndex  )  throw (SynthException)

returns sample

Parameters:
pFrameIndex frame index
Returns:
sample
Exceptions:
SynthException frameIndex out of range

const sample & Channel::operator[] ( unsigned int  pFrameIndex  )  const throw (SynthException)

returns sample

Parameters:
pFrameIndex frame index
Returns:
sample
Exceptions:
SynthException frameIndex out of range

sample Channel::operator() ( unsigned int  pFrameIndex  )  const throw (SynthException)

returns truncated sample

Parameters:
pFrameIndex frame index
Returns:
sample
Exceptions:
SynthException frameIndex out of range

sample Channel::operator() ( sample  pFrameIndex  )  const throw (SynthException)

returns interpolated sample

Parameters:
pFrameIndex frame index
Returns:
sample
Exceptions:
SynthException frameIndex out of range

const Channel & Channel::operator+= ( const Channel pChannel  )  throw (SynthException)

+= operator

Parameters:
pChannel channel to be added
Returns:
resulting channel
Exceptions:
SynthException channels don't possess same number of frames

const Channel & Channel::operator+= ( const Buffer pBuffer  )  throw (SynthException) [virtual]

+= operator

Parameters:
pBuffer buffer to be added (first channel)
Returns:
resulting channel
Exceptions:
SynthException buffers don't contain same number of frames

Reimplemented from iso::synth::Buffer.

const Channel & Channel::operator *= ( const Channel pChannel  )  throw (SynthException)

*= operator

Parameters:
pChannel channel to be multiplied
Returns:
resulting channel
Exceptions:
SynthException channels don't possess same number of frames

const Channel & Channel::operator *= ( const Buffer pBuffer  )  throw (SynthException) [virtual]

*= operator

Parameters:
pBuffer buffer to be multiplied (first channel)
Returns:
resulting channel
Exceptions:
SynthException buffers don't contain same number of frames

Reimplemented from iso::synth::Buffer.

void Channel::setSize ( unsigned int  pFrameCount,
unsigned int  pChannelCount 
) throw (SynthException) [virtual]

change buffer size

Parameters:
pFrameCount new frame count
pChannelCount new channel count
Exceptions:
SynthException channel count != 1

Reimplemented from iso::synth::Buffer.

void Channel::setChannelCount ( unsigned int  pChannelCount  )  throw (SynthException) [virtual]

change number of channels

Parameters:
pChannelCount new channelCount
Exceptions:
SynthException whenever pChannelCount != 1

Reimplemented from iso::synth::Buffer.

void Channel::appendChannels ( const Buffer pBuffer  )  throw (SynthException) [virtual]

append channels from pBuffer to channel

Parameters:
pBuffer 
Exceptions:
SynthException always! illegal operation for channel

Reimplemented from iso::synth::Buffer.

String Channel::info (  )  const [virtual]

obtain textual channel information

Returns:
String containing channel information

Reimplemented from iso::synth::Buffer.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOstream,
const Channel pChannel 
) [friend]

print channel information


Member Data Documentation

const String Channel::sClassName [static]

default name

Reimplemented from iso::synth::Buffer.


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:18:41 2011 for synth by  doxygen 1.5.1