Public Member Functions | List of all members
ExecutionLimiter< Locktype > Class Template Reference

A counter which can be used to limit the frequency for eg. More...

Public Member Functions

 ExecutionLimiter ()
 creates a new UpdateMerger and registeres the given listener. More...
 
void limitFromBlockSizeToFrameRate (double sampleRate, int blockSize) noexcept
 A handy method to limit updates from buffer block to frame rate level. More...
 
void setManualCountLimit (int skipAmount)
 sets a manual skip number. More...
 
bool shouldUpdate () noexcept
 Call this method whenever something changes and the UpdateMerger class will check if a update is necessary. More...
 
bool shouldUpdate (int stepsToSkip)
 Call this method whenever something changes and the UpdateMerger class will check if a update is necessary. More...
 

Detailed Description

template<class Locktype = SpinLock>
class hise::ExecutionLimiter< Locktype >

A counter which can be used to limit the frequency for eg.

GUI updates

If set up correctly using either limitFromSampleRateToFrameRate() or limitFromBlockSizeToFrameRate(), it has an internal counter that is incremented each time update() is called and returns true, if a new change message is due.

Constructor & Destructor Documentation

ExecutionLimiter ( )
inline

creates a new UpdateMerger and registeres the given listener.

Member Function Documentation

void limitFromBlockSizeToFrameRate ( double  sampleRate,
int  blockSize 
)
inlinenoexcept

A handy method to limit updates from buffer block to frame rate level.

Use this if you intend to call update() every buffer block.

void setManualCountLimit ( int  skipAmount)
inline

sets a manual skip number.

Use this if you don't need the fancy block -> frame conversion.

bool shouldUpdate ( )
inlinenoexcept

Call this method whenever something changes and the UpdateMerger class will check if a update is necessary.

Returns
true if a update should be made or false if not.
bool shouldUpdate ( int  stepsToSkip)
inline

Call this method whenever something changes and the UpdateMerger class will check if a update is necessary.

You can pass a step amount if you want to merge some steps. If the count limit is reached, the overshoot will be retained.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.