VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CVSTGUITimer Class Referencefinal

A timer class, which posts timer messages to CBaseObjects or calls a lambda function (c++11 only). More...

`#include <cvstguitimer.h>`

Inheritance diagram for CVSTGUITimer:

## Public Types
using | CallbackFunc = std::function< void(CVSTGUITimer *)>

## Public Member Functions
| CVSTGUITimer (const CallbackFunc &callback, uint32_t fireTime=100, bool doStart=true)
| CVSTGUITimer (CallbackFunc &&callback, uint32_t fireTime=100, bool doStart=true)
| CVSTGUITimer (CBaseObject *timerObject, uint32_t fireTime=100, bool doStart=false)
bool | start ()
| starts the timer More...
bool | stop ()
| stops the timer, returns whether timer was running or not More...
bool | setFireTime (uint32_t newFireTime)
| set fire time in milliseconds More...
uint32_t | getFireTime () const
| get fire time in milliseconds More...
CBaseObject * | newCopy () const override
Public Member Functions inherited from CBaseObject
| CBaseObject ()=default
| ~CBaseObject () noexcept override=default
| CBaseObject (const CBaseObject &)
CBaseObject & | operator= (const CBaseObject &)
virtual CMessageResult | notify (CBaseObject *sender, IdStringPtr message)
Public Member Functions inherited from ReferenceCounted< T >
| ReferenceCounted ()=default
virtual | ~ReferenceCounted () noexcept=default
| ReferenceCounted (const ReferenceCounted &)
ReferenceCounted & | operator= (const ReferenceCounted &)
void | forget () override
| decrease refcount and delete object if refcount == 0 More...
void | remember () override
| increase refcount More...
virtual int32_t | getNbReference () const
| get refcount More...
virtual void | forget ()=0
| decrease refcount and delete object if refcount == 0 More...
virtual void | remember ()=0
| increase refcount More...

## Static Public Attributes
static IdStringPtr | kMsgTimer = "timer fired"
| message string posted to CBaseObject's notify method More...

## Protected Member Functions
| ~CVSTGUITimer () noexcept override
void | beforeDelete () override
void | fire () override

## Protected Attributes
uint32_t | fireTime
CallbackFunc | callbackFunc
PlatformTimerPtr | platformTimer

## Detailed Description

A timer class, which posts timer messages to CBaseObjects or calls a lambda function (c++11 only).

## Member Typedef Documentation

## ◆ CallbackFunc

using CallbackFunc = std::function<void(CVSTGUITimer*)>

## Constructor & Destructor Documentation

## ◆ CVSTGUITimer() [1/3]

CVSTGUITimer | ( | const CallbackFunc & | callback,
|  | uint32_t | fireTime = `100`,
|  | bool | doStart = `true`
| ) |  |

## ◆ CVSTGUITimer() [2/3]

CVSTGUITimer | ( | CallbackFunc && | callback,
|  | uint32_t | fireTime = `100`,
|  | bool | doStart = `true`
| ) |  |

## ◆ CVSTGUITimer() [3/3]

CVSTGUITimer | ( | CBaseObject * | timerObject,
|  | uint32_t | fireTime = `100`,
|  | bool | doStart = `false`
| ) |  |

## ◆ ~CVSTGUITimer()

~CVSTGUITimer | ( |  | ) |
| override protected default noexcept

## Member Function Documentation

## ◆ beforeDelete()

void beforeDelete | ( |  | ) |
| override protected virtual

Reimplemented from ReferenceCounted< T >.

## ◆ fire()

void fire | ( |  | ) |
| override protected

## ◆ getFireTime()

uint32_t getFireTime | ( |  | ) | const
| inline

get fire time in milliseconds

## ◆ newCopy()

CBaseObject * newCopy | ( |  | ) | const
| inline override

## ◆ setFireTime()

bool setFireTime | ( | uint32_t | newFireTime | ) |

set fire time in milliseconds

## ◆ start()

bool start | ( |  | ) |

starts the timer

## ◆ stop()

bool stop | ( |  | ) |

stops the timer, returns whether timer was running or not

## Member Data Documentation

## ◆ callbackFunc

CallbackFunc callbackFunc
| protected

## ◆ fireTime

uint32_t fireTime
| protected

## ◆ kMsgTimer

IdStringPtr kMsgTimer = "timer fired"
| static

message string posted to CBaseObject's notify method

## ◆ platformTimer

PlatformTimerPtr platformTimer
| protected

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

- cvstguitimer.h
- cvstguitimer.cpp