SynthLab SDK
SynthLab::Timer Class Reference

Ultra compact timer object that is used for many different functionalities. More...

#include <synthbase.h>

Public Member Functions

void resetTimer ()
 reset the counter More...
 
void setExpireSamples (uint32_t _targetValueInSamples)
 set target value More...
 
void setExpireMilliSec (double timeMSec, double sampleRate)
 set target value
 
uint32_t getExpireSamples ()
 
bool timerExpired ()
 check if we hit target More...
 
void advanceTimer (uint32_t ticks=1)
 advance by 1 More...
 
uint32_t getTick ()
 tick count
 

Protected Attributes

uint32_t counter = 0
 the timer counter
 
uint32_t targetValueInSamples = 0
 curent target galue
 

Detailed Description

Ultra compact timer object that is used for many different functionalities.

  • Set the timer to expire after some number of milliseconds OR some number of sample intervals
  • functions to advance the timer and the timer tick count
  • use timerExpired( ) to query the timer's expiration state: true = expired
Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included and described in further detail in Designing Software Synthesizer Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2021 / 04 / 26

Member Function Documentation

◆ advanceTimer()

void SynthLab::Timer::advanceTimer ( uint32_t  ticks = 1)
inline

advance by 1

Tick count functions

◆ getExpireSamples()

uint32_t SynthLab::Timer::getExpireSamples ( )
inline

get the expiration time in samples

◆ resetTimer()

void SynthLab::Timer::resetTimer ( )
inline

reset the counter

Initialize

◆ setExpireSamples()

void SynthLab::Timer::setExpireSamples ( uint32_t  _targetValueInSamples)
inline

set target value

Set the expiration time for the counter

◆ timerExpired()

bool SynthLab::Timer::timerExpired ( )
inline

check if we hit target

query if timer has expired (elapsed)


The documentation for this class was generated from the following file: