iso::synth::ControlPort Class Reference

port for providing additional buffer datas More...

#include <iso_synth_control_port.h>

Inherits iso::synth::InputPort.

Inheritance diagram for iso::synth::ControlPort:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ControlPort (Unit *pUnit)
 parameter based contructor
 ControlPort (const String &pName, Unit *pUnit)
 name and parameter based contructor
 ControlPort (Unit *pUnit, unsigned int pChannelCount)
 parameter based contructor
 ControlPort (const String &pName, Unit *pUnit, unsigned int pChannelCount)
 name and parameter based contructor
 ~ControlPort ()
 destructor
const Stringname () const
 returns port name
Unitunit ()
 returns associated unit
unsigned int channelCount () const
 return channel count
unsigned int frameCount () const
 return frame count
virtual unsigned int count () const
 return exptected number of values
virtual const math::Vector<
sample > & 
values () const
 return values
long fadeDuration () const
 return fade duration (in microsecs)
sample rate () const
 return frame rate
Bufferbuffer () const
 return buffer
Frameframe () const
 return frame
void setResizeAllowed (bool pResizeAllowed)
 set resize allowed flag
virtual void setChannelCount (unsigned int pChannelCount) throw (SynthException)
 set channel count
virtual void setFrameCount (unsigned int pFrameCount) throw (SynthException)
 set frame count
virtual void setFadeDuration (sample pFadeDuration)
 set fade duration
virtual void set (sample pValue)
 set values
virtual void set (math::Vector< sample > pValues) throw (event::EventException)
 set values
virtual void schedule (double pTime, sample pValue, double pDuration=-1, event::EventTime pTimeMode=event::EVENT_RELATIVE) throw (event::EventException)
 set value via event
virtual void schedule (double pTime, const math::Vector< sample > pValues, double pDuration=-1, event::EventTime pTimeMode=event::EVENT_RELATIVE) throw (event::EventException)
 set values via event
virtual void process (Buffer *pBuffer)
 signal processing function
virtual Bufferprocess ()
 control signal processing function
virtual String info () const
 obtain textual inport port information
virtual String info (bool pPropagate) const
 obtain textual inport port information

Static Public Attributes

static const String sClassName
 default name

Protected Member Functions

 ControlPort ()
 default constructor
void changeBufferSize ()
 change internal buffer size

Protected Attributes

ControlFadeStrategymFadeStrategy
 fade strategy
bool mFading
 indicates whether this control port is fading or not
bool mResizeAllowed
 indicates whether values can be resized or not
BuffermBuffer
 internal buffer
FramemFrame
 internal frame
long mFadeDuration
 fade duration (in microsecs)

Friends

class Unit
class ControlFadeStrategy
std::ostream & operator<< (std::ostream &pOstream, const ControlPort &pPort)
 print port information

Detailed Description

port for providing additional buffer datas

providing additional buffer data

Control ports provide more buffer data in addition to the buffer data from the input port.
This buffer data has the same frame- and channelcount as the input port data.
It can therefore be used to generate control signals at audio rate.
Depending on whether control signals are required at audio rate or at lower rate, the associated unit
may either obtain the controlport's internal buffer or it's internal frame.
The internal frame represents simply the first frame of the internal buffer.
Accordingly, the internal frame is updated once every process function call.
Control ports can be set manually or via events or they receive their buffer data by connecting
to other input units.
Only the connected control port version provides true audio rate control.
Manual and event based control port control operate via frames and result
in the generation of control port buffers that contain all the same values.
There is an exception though: when the control ports possess a fading strategy.
This fading strategy creates intermediate values at audio rate.
Every unit can have an arbitrary number of control ports
Each control port is connected to zero or one link
Non-connected ports simply provide fixed values.
Otherwise, control ports behave like input port and can therefore be connected to output ports. Processing method invocations travel from unit to control port to link.
Signals travel from link to control port to unit.

Created by Daniel Bisig on 6/25/06.


Constructor & Destructor Documentation

ControlPort::ControlPort ( Unit pUnit  ) 

parameter based contructor

Parameters:
pUnit the unit this input port belongs to

ControlPort::ControlPort ( const String pName,
Unit pUnit 
)

name and parameter based contructor

Parameters:
pName name of the input port
pUnit the unit this input port belongs to

ControlPort::ControlPort ( Unit pUnit,
unsigned int  pChannelCount 
)

parameter based contructor

Parameters:
pUnit the unit this input port belongs to
pChannelCount number of channels

ControlPort::ControlPort ( const String pName,
Unit pUnit,
unsigned int  pChannelCount 
)

name and parameter based contructor

Parameters:
pName name of the input port
pUnit the unit this input port belongs to
pChannelCount number of channels

ControlPort::~ControlPort (  ) 

destructor

ControlPort::ControlPort (  )  [protected]

default constructor


Member Function Documentation

const base::String & ControlPort::name (  )  const [virtual]

