|
resonance 1.0.1
|
Reference-counted control signal sampled against elapsed time. More...
#include <source.h>


Public Member Functions | |
| virtual int | GetValue (float flTime, float *pValue)=0 |
| Produce the signal's value at a time. | |
| Public Member Functions inherited from Attachment | |
| Attachment () | |
| virtual | ~Attachment () |
| int | Release () |
| Give back one reference and destroy the object once the last one is gone. | |
| virtual void | Destroy () |
| Destroy the object. | |
Static Public Member Functions | |
| static Source * | AllocateSineSource (float flPeriod, float flPhase) |
| Build a sine wave between 0 and 1. | |
| static Source * | AllocateSquareSource (float flPeriod) |
| Build a square wave. | |
| static Source * | AllocateTriSource (float flPeriod, float flPhase) |
| Build a triangle wave that rises from 0 to 1 and falls back once per period. | |
| static Source * | AllocateRampSource (float flPeriod, float flPhase) |
| Build a sawtooth that rises from 0 to 1 once per period. | |
| static Source * | AllocateFadeOutSource (int bStopAtEnd, float flDuration) |
| Build a fade from 1 down to 0 that then holds 0. | |
| static Source * | AllocateFadeInSource (int bStopAtEnd, float flDuration) |
| Build a fade from 0 up to 1 that then holds 1. | |
| static Source * | AllocateHoldAndFadeDownSource (int bStopAtEnd, float flHold, float flFade) |
| Build a signal that holds 1, then fades down to 0 and holds 0. | |
| Static Public Member Functions inherited from Attachment | |
| static void | ReleaseIfSet (Attachment *pAttachment) |
| Give back one reference to an object that may be null. | |
Additional Inherited Members | |
| Public Attributes inherited from Attachment | |
| int | mRefs |
Reference-counted control signal sampled against elapsed time.
Its RTTI descriptor is at 0x008ef3b0. It has Attachment as its only base at offset 0. The object is Attachment's eight bytes and adds GetValue() as slot 3 of the table it shares with Attachment. The six subclass tables all fill slot 3 and no factory builds a plain Source, and the slot is modelled as pure on that evidence.
source.cpp defines six subclasses in its anonymous namespace, which the RTTI records under the _GLOBAL_$N$source.cpp prefix: Sine, Square, Tri, Ramp, Fade, and HoldAndFadeDown. The static factories below are the only way the image builds any of them. Each allocates through the plain allocator and returns the object with one reference. The implicit destructors of the six subclasses and their type_info accessors are compiler-generated.
|
pure virtual |
Produce the signal's value at a time.
Slot 3.
| flTime | The time since the source started, in the unit its factory arguments use. |
| pValue | Receives the value, between 0 and 1. |
|
static |
Build a sine wave between 0 and 1.
| flPeriod | The period. |
| flPhase | The starting phase, as a fraction of a whole turn. |
|
static |
Build a square wave.
The value is 1 while the time modulo the period is below 0.5 and 0 otherwise, whatever the period.
| flPeriod | The period. |
|
static |
Build a triangle wave that rises from 0 to 1 and falls back once per period.
| flPeriod | The period. |
| flPhase | The starting phase, as a fraction of the period. |
|
static |
Build a sawtooth that rises from 0 to 1 once per period.
| flPeriod | The period. |
| flPhase | The starting phase, as a fraction of the period. |
|
static |
Build a fade from 1 down to 0 that then holds 0.
The title is inferred. The Fade class is shared with AllocateFadeInSource().
| bStopAtEnd | Non-zero to report the source finished once the fade is over. |
| flDuration | The length of the fade. |
|
static |
Build a fade from 0 up to 1 that then holds 1.
The title is inferred.
| bStopAtEnd | Non-zero to report the source finished once the fade is over. |
| flDuration | The length of the fade. |
|
static |
Build a signal that holds 1, then fades down to 0 and holds 0.
| bStopAtEnd | Non-zero to report the source finished once the fade is over. |
| flHold | The time the signal holds 1. |
| flFade | The length of the fade after the hold. |