iso::synth::Synth Class Reference

singleton class that handles synth patch (creation, cleanup, start & stop) and interoperability with jack More...

#include <iso_synth.h>

Collaboration diagram for iso::synth::Synth:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void saveWaveTables (const String &pFileName) throw (SynthException)
 save wavetables to file
void readWaveTables (const String &pFileName) throw (SynthException)
 save wavetables to file
unsigned int defaultFrameCount () const
 get default framecount
unsigned int defaultChannelCount () const
 get default channel count
sample defaultRate () const
 get default rate
unsigned int defaultOverlap () const
 get default overlap
long time ()
 returns elpased synth time in microseconds
bool checkPatch (const String &pName) const
 check if patch with corresponding name exists
Patchpatch (const String &pName) throw (SynthException)
 returns patch with corresponding name
bool checkUnit (const String &pName) const
 check if unit with corresponding name exists
Unitunit (const String &pName) throw (SynthException)
 returns unit with corresponding name
bool checkAudioPort (const String &pName) const
 check if audio port with corresponding name exists
AudioPortaudioPort (const String &pName) throw (SynthException)
 returns audio port with corresponding name
bool checkSwitchPort (const String &pName) const
 check if switch port with corresponding name exists
SwitchPortswitchPort (const String &pName) throw (SynthException)
 returns switch port with corresponding name
EventManagerevent ()
 return event manager
void schedule (double pTime, Unit *pUnit, const base::String &pPortName, sample pValue, double pDuration=-1, event::EventTime pTimeMode=event::EVENT_RELATIVE) throw (SynthException)
 create event
void schedule (double pTime, Unit *pUnit, const base::String &pPortName, const math::Vector< sample > &pValues, double pDuration=-1, event::EventTime pTimeMode=event::EVENT_RELATIVE) throw (SynthException)
 create event
SynthComcom ()
 return communcation manager
void registerPatch (Patch *pPatch)
 register patch
void deregisterPatch (const base::String &pPatchName)
 deregister patch
bool unitAutoRegister () const
 return unit auto register flag
void setUnitAutoRegister (bool pUnitAutoRegister)
 set unit auto register flag
void registerUnit (Unit *pUnit)
 register unit
void deregisterUnit (const base::String &pUnitName)
 deregister unit
void autoRegisterUnit (Unit *pUnit) throw (SynthException)
 queue unit for registration when synth starts
void registerUnits ()
 register queued units
void process ()
 initiates one signal processing cycle
void start () throw (SynthException)
 start signal processing and communication
Exceptions:
SynthException processing error

void stop ()
 stop signal processing
void exceptionReport (const base::Exception &pException)
 report exception
String info (bool pPropagate=false) const
 obtain textual unit information

Static Public Member Functions

static Synthget () throw (SynthException)
 get singleton instance
static void destroy ()
 destroy singleton instance

Protected Member Functions

 Synth () throw (SynthException)
 default constructor
 ~Synth ()
 destructor
void addPatch (const String &pName, Patch *pPatch) throw (SynthException)
 register patch
void addUnit (const String &pName, Unit *pUnit) throw (SynthException)
 register unit
void addOutputUnit (OutputUnit *pOutputUnit)
 add output unit
void addAudioPort (const String &pName, AudioPort *pAudioPort) throw (SynthException)
 register audio port
void addSwitchPort (const String &pName, SwitchPort *pSwitchPort) throw (SynthException)
 register switch port
void removePatch (const String &pName) throw (SynthException)
 remove patch
void removeUnit (const String &pName) throw (SynthException)
 remove unit
void removeOutputUnit (const String &pName) throw (SynthException)
 remove output unit
void removeAudioPort (const String &pName) throw (SynthException)
 remove audio port
void removeSwitchPort (const String &pName) throw (SynthException)
 remove switch port

Protected Attributes

JackClientmJackClient
 jack client
QHash< String, Patch * > mPatches
 patch registry
QHash< String, Unit * > mUnits
 unit registry
QHash< String, AudioPort * > mAudioPorts
 control port registry
QHash< String, SwitchPort * > mSwitchPorts
 switch port registry
QVector< OutputUnit * > mOutputUnits
 vector of all output units
EventManager mEventManager
 new event manager
bool mRunning
 synth running
Time mStartTime
 synth start time
long mStartMicroSecs
 synth start time in micro secs
Time mCurrentTime
 current time
TimeZone mTimeZone
 time zone
unsigned int mOverlap
 number of window overlaps for fft
bool mUnitAutoRegister
 flag that tells units whether they should autoregister or not
QVector< Unit * > mAutoRegisterUnits
 vector of units that will be automatically registered when synth starts

Static Protected Attributes

static SynthsSynth
 singleton instance

Friends

class RemoveUnitEvent
class Patch

Detailed Description

singleton class that handles synth patch (creation, cleanup, start & stop) and interoperability with jack

for creating, storing and controlling units

Created by Daniel Bisig on 5/17/06. Copyright 2006 Daniel Bisig All rights reserved.


Constructor & Destructor Documentation

Synth::Synth (  )  throw (SynthException) [protected]

default constructor

Synth::~Synth (  )  [protected]

destructor


Member Function Documentation

Synth & Synth::get (  )  throw (SynthException) [static]

get singleton instance

Returns:
singleton instance
Exceptions:
failed to get synth instance

void Synth::destroy (  )  [static]

destroy singleton instance

void Synth::saveWaveTables ( const String pFileName  )  throw (SynthException)

save wavetables to file

Parameters:
pFileName file name
Exceptions:
SynthException failed to save wavetables

void Synth::readWaveTables ( const String pFileName  )  throw (SynthException)

save wavetables to file

Parameters:
pFileName file name
Exceptions:
SynthException failed to save wavetables

unsigned int Synth::defaultFrameCount (  )  const

get default framecount

Returns:
default framecount
returns the framecount required by the jack client

unsigned int Synth::defaultChannelCount (  )  const

get default channel count

Returns:
default channel count
fixed to 1

sample Synth::defaultRate (  )  const

get default rate

Returns:
default rate
returns the rate employed by the jack client

unsigned int Synth::defaultOverlap (  )  const

get default overlap

Returns:
default overlap
returns default overlap for fft windows

long Synth::time (  ) 

returns elpased synth time in microseconds

time since the synth has been started

bool Synth::checkPatch ( const String pName  )  const

check if patch with corresponding name exists

Returns:
true if patch exists, false otherwise

Patch * Synth::patch ( const String pName  )  throw (SynthException)

returns patch with corresponding name

Parameters:
pName name of patch
Returns:
patch
Exceptions:
SynthException no patch with corresponding name found

bool Synth::checkUnit ( const String pName  )  const

check if unit with corresponding name exists

Returns:
true if unit exists, false otherwise

Unit * Synth::unit ( const String pName  )  throw (SynthException)

returns unit with corresponding name

Parameters:
pName name of unit
Returns:
unit
Exceptions:
SynthException no unit with corresponding name found

bool Synth::checkAudioPort ( const String pName  )  const

check if audio port with corresponding name exists

Returns:
true if audio port exists, false otherwise

AudioPort * Synth::audioPort ( const String pName  )  throw (SynthException)

returns audio port with corresponding name

Parameters:
pName name of audio port
Returns:
audio port
Exceptions:
SynthException no audio port with corresponding name found

bool Synth::checkSwitchPort ( const String pName  )  const

check if switch port with corresponding name exists

Returns:
true if switch port exists, false otherwise

SwitchPort * Synth::switchPort ( const String pName  )  throw (SynthException)

returns switch port with corresponding name

Parameters:
pName name of switch port
Returns:
switch port
Exceptions:
SynthException no switch port with corresponding name found

EventManager & Synth::event (  ) 

return event manager

Returns:
event manager

void Synth::schedule ( double  pTime,
Unit pUnit,
const base::String &  pPortName,
sample  pValue,
double  pDuration = -1,
event::EventTime  pTimeMode = event::EVENT_RELATIVE 
) throw (SynthException)

create event

Parameters:
pTime time in milisecs when event will take place
pUnit unit name
pPortName port name
pValue value for event target
pDuration duration over which the parameter 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:
SynthException port name not found
creates a whole bunch of events, one event per agent that possesses the parameter

void Synth::schedule ( double  pTime,
Unit pUnit,
const base::String &  pPortName,
const math::Vector< sample > &  pValues,
double  pDuration = -1,
event::EventTime  pTimeMode = event::EVENT_RELATIVE 
) throw (SynthException)

create event

Parameters:
pTime time in milisecs when event will take place
pUnit unit name
pPortName port name
pValues values for event target
pDuration duration over which the parameter 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:
SynthException port name not found
creates a whole bunch of events, one event per agent that possesses the parameter

SynthCom & Synth::com (  ) 

return communcation manager

void Synth::registerPatch ( Patch pPatch  ) 

register patch

Parameters:
pPatch patch

void Synth::deregisterPatch ( const base::String &  pPatchName  ) 

deregister patch

Parameters:
pPatchName patch name

bool Synth::unitAutoRegister (  )  const

return unit auto register flag

Returns:
unit auto register flag

void Synth::setUnitAutoRegister ( bool  pUnitAutoRegister  ) 

