resonance 1.0.1
Loading...
Searching...
No Matches
source.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/attachment.h"
4
19class Source : public Attachment {
20public:
30 virtual int GetValue(float flTime, float *pValue) = 0;
31
41 static Source *AllocateSineSource(float flPeriod, float flPhase);
42
54 static Source *AllocateSquareSource(float flPeriod);
55
65 static Source *AllocateTriSource(float flPeriod, float flPhase);
66
76 static Source *AllocateRampSource(float flPeriod, float flPhase);
77
89 static Source *AllocateFadeOutSource(int bStopAtEnd, float flDuration);
90
102 static Source *AllocateFadeInSource(int bStopAtEnd, float flDuration);
103
114 static Source *AllocateHoldAndFadeDownSource(int bStopAtEnd, float flHold, float flFade);
115};
Attachment()
Definition attachment.h:26
Reference-counted control signal sampled against elapsed time.
Definition source.h:19
static Source * AllocateSquareSource(float flPeriod)
Build a square wave.
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 * AllocateTriSource(float flPeriod, float flPhase)
Build a triangle wave that rises from 0 to 1 and falls back once per period.
static Source * AllocateSineSource(float flPeriod, float flPhase)
Build a sine wave between 0 and 1.
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.
virtual int GetValue(float flTime, float *pValue)=0
Produce the signal's value at a time.