returns port name

Returns:
String containing port name

Reimplemented from iso::synth::Port.

Unit * ControlPort::unit (  ) 

returns associated unit

Reimplemented from iso::synth::AudioPort.

unsigned int ControlPort::channelCount (  )  const

return channel count

Returns:
channel count

Reimplemented from iso::synth::AudioPort.

unsigned int ControlPort::frameCount (  )  const

return frame count

Returns:
frame count

Reimplemented from iso::synth::AudioPort.

unsigned int ControlPort::count (  )  const [virtual]

return exptected number of values

Returns:
expected number of values

const math::Vector< sample > & ControlPort::values (  )  const [virtual]

return values

Returns:
values;

long ControlPort::fadeDuration (  )  const

return fade duration (in microsecs)

Returns:
fade duration (in microsecs)

sample ControlPort::rate (  )  const

return frame rate

Returns:
frame rate

Reimplemented from iso::synth::AudioPort.

Buffer * ControlPort::buffer (  )  const

return buffer

Frame * ControlPort::frame (  )  const

return frame

void ControlPort::setResizeAllowed ( bool  pResizeAllowed  ) 

set resize allowed flag

Parameters:
pResizeAllowed resize allowed flag

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

set channel count

Parameters:
pChannelCount channel count
Exceptions:
SynthException channel count change not possible

Reimplemented from iso::synth::AudioPort.

void ControlPort::setFrameCount ( unsigned int  pFrameCount  )  throw (SynthException) [virtual]

set frame count

Parameters:
pFrameCount frame count
Exceptions:
SynthException frame count not a power of two or frame count change not possible

Reimplemented from iso::synth::AudioPort.

void ControlPort::setFadeDuration ( sample  pFadeDuration  )  [virtual]

set fade duration

Parameters:
pFadeDuration fade duration (in milisecs)

void ControlPort::set ( sample  pValue  )  [virtual]

set values

Parameters:
pValue single value

void ControlPort::set ( math::Vector< sample pValues  )  throw (event::EventException) [virtual]

set values

Parameters:
pValues array of values
Exceptions:
EventException number of values cannot be changed

void ControlPort::schedule ( double  pTime,
sample  pValue,
double  pDuration = -1,
event::EventTime  pTimeMode = event::EVENT_RELATIVE 
) throw (event::EventException) [virtual]

set value via event

Parameters:
pTime time in milisecs when event will take place
pValue value
pDuration duration over which the port changes it's values (-1: ignore duration parameter)
pTimeMode whether pTime is relative to current time or absolute (with regard to start of program)
Exceptions:
event::EventException failed to set port

void ControlPort::schedule ( double  pTime,
const math::Vector< sample pValues,
double  pDuration = -1,
event::EventTime  pTimeMode = event::EVENT_RELATIVE 
) throw (event::EventException) [virtual]

set values via event

Parameters:
pTime time in milisecs when event will take place
pValues port values
pDuration duration over which the port changes it's values (-1: ignore duration parameter)
pTimeMode whether pTime is relative to current time or absolute (with regard to start of program)
Exceptions:
event::EventException failed to set port

void ControlPort::process ( Buffer pBuffer  )  [virtual]

signal processing function

Parameters:
pBuffer signal data

Reimplemented from iso::synth::InputPort.

Buffer * ControlPort::process (  )  [virtual]

control signal processing function

Returns:
internal buffer or frame of control port

base::String ControlPort::info (  )  const [virtual]

obtain textual inport port information

Returns:
String containing input port information

base::String ControlPort::info ( bool  pPropagate  )  const [virtual]

obtain textual inport port information

Parameters:
pPropagate if true, the input port calls the info method of it's associated Link
Returns:
String containing input port information

Reimplemented from iso::synth::InputPort.

void ControlPort::changeBufferSize (  )  [protected]

change internal buffer size

this function is called by the associated unit whenever its frameCount or channelCount changes


Friends And Related Function Documentation

friend class Unit [friend]

Reimplemented from iso::synth::InputPort.

friend class ControlFadeStrategy [friend]

std::ostream& operator<< ( std::ostream &  pOstream,
const ControlPort pPort 
) [friend]

print port information


Member Data Documentation

const base::String ControlPort::sClassName [static]

default name

Reimplemented from iso::synth::InputPort.

ControlFadeStrategy* iso::synth::ControlPort::mFadeStrategy [protected]

fade strategy

bool iso::synth::ControlPort::mFading [protected]

indicates whether this control port is fading or not

bool iso::synth::ControlPort::mResizeAllowed [protected]

indicates whether values can be resized or not

Buffer* iso::synth::ControlPort::mBuffer [protected]

internal buffer

this one gets passed to the fade strategy if present and required

Frame* iso::synth::ControlPort::mFrame [protected]

internal frame

this one stores values directly

long iso::synth::ControlPort::mFadeDuration [protected]

fade duration (in microsecs)


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