|
Gin
|
Timer that calls a std::function callback instead of requiring virtual override. More...
#include <gin_asyncutilities.h>
Inherits juce::Timer.
Public Member Functions | |
| LambdaTimer (std::function< void()> func=nullptr) | |
Public Attributes | |
| std::function< void()> | onTimer |
Timer that calls a std::function callback instead of requiring virtual override.
LambdaTimer provides a more convenient alternative to juce::Timer by accepting a lambda or std::function for the timer callback. This eliminates the need to create a subclass or override timerCallback() for simple timer operations.
Key Features:
The onTimer function is called at the specified interval. All juce::Timer methods are available (startTimer, stopTimer, isTimerRunning, etc.).
Usage:
| std::function<void()> LambdaTimer::onTimer |