Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

syn::Module Class Reference

a template signal module. More...

#include <Module.h>

Inheritance diagram for syn::Module:

Inheritance graph
[legend]
Collaboration diagram for syn::Module:

Collaboration graph
[legend]
List of all members.

Public Methods

 Module ()
virtual ~Module ()
virtual void update ()=0
virtual bool open ()=0
 open the stream and set the audio format of this module read from the stream(s) by getting the right output terminal. More...

virtual void close ()=0
virtual void setInstanceName (const std::string &name)
virtual std::string getInstanceName () const
virtual Module* clone () const=0
 get an exact copy of me. More...

bool isTerminator ()
 Returns true if self terminates the graph (no output terms). More...

bool isInitiator ()
 Returns true if self initiates the graph (no input terms). More...

statistics
virtual unsigned int pcount () const
parameter access
virtual void getParam (const std::string &key, MultivariateType &value)=0
 You need to support this parameter list in your modules. More...

virtual void setParam (const std::string &key, const MultivariateType &value)=0
 You need to support this parameter list in your modules. More...

bool getOutput (const std::string &name, TerminalPtr &output)
 get a producer by name return false if output not found by given name. More...

bool getInput (const std::string &name, TerminalPtr &input)
 access an input terminal. More...

std::map<std::string, TerminalPtr>& outputs ()
std::map<std::string, TerminalPtr>& inputs ()
TerminalPtr createOutput (const std::string &name)
 create an output terminal, add it to the module with the given name. More...

TerminalPtr createInput (const std::string &name)
 create an input terminal, add it to the module with the given name. More...

void removeOutput (const std::string &name)
 remove a producer from the box. More...

void inputsRemove (const std::string &name)
 remove a consumer from the box. More...


Protected Methods

void setPutCount (int p)

Protected Attributes

std::map<std::string, TerminalPtrmOutputTerminals
std::map<std::string, TerminalPtrmInputTerminals
std::map<std::string, MultivariateTypemParams
std::string mName
unsigned int mPutCount

Detailed Description

a template signal module.

specialize this to define how the inputs and outputs are connected. NOTES: Signal sources will have outputs. Optionally they will have inputs for realtime control of params. Output streams (openal, wav, raw, net, etc...) will have inputs only. Filters will have [n] inputs, and [k] outputs, some will be for data, others for param control.

See also:
Terminal , Connection

Definition at line 73 of file Module.h.


Constructor & Destructor Documentation

syn::Module::Module ( ) [inline]
 

Definition at line 76 of file Module.h.

syn::Module::~Module ( ) [inline, virtual]
 

Definition at line 82 of file Module.h.


Member Function Documentation

void syn::Module::update ( ) [pure virtual]
 

Reimplemented in syn::DummyOutputModule, syn::FilterModule, syn::InstrumentModule, syn::IStreamModule, syn::MixerModule, syn::OpenALOutputModule, syn::OperatorModule, syn::OscModule, syn::SplitterModule, and syn::WaveTableOscModule.

bool syn::Module::open ( ) [pure virtual]
 

open the stream and set the audio format of this module read from the stream(s) by getting the right output terminal.

Reimplemented in syn::DummyOutputModule, syn::FilterModule, syn::InstrumentModule, syn::IStreamModule, syn::MixerModule, syn::OpenALOutputModule, syn::OperatorModule, syn::OscModule, syn::SplitterModule, and syn::WaveTableOscModule.

void syn::Module::close ( ) [pure virtual]
 

Reimplemented in syn::DummyOutputModule, syn::FilterModule, syn::InstrumentModule, syn::IStreamModule, syn::MixerModule, syn::OpenALOutputModule, syn::OperatorModule, syn::OscModule, syn::SplitterModule, and syn::WaveTableOscModule.

void syn::Module::setInstanceName ( const std::string & name ) [inline, virtual]
 

Definition at line 93 of file Module.h.

std::string syn::Module::getInstanceName ( ) const [inline, virtual]
 

Definition at line 98 of file Module.h.

Module * syn::Module::clone ( ) const [pure virtual]
 

get an exact copy of me.

Reimplemented in syn::DummyOutputModule, syn::FilterModule, syn::InstrumentModule, syn::IStreamModule, syn::MixerModule, syn::OpenALOutputModule, syn::OperatorModule, syn::OscModule, syn::SplitterModule, and syn::WaveTableOscModule.

unsigned int syn::Module::pcount ( ) const [inline, virtual]
 

Reimplemented in syn::SplitterModule.

Definition at line 108 of file Module.h.

bool syn::Module::isTerminator ( ) [inline]
 

Returns true if self terminates the graph (no output terms).

