CSL  5.2
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). The nextValue() message is used to get the dynamic or static value. More...

#include <CSL_Core.h>

List of all members.

Public Member Functions

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

Public Attributes

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

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 287 of file CSL_Core.h.


Constructor & Destructor Documentation

Port::Port ( )

Constructors: default is a float = 0.

Definition at line 614 of file CSL_Core.cpp.

Port::Port ( UnitGenerator ug)

Given a UGen, use it as the input.

Definition at line 621 of file CSL_Core.cpp.

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

Port::Port ( float  value)

given a float, hold it as the static value

Definition at line 630 of file CSL_Core.cpp.

Port::~Port ( )
virtual

Destructor.

Definition at line 637 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 316 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 323 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 331 of file CSL_Core.h.

References mValuePtr.

void Port::resetPtr ( )

reset the buffer pointer without re-pulling the input

Definition at line 659 of file CSL_Core.cpp.

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

bool Port::isActive ( )
virtual

answer whether I'm active

Definition at line 666 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 675 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 309 of file CSL_Core.h.

References mPtrIncrement.

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

am I fixed or dynamic

Definition at line 310 of file CSL_Core.h.

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


Member Data Documentation

Buffer* csl::Port::mBuffer

the buffer used to hold my output

Definition at line 296 of file CSL_Core.h.

Referenced by checkBuffer(), csl::RtpSender::nextBuffer(), 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 297 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 298 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 299 of file CSL_Core.h.

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

unsigned csl::Port::mValueIndex

my index (into the UGen's buffer)

Definition at line 300 of file CSL_Core.h.

Referenced by nextFrame().


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