CSL  6.0
csl::Scalable Class Reference

Scalable – mix-in class with scale and offset control inputs (may be constants or generators). More...

#include <CSL_Core.h>

+ Inheritance diagram for csl::Scalable:

Public Member Functions

 Scalable ()
 Constructors. More...
 
 Scalable (float scale)
 use the given static scale More...
 
 Scalable (float scale, float offset)
 use the given static scale & offset More...
 
 Scalable (UnitGenerator &scale, float offset)
 use the given dynamic scale & static offset More...
 
 Scalable (UnitGenerator &scale, UnitGenerator &offset)
 use the given dynamic scale & offset More...
 
 ~Scalable ()
 Destructor. More...
 
void setScale (UnitGenerator &scale)
 set the receiver's scale member to a UGen or a float More...
 
void setScale (float scale)
 
void setOffset (UnitGenerator &offset)
 set the receiver's offset member to a UGen or a float More...
 
void setOffset (float offset)
 
virtual void trigger ()
 trigger passed on here More...
 
void isScaled ()
 answer whether scale = 1 & offset = 0 More...
 
PortgetPort (CSL_MAP_KEY name)
 

Protected Member Functions

void addInput (CSL_MAP_KEY name, UnitGenerator &ugen)
 Plug in a unit generator to the named input slot. More...
 
void addInput (CSL_MAP_KEY name, float value)
 Plug in a float to the named input slot. More...
 
void pullInput (Port *thePort, unsigned numFrames) throw (CException)
 method to read the control values (in case they're dynamic). this sends nextBuffer() to the input. More...
 
void pullInput (Port *thePort, Buffer &theBuffer) throw (CException)
 
virtual void dump ()
 pretty-print the receiver's input/controls map More...
 

Protected Attributes

PortMap mInputs
 the map of my inputs or controls (used by the mix-in classes) More...
 

Detailed Description

Scalable – mix-in class with scale and offset control inputs (may be constants or generators).

This uses the mInput map keys CSL_SCALE and CSL_OFFSET.

Most actual unit generators inherit this as well as UnitGenerator.

We use Controllable as a virtual superclass so that we can mix it in twice (in classes that are also Phased)

Definition at line 403 of file CSL_Core.h.

Constructor & Destructor Documentation

Scalable::Scalable ( )

Constructors.

Definition at line 991 of file CSL_Core.cpp.

References CSL_OFFSET, CSL_SCALE, csl::logMsg(), and csl::Controllable::mInputs.

Scalable::Scalable ( float  scale)

use the given static scale

Definition at line 999 of file CSL_Core.cpp.

References csl::Controllable::addInput(), CSL_OFFSET, CSL_SCALE, csl::logMsg(), and csl::Controllable::mInputs.

Scalable::Scalable ( float  scale,
float  offset 
)

use the given static scale & offset

Definition at line 1007 of file CSL_Core.cpp.

References csl::Controllable::addInput(), CSL_OFFSET, CSL_SCALE, and csl::logMsg().

Scalable::Scalable ( UnitGenerator scale,
float  offset 
)

use the given dynamic scale & static offset

Definition at line 1015 of file CSL_Core.cpp.

References csl::Controllable::addInput(), CSL_OFFSET, CSL_SCALE, and csl::logMsg().

Scalable::Scalable ( UnitGenerator scale,
UnitGenerator offset 
)

use the given dynamic scale & offset

Definition at line 1023 of file CSL_Core.cpp.

References csl::Controllable::addInput(), CSL_OFFSET, CSL_SCALE, and csl::logMsg().

Scalable::~Scalable ( )

Destructor.

Definition at line 1031 of file CSL_Core.cpp.

Member Function Documentation

void Scalable::setScale ( float  scale)

Definition at line 1046 of file CSL_Core.cpp.

References csl::Controllable::addInput(), CSL_SCALE, and csl::logMsg().

void Scalable::setOffset ( UnitGenerator offset)

set the receiver's offset member to a UGen or a float

Definition at line 1053 of file CSL_Core.cpp.

References csl::Controllable::addInput(), CSL_OFFSET, and csl::logMsg().

void Scalable::setOffset ( float  offset)

Definition at line 1060 of file CSL_Core.cpp.

References csl::Controllable::addInput(), CSL_OFFSET, and csl::logMsg().

void Scalable::trigger ( void  )
virtual

trigger passed on here

Reimplemented in csl::RandEnvelope, csl::Abst_SoundFile, csl::Envelope, and csl::KarplusString.

Definition at line 1069 of file CSL_Core.cpp.

References CSL_OFFSET, CSL_SCALE, and csl::Controllable::mInputs.

void csl::Scalable::isScaled ( )

answer whether scale = 1 & offset = 0

Port * Controllable::getPort ( CSL_MAP_KEY  name)
inherited
void Controllable::addInput ( CSL_MAP_KEY  name,
float  value 
)
protectedinherited

Plug in a float to the named input slot.

Definition at line 906 of file CSL_Core.cpp.

References csl::logMsg(), csl::Controllable::mInputs, and csl::Port::mValue.

void Controllable::pullInput ( Port thePort,
unsigned  numFrames 
)
throw (CException
)
protectedinherited

method to read the control values (in case they're dynamic). this sends nextBuffer() to the input.

Definition at line 847 of file CSL_Core.cpp.

References csl::kSamples, csl::logMsg(), csl::Buffer::mIsPopulated, csl::Buffer::mNumFrames, csl::Buffer::mType, csl::UnitGenerator::nextBuffer(), and csl::Buffer::zeroBuffers().

Referenced by csl::Panner::nextBuffer(), csl::NtoMPanner::nextBuffer(), and csl::Effect::pullInput().

void Controllable::pullInput ( Port thePort,
Buffer theBuffer 
)
throw (CException
)
protectedinherited

Definition at line 879 of file CSL_Core.cpp.

References csl::UnitGenerator::nextBuffer().

Member Data Documentation


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