Definition at line 161 of file Module.h.

bool syn::Module::isInitiator ( ) [inline]
 

Returns true if self initiates the graph (no input terms).

Definition at line 164 of file Module.h.

void syn::Module::getParam ( const std::string & key,
MultivariateType & value ) [pure virtual]
 

You need to support this parameter list in your modules.

If you don't, then special features like instrument builders and runtime introspection of synth state will not work.

Reimplemented in syn::AdsrEnvModule, syn::DummyOutputModule, syn::FilterModule, syn::InstrumentModule, syn::IStreamModule, syn::MixerModule, syn::OpenALOutputModule, syn::OperatorModule, syn::OscModuleBase, syn::SplitterModule, and syn::WaveTableOscModule.

void syn::Module::setParam ( const std::string & key,
const MultivariateType & value ) [pure virtual]
 

You need to support this parameter list in your modules.

If you don't, then special features like instrument builders and runtime introspection of synth state will not work.

Reimplemented in syn::AdsrEnvModule, syn::DummyOutputModule, syn::FilterModule, syn::InstrumentModule, syn::IStreamModule, syn::MixerModule, syn::OpenALOutputModule, syn::OperatorModule, syn::OscModuleBase, syn::SplitterModule, and syn::WaveTableOscModule.

bool syn::Module::getOutput ( const std::string & name,
TerminalPtr & output ) [inline]
 

get a producer by name return false if output not found by given name.

Definition at line 184 of file Module.h.

Referenced by syn::MixerModule::MixerModule().

bool syn::Module::getInput ( const std::string & name,
TerminalPtr & input ) [inline]
 

access an input terminal.

return false if input not found by given name.

Definition at line 203 of file Module.h.

std::map< std::string, TerminalPtr > & syn::Module::outputs<std::string, TerminalPtr> ( ) [inline]
 

Definition at line 219 of file Module.h.

Referenced by syn::SplitterModule::update().

std::map< std::string, TerminalPtr > & syn::Module::inputs<std::string, TerminalPtr> ( ) [inline]
 

Definition at line 220 of file Module.h.

Referenced by syn::MixerModule::update().

TerminalPtr syn::Module::createOutput ( const std::string & name ) [inline]
 

create an output terminal, add it to the module with the given name.

Definition at line 259 of file Module.h.

Referenced by syn::FilterModule::FilterModule(), syn::IStreamModule::IStreamModule(), syn::MixerModule::MixerModule(), syn::OperatorModule::OperatorModule(), syn::OscModule::OscModule(), syn::SplitterModule::SplitterModule(), syn::WaveTableOscModule::WaveTableOscModule(), and getOutput().

TerminalPtr syn::Module::createInput ( const std::string & name ) [inline]
 

create an input terminal, add it to the module with the given name.

Definition at line 268 of file Module.h.

Referenced by syn::DummyOutputModule::DummyOutputModule(), syn::FilterModule::FilterModule(), syn::IStreamModule::IStreamModule(), syn::OpenALOutputModule::OpenALOutputModule(), syn::OperatorModule::OperatorModule(), syn::OscModule::OscModule(), syn::SplitterModule::SplitterModule(), syn::WaveTableOscModule::WaveTableOscModule(), and getInput().

void syn::Module::removeOutput ( const std::string & name ) [inline]
 

remove a producer from the box.

Definition at line 276 of file Module.h.

void syn::Module::inputsRemove ( const std::string & name ) [inline]
 

remove a consumer from the box.

Definition at line 281 of file Module.h.

void syn::Module::setPutCount ( int p ) [inline, protected]
 

Definition at line 237 of file Module.h.

Referenced by syn::WaveTableOscModule::update(), syn::OscModule::update(), syn::OperatorModule::update(), syn::OpenALOutputModule::update(), syn::IStreamModule::update(), syn::FilterModule::update(), and syn::DummyOutputModule::update().


Member Data Documentation

std::map< std::string, TerminalPtr > syn::Module::mOutputTerminals<std::string, TerminalPtr> [protected]
 

Definition at line 242 of file Module.h.

std::map< std::string, TerminalPtr > syn::Module::mInputTerminals<std::string, TerminalPtr> [protected]
 

Definition at line 243 of file Module.h.

std::map< std::string, MultivariateType > syn::Module::mParams<std::string, MultivariateType> [protected]
 

Definition at line 244 of file Module.h.

std::string syn::Module::mName [protected]
 

Definition at line 245 of file Module.h.

unsigned int syn::Module::mPutCount [protected]
 

Definition at line 246 of file Module.h.


The documentation for this class was generated from the following file:
Generated at Mon Apr 15 09:27:58 2002 for subsynth by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001