|
Allolib
1.0
C++ Components For Interactive Multimedia
|
Self-correcting timer. More...
Public Member Functions | |
| DelayLockedLoop (al_sec step_period, double bandwidth=0.5) | |
| void | setBandwidth (double bandwidth) |
| Set degree of smoothing. | |
| void | reset () |
| Call this after an xrun: will reset the timing adjustments. | |
| void | step (al_sec realtime) |
| Trigger this from the periodic event. More... | |
| void | operator() (al_sec realtime) |
| al_sec | period_smoothed () const |
| Get the current period estimation (smoothed) | |
| al_sec | rate_smoothed () const |
| Get the current rate estimation (smoothed) | |
| al_sec | period_ideal () const |
| Get the ideal period. | |
| al_sec | rate_ideal () const |
| Get the ideal rate. | |
| al_sec | realtime_interp (double alpha) const |
| Returns time estimate between current and next event. More... | |
Protected Attributes | |
| al_sec | tperiod |
| al_sec | t0 |
| al_sec | t1 |
| al_sec | t2 |
| double | mB |
| double | mC |
| bool | mReset |
Self-correcting timer.
Helper object for events intended to run at a particular rate/period, but which might be subject to drift, latency and jitter. A curve mapping logical to real time can be drawn over an event period by interpolating between t0 and t1
Definition at line 123 of file al_Time.hpp.
|
inline |
Returns time estimate between current and next event.
This returns an estimate of corresponding real-time between current event & next by linear interpolation of current event timestamp & projected next event timestamp.
Definition at line 161 of file al_Time.hpp.
| void al::DelayLockedLoop::step | ( | al_sec | realtime | ) |
Trigger this from the periodic event.
| [in] | realtime | source time that we are trying to smoothly follow |