The purpose of this class is to deal with timing based on the sample rate and do the proper conversions.
More...
#include <SampleRateBasedClock.h>
|
class | RateLimiter |
| Keeps track of the time in number of samples processed vs sample rate. More...
|
|
The purpose of this class is to deal with timing based on the sample rate and do the proper conversions.
◆ SampleRateBasedClock()
◆ getNextBarSampleCount()
TSamples getNextBarSampleCount |
( |
TSamples |
iCurrentSampleCount, |
|
|
double |
iTempo, |
|
|
int32 |
iTimeSigNumerator = 4 , |
|
|
int32 |
iTimeSigDenominator = 4 |
|
) |
| const |
|
inline |
Given the current sample count (which can be extracted from ProcessData::processContext->projectTimeSamples
) returns the number of samples for the next bar boundary.
Example: with a tempo of 120 (4/4), and a sample rate of 48000, each bar is 96000 samples.
getNextBarSampleCount(52123, 120) == 96000; // 1 bar
getNextBarSampleCount(600000, 120) == 672000; // 7 bars
getNextBarSampleCount(672000, 120) == 672000; // 7 bars
getNextBarSampleCount(672001, 120) == 768000; // 8 bars
◆ getRateLimiter()
◆ getSampleCountFor()
uint32 getSampleCountFor |
( |
uint32 |
iMillis | ) |
const |
|
inline |
◆ getSampleCountFor1Bar()
uint32 getSampleCountFor1Bar |
( |
double |
iTempo, |
|
|
int32 |
iTimeSigNumerator = 4 , |
|
|
int32 |
iTimeSigDenominator = 4 |
|
) |
| const |
|
inline |
◆ getSampleRate()
SampleRate getSampleRate |
( |
| ) |
const |
|
inline |
◆ getTimeForSampleCount()
uint32 getTimeForSampleCount |
( |
uint32 |
iSampleCount | ) |
const |
|
inline |
◆ setSampleRate()
void setSampleRate |
( |
SampleRate |
iSampleRate | ) |
|
|
inline |
◆ fSampleRate
The documentation for this class was generated from the following file: