All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
UpdateMerger Class Reference

Public Member Functions

 UpdateMerger ()
 
void limitFromBlockSizeToFrameRate (double sampleRate, int blockSize) noexcept
 
void setManualCountLimit (int skipAmount)
 
bool shouldUpdate () noexcept
 
bool shouldUpdate (int stepsToSkip)
 

Detailed Description

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

UpdateMerger ( )
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.