set unit auto register flag

Parameters:
pUnitAutoRegister unit auto register flag

void Synth::registerUnit ( Unit pUnit  ) 

register unit

Parameters:
pUnit unit

void Synth::deregisterUnit ( const base::String &  pUnitName  ) 

deregister unit

Parameters:
pUnitName unit name

void Synth::autoRegisterUnit ( Unit pUnit  )  throw (SynthException)

queue unit for registration when synth starts

Parameters:
pUnit unit
Exceptions:
unit already queued for registration

void Synth::registerUnits (  ) 

register queued units

void Synth::process (  ) 

initiates one signal processing cycle

calls the process function of all the registered output units

void Synth::start (  )  throw (SynthException)

start signal processing and communication

Exceptions:
SynthException processing error

void Synth::stop (  ) 

stop signal processing

void Synth::exceptionReport ( const base::Exception &  pException  ) 

report exception

Parameters:
pException exception

base::String Synth::info ( bool  pPropagate = false  )  const

obtain textual unit information

Parameters:
pPropagate if true, the unit calls the info methods of its input ports
Returns:
String containing unit information

void Synth::addPatch ( const String pName,
Patch pPatch 
) throw (SynthException) [protected]

register patch

Parameters:
pName name of patch
pPatch patch
Exceptions:
SynthException patch name already exists

void Synth::addUnit ( const String pName,
Unit pUnit 
) throw (SynthException) [protected]

register unit

Parameters:
pName name of unit
pUnit unit
Exceptions:
SynthException unit name already exists

void Synth::addOutputUnit ( OutputUnit pOutputUnit  )  [protected]

add output unit

Parameters:
pOutputUnit output unit
Returns:
output unit

void Synth::addAudioPort ( const String pName,
AudioPort pAudioPort 
) throw (SynthException) [protected]

register audio port

Parameters:
pName name of audio port
pAudioPort audio port
Exceptions:
SynthException name already exists

void Synth::addSwitchPort ( const String pName,
SwitchPort pSwitchPort 
) throw (SynthException) [protected]

register switch port

Parameters:
pName name of switch port
pSwitchPort switch port
Exceptions:
SynthException name already exists

void Synth::removePatch ( const String pName  )  throw (SynthException) [protected]

remove patch

Parameters:
pName name of patch
Exceptions:
SynthException patch not found

void Synth::removeUnit ( const String pName  )  throw (SynthException) [protected]

remove unit

Parameters:
pName name of unit
Exceptions:
SynthException unit not found

void Synth::removeOutputUnit ( const String pName  )  throw (SynthException) [protected]

remove output unit

Parameters:
pName name of output unit
Exceptions:
SynthException output unit not found

void Synth::removeAudioPort ( const String pName  )  throw (SynthException) [protected]

remove audio port

Parameters:
pName name of audio port
Exceptions:
SynthException audio port not found

void Synth::removeSwitchPort ( const String pName  )  throw (SynthException) [protected]

remove switch port

Parameters:
pName name of switch port
Exceptions:
SynthException switch port not found


Friends And Related Function Documentation

friend class RemoveUnitEvent [friend]

friend class Patch [friend]


Member Data Documentation

Synth * Synth::sSynth [static, protected]

singleton instance

JackClient* iso::synth::Synth::mJackClient [protected]

jack client

QHash<String, Patch*> iso::synth::Synth::mPatches [protected]

patch registry

QHash<String, Unit*> iso::synth::Synth::mUnits [protected]

unit registry

QHash<String, AudioPort*> iso::synth::Synth::mAudioPorts [protected]

control port registry

QHash<String, SwitchPort*> iso::synth::Synth::mSwitchPorts [protected]

switch port registry

QVector<OutputUnit*> iso::synth::Synth::mOutputUnits [protected]

vector of all output units

EventManager iso::synth::Synth::mEventManager [protected]

new event manager

bool iso::synth::Synth::mRunning [protected]

synth running

Time iso::synth::Synth::mStartTime [protected]

synth start time

the time the synth has been started

long iso::synth::Synth::mStartMicroSecs [protected]

synth start time in micro secs

the time the synth has been started in micro secs

Time iso::synth::Synth::mCurrentTime [protected]

current time

TimeZone iso::synth::Synth::mTimeZone [protected]

time zone

unsigned int iso::synth::Synth::mOverlap [protected]

number of window overlaps for fft

bool iso::synth::Synth::mUnitAutoRegister [protected]

flag that tells units whether they should autoregister or not

QVector<Unit*> iso::synth::Synth::mAutoRegisterUnits [protected]

vector of units that will be automatically registered when synth starts


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