Jamba C++ API
5.1.1
|
Keeps track of the time in number of samples processed vs sample rate. More...
#include <SampleRateBasedClock.h>
Public Member Functions | |
RateLimiter (uint32 iRateLimitInSamples=0) | |
bool | shouldUpdate (uint32 numSamples) |
Calls this method when a new batch of samples is processed and returns true if the limit (in samples) is achieved. More... | |
Private Attributes | |
uint32 | fRateLimitInSamples |
uint32 | fSampleCount |
Keeps track of the time in number of samples processed vs sample rate.
Typical usage is:
// in setup rateLimiter = clock.getRateLimiter(250); // 4 times a second
// in process (every frame) if(rateLimiter.shouldUpdate(processData.numSamples)) { // execute rate limited code (ex: update UI) }
|
inlineexplicit |
|
inline |
Calls this method when a new batch of samples is processed and returns true if the limit (in samples) is achieved.
|
private |
|
private |