CSL  6.0
csl::Port Class Reference

Port – used to represent constant, control-rate or signal inputs and outputs in named maps; holds a UnitGenerator and its buffer, OR a single floating-point value (in which case the UGen pointer is set to NULL and mPtrIncrement = 0). More...

#include <CSL_Core.h>

Public Member Functions

 Port ()
 Constructors: default is a float = 0. More...
 
 Port (UnitGenerator *ug)
 Given a UGen, use it as the input. More...
 
 Port (float value)
 given a float, hold it as the static value More...
 
virtual ~Port ()
 Destructor. More...
 
void checkBuffer () throw (LogicError)
 check the port's buffer and allocate it if needed More...
 
float nextValue ()
 answer the next value (dynamic or constant) More...
 
void nextFrame (SampleBuffer where)
 write the val to a buffer More...
 
bool isReady ()
 answer whether I'm ready to be read More...
 
void resetPtr ()
 reset the buffer pointer without re-pulling the input More...
 
virtual bool isActive ()
 answer whether I'm active More...
 
void dump ()
 pretty-print the receiver More...
 
bool isFixed ()
 
virtual void trigger ()
 am I fixed or dynamic More...
 

Public Attributes

UnitGeneratormUGen
 my unit generator (pointer or NULL) More...
 
BuffermBuffer
 the buffer used to hold my output More...
 
float mValue
 my value (in case I'm fixed [mUGen == NULL]) More...
 
float * mValuePtr
 my value's address (const or buffer pointer) More...
 
unsigned mPtrIncrement
 the inter-sample ptr increment (0 for const, 1 for dynamic) More...
 
unsigned mValueIndex
 my index (into the UGen's buffer) More...
 

Detailed Description

Port – used to represent constant, control-rate or signal inputs and outputs in named maps; holds a UnitGenerator and its buffer, OR a single floating-point value (in which case the UGen pointer is set to NULL and mPtrIncrement = 0).

The nextValue() message is used to get the dynamic or static value.

Definition at line 312 of file CSL_Core.h.

Constructor & Destructor Documentation

Port::Port ( )

Constructors: default is a float = 0.

Definition at line 766 of file CSL_Core.cpp.

Port::Port ( UnitGenerator ug)

Given a UGen, use it as the input.

Definition at line 773 of file CSL_Core.cpp.

References csl::Buffer::allocateBuffers(), csl::Buffer::buffer(), mBuffer, and mValuePtr.

Port::Port ( float  value)

given a float, hold it as the static value

Definition at line 782 of file CSL_Core.cpp.

Port::~Port ( )
virtual

Destructor.

Definition at line 789 of file CSL_Core.cpp.

Member Function Documentation

void Port::checkBuffer ( )
throw (LogicError
)
sample csl::Port::nextValue ( )
inline

answer the next value (dynamic or constant)

Definition at line 341 of file CSL_Core.h.

References mPtrIncrement, and mValuePtr.

Referenced by csl::VSTIO::getParameter(), csl::Panner::nextBuffer(), and csl::NtoMPanner::nextBuffer().

void csl::Port::nextFrame ( SampleBuffer  where)
inline

write the val to a buffer

Definition at line 348 of file CSL_Core.h.

References csl::Buffer::buffer(), mBuffer, csl::Buffer::mNumChannels, and mValueIndex.

bool csl::Port::isReady ( )
inline

answer whether I'm ready to be read

Definition at line 356 of file CSL_Core.h.

References mValuePtr.

void Port::resetPtr ( )

reset the buffer pointer without re-pulling the input

Definition at line 811 of file CSL_Core.cpp.

References csl::Buffer::buffer(), mBuffer, mPtrIncrement, and mValuePtr.

bool Port::isActive ( )
virtual

answer whether I'm active

Definition at line 818 of file CSL_Core.cpp.

References csl::UnitGenerator::isActive(), and mUGen.

Referenced by csl::Effect::isActive().

void Port::dump ( void  )

pretty-print the receiver

Definition at line 827 of file CSL_Core.cpp.

References csl::UnitGenerator::dump(), csl::logMsg(), mPtrIncrement, mUGen, and mValue.

Referenced by csl::BinaryOp::dump().

bool csl::Port::isFixed ( )
inline

Definition at line 334 of file CSL_Core.h.

virtual void csl::Port::trigger ( void  )
inlinevirtual

am I fixed or dynamic

Definition at line 335 of file CSL_Core.h.

References csl::UnitGenerator::trigger().

Member Data Documentation

Buffer* csl::Port::mBuffer

the buffer used to hold my output

Definition at line 321 of file CSL_Core.h.

Referenced by checkBuffer(), csl::InOut::nextBuffer(), nextFrame(), Port(), csl::Effect::pullInput(), and resetPtr().

float csl::Port::mValue

my value (in case I'm fixed [mUGen == NULL])

Definition at line 322 of file CSL_Core.h.

Referenced by csl::Controllable::addInput(), dump(), and csl::BinaryOp::setOperand().

float* csl::Port::mValuePtr

my value's address (const or buffer pointer)

Definition at line 323 of file CSL_Core.h.

Referenced by isReady(), nextValue(), Port(), and resetPtr().

unsigned csl::Port::mPtrIncrement

the inter-sample ptr increment (0 for const, 1 for dynamic)

Definition at line 324 of file CSL_Core.h.

Referenced by dump(), nextValue(), and resetPtr().

unsigned csl::Port::mValueIndex

my index (into the UGen's buffer)

Definition at line 325 of file CSL_Core.h.

Referenced by nextFrame().


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