ofxPDSP
pdsp::Patchable Class Reference

Abstract class for implementing Units and Modules. More...

#include <BasicNodes.h>

Inheritance diagram for pdsp::Patchable:
pdsp::AAHighShelfEQ pdsp::AALowShelfEQ pdsp::AAPeakEQ pdsp::BasiVerb pdsp::BitNoise pdsp::ChannelNode pdsp::ClockedLFO pdsp::CombFilter pdsp::Compressor pdsp::DataOscillator pdsp::DimensionChorus pdsp::Ducker pdsp::FMOperator pdsp::GrainCloud pdsp::HighCut pdsp::HighShelfEQ pdsp::IRVerb pdsp::LFO pdsp::LinearCrossfader pdsp::LowCut pdsp::LowShelfEQ pdsp::Panner pdsp::Parameter pdsp::ParameterAmp pdsp::ParameterGain pdsp::PeakEQ pdsp::PhaserFilter pdsp::SVFilter pdsp::TableOscillator pdsp::TriggeredGrain pdsp::Unit pdsp::VAFilter pdsp::VAOscillator

Public Member Functions

void resetInputToDefault ()
 resets the selected input to the default.
 
void resetOutputToDefault ()
 resets the selected output to the default.
 
Patchablein (const char *tag)
 sets the selected input to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. More...
 
Patchableout (const char *tag)
 sets the selected output to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. More...
 
void disconnectIn ()
 disconnects all the outputs connected to the selected input, then resets the selected input to the default.
 
void disconnectOut ()
 disconnects all the inputs connected to the selected output, then resets the selected output to the default.
 
void disconnectAll ()
 disconnects all the inputs and outputs to their connected outputs and inputs. Also resets the selected input and output to the default.
 
InputNodegetSelectedInput ()
 returns the selected input, you can patch a Patchable or OutputNode to it with the >> operator.
 
OutputNodegetSelectedOutput ()
 returns the selected output, you can patch it to another Patchable or InputNode with the >> operator.
 
std::vector< std::string > getInputsList ()
 returns a vector of the valid input tags
 
std::vector< std::string > getOutputsList ()
 returns a vector of the valid input tags
 

Protected Member Functions

void addOutput (const char *tag, OutputNode &output)
 method to add outputs when constructing a Unit More...
 
void addInput (const char *tag, InputNode &input)
 method to add inputs when constructing a Unit More...
 
void addModuleOutput (const char *tag, Patchable &unit)
 method to add outputs when constructing a module More...
 
void addModuleInput (const char *tag, Patchable &unit)
 method to add outputs when constructing a module More...
 

Friends

class Unit
 
class InputNode
 
class Switch
 

Detailed Description

Abstract class for implementing Units and Modules.

Patchable is a base class that rapresent everything that has in_ and out_ methods and can be patched with the >> operator. It is a superclass of Unit and it can be used as superclass to implement modules ( classes made from pre-patched Units )

Member Function Documentation

◆ addInput()

void pdsp::Patchable::addInput ( const char *  tag,
InputNode input 
)
protected

method to add inputs when constructing a Unit

Parameters
[in]tagtag name to assign to the input
[in]inputinput to add to available Unit inputs

When you are constructing a new Unit you use this method to add an input to the ones available for patching for this unit.

◆ addModuleInput()

void pdsp::Patchable::addModuleInput ( const char *  tag,
Patchable unit 
)
protected

method to add outputs when constructing a module

Parameters
[in]tagtag name to assign to the output.
[in]unitthe selected input of this unit will be added.

When you are constructing a new module you use this method to add an input to the ones available for patching for this module. The actually selected input will be added, so you can use the out("tagname") or out_tagname() methods on the unit that you are passing as argument. The method will also reset the Unit selected input to the default.

◆ addModuleOutput()

void pdsp::Patchable::addModuleOutput ( const char *  tag,
Patchable unit 
)
protected

method to add outputs when constructing a module

Parameters
[in]tagtag name to assign to the output.
[in]unitthe selected output of this unit will be added.

When you are constructing a new module you use this method to add an output to the ones available for patching for this module. The actually selected output will be added, so you can use the in("tagname") or in_tagname() methods on the unit that you are passing as argument. The method will also reset the Unit selected output to the default.

◆ addOutput()

void pdsp::Patchable::addOutput ( const char *  tag,
OutputNode output 
)
protected

method to add outputs when constructing a Unit

Parameters
[in]tagtag name to assign to the output
[in]outputoutput to add to available Unit outputs

When you are constructing a new Unit you use this method to add an output to the ones available for patching for this unit. Remember also to call the Unit updateOutputNodes() method. The first output added will became the default output.

◆ in()

pdsp::Patchable & pdsp::Patchable::in ( const char *  tag)

sets the selected input to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched.

Parameters
[in]tagtag of input to select

sets the selected input to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. If an invalid tag is given the selected input is set to a dummy input that will invalidate the next >> operation, a message will be sent to std::cout and an assert will be raised if you are debugging.

◆ out()

pdsp::Patchable & pdsp::Patchable::out ( const char *  tag)

sets the selected output to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched.

Parameters
[in]tagtag of output to select

sets the selected output to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. If an invalid tag is given the selected input is set to a dummy output that will invalidate the next >> operation, a message will be sent to std::cout and an assert will be raised if you are debugging.


The documentation for this class was generated from the following files: