#include <Envelope.h>

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 | |
| LineSegment::LineSegment | ( | ) |
| LineSegment::LineSegment | ( | float | d, | |
| float | s, | |||
| float | e, | |||
| LineMode | mode = kLine | |||
| ) |
| float csl::LineSegment::start | ( | void | ) | [inline] |
| 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] |
References mEnd.
Referenced by csl::RandEnvelope::initSegment(), csl::RandEnvelope::nextSegment(), and csl::ADSR::setSustain().
| void csl::LineSegment::setStart | ( | float | tstart | ) | [inline] |
References mCurrentValue, and mStart.
Referenced by csl::Envelope::calculateSegments(), and csl::RandEnvelope::nextSegment().
| 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] |
| void LineSegment::nextBuffer | ( | Buffer & | outputBuffer, | |
| unsigned | outBufNum | |||
| ) | throw (CException) [virtual] |
| 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().
float csl::LineSegment::mStart [protected] |
float csl::LineSegment::mEnd [protected] |
float csl::LineSegment::mDuration [protected] |
LineMode csl::LineSegment::mMode [protected] |
float csl::LineSegment::mCurrentValue [protected] |
unsigned csl::LineSegment::mCurrentFrame [protected] |
1.5.8