#include <iso_synth_control_port.h>
Inherits iso::synth::InputPort.
Inheritance diagram for iso::synth::ControlPort:
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 String & | name () const |
returns port name | |
Unit * | unit () |
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 | |
Buffer * | buffer () const |
return buffer | |
Frame * | frame () 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 Buffer * | process () |
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 | |
ControlFadeStrategy * | mFadeStrategy |
fade strategy | |
bool | mFading |
indicates whether this control port is fading or not | |
bool | mResizeAllowed |
indicates whether values can be resized or not | |
Buffer * | mBuffer |
internal buffer | |
Frame * | mFrame |
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 |
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.
ControlPort::ControlPort | ( | Unit * | pUnit | ) |
parameter based contructor
pUnit | the unit this input port belongs to |
name and parameter based contructor
pName | name of the input port | |
pUnit | the unit this input port belongs to |
ControlPort::ControlPort | ( | Unit * | pUnit, | |
unsigned int | pChannelCount | |||
) |
parameter based contructor
pUnit | the unit this input port belongs to | |
pChannelCount | number of channels |
name and parameter based contructor
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
const base::String & ControlPort::name | ( | ) | const [virtual] |
Unit * ControlPort::unit | ( | ) |
unsigned int ControlPort::channelCount | ( | ) | const |
unsigned int ControlPort::frameCount | ( | ) | const |
unsigned int ControlPort::count | ( | ) | const [virtual] |
return exptected number of values
const math::Vector< sample > & ControlPort::values | ( | ) | const [virtual] |
return values
long ControlPort::fadeDuration | ( | ) | const |
return fade duration (in microsecs)
sample ControlPort::rate | ( | ) | const |
Buffer * ControlPort::buffer | ( | ) | const |
return buffer
Frame * ControlPort::frame | ( | ) | const |
return frame
void ControlPort::setResizeAllowed | ( | bool | pResizeAllowed | ) |
set resize allowed flag
pResizeAllowed | resize allowed flag |
void ControlPort::setChannelCount | ( | unsigned int | pChannelCount | ) | throw (SynthException) [virtual] |
set channel count
pChannelCount | channel count |
SynthException | channel count change not possible |
Reimplemented from iso::synth::AudioPort.
void ControlPort::setFrameCount | ( | unsigned int | pFrameCount | ) | throw (SynthException) [virtual] |
set frame count
pFrameCount | frame count |
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
pFadeDuration | fade duration (in milisecs) |
void ControlPort::set | ( | sample | pValue | ) | [virtual] |
set values
pValue | single value |
void ControlPort::set | ( | math::Vector< sample > | pValues | ) | throw (event::EventException) [virtual] |
set values
pValues | array of values |
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
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) |
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
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) |
event::EventException | failed to set port |
void ControlPort::process | ( | Buffer * | pBuffer | ) | [virtual] |
signal processing function
pBuffer | signal data |
Reimplemented from iso::synth::InputPort.
Buffer * ControlPort::process | ( | ) | [virtual] |
control signal processing function
base::String ControlPort::info | ( | ) | const [virtual] |
obtain textual inport port information
base::String ControlPort::info | ( | bool | pPropagate | ) | const [virtual] |
obtain textual inport port information
pPropagate | if true, the input port calls the info method of it's associated Link |
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
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
const base::String ControlPort::sClassName [static] |
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)