csl::LineSegment Class Reference

#include <Envelope.h>

Inheritance diagram for csl::LineSegment:

csl::UnitGenerator csl::Model

List of all members.

Public Member Functions

 LineSegment ()
 empty constructor
 LineSegment (float d, float s, float e, LineMode mode=kLine)
 Declare dur in sec, start, stop values.
float start ()
 Accessors.
float end ()
 Returns the target value of the line segment.
float duration ()
 Returns the total time it will take to get from start to end value.
unsigned currentFrame ()
void setEnd (float tend)
void setStart (float tstart)
void setDuration (unsigned tduration)
 Overloaded to accept either float or unsigned.
void setDuration (float tduration)
void setMode (LineMode tmode)
 Sets the interpolation kind (linear or exponential).
void nextBuffer (Buffer &outputBuffer, unsigned outBufNum) throw (CException)
 next buffer interpolator
void nextBuffer (Buffer &outputBuffer, unsigned outBufNum, Port *scalePort, Port *offsetPort) throw (CException)
 handy version given Scalable port pointers
void reset ()
 reset counters
void trigger ()
void dump ()
 reset internal time to restart envelope

Protected Attributes

float mStart
 Start value.
float mEnd
 Ending value.
float mDuration
 Length of the line segment (IN SECONDS).
LineMode mMode
 How am I to calculate the values from start to end values of the line.
float mCurrentValue
 Internal book-keeping.
unsigned mCurrentFrame
 cache


Detailed Description

A linearly interpolated segment -- this has start and end values, and a duration (in seconds).

Constructor & Destructor Documentation

LineSegment::LineSegment (  ) 

empty constructor

LineSegment class.

Constructors

LineSegment::LineSegment ( float  d,
float  s,
float  e,
LineMode  mode = kLine 
)

Declare dur in sec, start, stop values.

References kExpon, mEnd, and mStart.


Member Function Documentation

float csl::LineSegment::start ( void   )  [inline]

Accessors.

Returns the initial value of the line segment.

References mStart.

float csl::LineSegment::end (  )  [inline]

Returns the target value of the line segment.

References mEnd.

Referenced by csl::RandEnvelope::nextSegment().

float csl::LineSegment::duration (  )  [inline]

Returns the total time it will take to get from start to end value.

References mDuration.

Referenced by csl::RandEnvelope::nextSegment(), and csl::ADSR::setAttack().

unsigned csl::LineSegment::currentFrame (  )  [inline]

References mCurrentFrame.

void csl::LineSegment::setEnd ( float  tend  )  [inline]

void csl::LineSegment::setStart ( float  tstart  )  [inline]

void csl::LineSegment::setDuration ( unsigned  tduration  )  [inline]

Overloaded to accept either float or unsigned.

References mDuration.

Referenced by csl::Envelope::calculateSegments(), and csl::RandEnvelope::nextSegment().

void csl::LineSegment::setDuration ( float  tduration  )  [inline]

References mDuration.

void csl::LineSegment::setMode ( LineMode  tmode  )  [inline]

Sets the interpolation kind (linear or exponential).

References mMode.

void LineSegment::nextBuffer ( Buffer outputBuffer,
unsigned  outBufNum 
) throw (CException) [virtual]

next buffer interpolator

Reimplemented from csl::UnitGenerator.

void LineSegment::nextBuffer ( Buffer outputBuffer,
unsigned  outBufNum,
Port scalePort,
Port offsetPort 
) throw (CException)

handy version given Scalable port pointers

calculate the increment for the linear interpolation, the number of frames to calculate and the number of frames that are constant (at the end of the interpolations)

This test to see if we're at the end works for now, but we should use a bool to check if we are done in case mCurrentFrame loops

< Generate the interpolated frames

< Generate the interpolated frames

< Generate the constant frames

< if we're not already at the end increment my internal counters

References CHECK_UPDATE_SCALABLE_CONTROLS, kExpon, kLine, and mFrameRate.

void LineSegment::reset (  ) 

reset counters

Reset method.

References mCurrentFrame, mCurrentValue, and mStart.

Referenced by csl::RandEnvelope::nextSegment(), csl::Envelope::scaleTimes(), and trigger().

void csl::LineSegment::trigger ( void   )  [inline]

References reset().

void LineSegment::dump ( void   )  [virtual]

reset internal time to restart envelope

Prints to screen the start and end values and the duration of the line.

Reimplemented from csl::UnitGenerator.

References kLine, csl::logMsg(), mDuration, mEnd, mMode, and mStart.

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


Member Data Documentation

float csl::LineSegment::mStart [protected]

Start value.

Referenced by dump(), LineSegment(), reset(), setStart(), and start().

float csl::LineSegment::mEnd [protected]

Ending value.

Referenced by dump(), end(), LineSegment(), and setEnd().

float csl::LineSegment::mDuration [protected]

Length of the line segment (IN SECONDS).

Referenced by dump(), duration(), and setDuration().

How am I to calculate the values from start to end values of the line.

Referenced by dump(), and setMode().

Internal book-keeping.

Referenced by reset(), and setStart().

unsigned csl::LineSegment::mCurrentFrame [protected]

cache

Referenced by currentFrame(), and reset().


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

Generated on Thu Sep 17 23:14:17 2009 for CSL by  doxygen 1.5.8