Ardour  9.0-pre0-582-g084a23a80d
PBD::Timer Class Referenceabstract

#include <timer.h>

Inheritance diagram for PBD::Timer:
[legend]

Public Member Functions

 Timer (unsigned int interval, const Glib::RefPtr< Glib::MainContext > &main_context)
 
unsigned int get_interval () const
 
void set_interval (unsigned int new_interval)
 
virtual unsigned int connection_count () const =0
 
void suspend ()
 
void resume ()
 

Protected Member Functions

virtual ~Timer ()
 
void start ()
 
void stop ()
 
virtual bool on_elapsed ()=0
 
bool suspended () const
 

Private Member Functions

 Timer (const Timer &)
 
Timeroperator= (const Timer &)
 
bool timeout_handler ()
 

Static Private Member Functions

static gboolean _timeout_handler (void *data)
 

Private Attributes

GSource * m_timeout_source
 
unsigned int m_timeout_interval
 
const Glib::RefPtr< Glib::MainContext > m_main_context
 
bool m_suspended
 

Detailed Description

The Timer class is a wrapper around Glib TimeoutSources The Timer will start automatically when the first connection is made and stop when the last callback is disconnected.

Definition at line 35 of file pbd/pbd/timer.h.

Constructor & Destructor Documentation

◆ Timer() [1/2]

PBD::Timer::Timer ( unsigned int  interval,
const Glib::RefPtr< Glib::MainContext > &  main_context 
)

◆ ~Timer()

virtual PBD::Timer::~Timer ( )
inlineprotectedvirtual

Definition at line 53 of file pbd/pbd/timer.h.

◆ Timer() [2/2]

PBD::Timer::Timer ( const Timer )
private

Member Function Documentation

◆ _timeout_handler()

static gboolean PBD::Timer::_timeout_handler ( void *  data)
staticprivate

◆ connection_count()

virtual unsigned int PBD::Timer::connection_count ( ) const
pure virtual

Implemented in PBD::BlinkTimer, and PBD::StandardTimer.

◆ get_interval()

unsigned int PBD::Timer::get_interval ( ) const

◆ on_elapsed()

virtual bool PBD::Timer::on_elapsed ( )
protectedpure virtual

Implemented in PBD::BlinkTimer, and PBD::StandardTimer.

◆ operator=()

Timer& PBD::Timer::operator= ( const Timer )
private

◆ resume()

void PBD::Timer::resume ( )
inline

Definition at line 49 of file pbd/pbd/timer.h.

◆ set_interval()

void PBD::Timer::set_interval ( unsigned int  new_interval)

◆ start()

void PBD::Timer::start ( )
protected

◆ stop()

void PBD::Timer::stop ( )
protected

◆ suspend()

void PBD::Timer::suspend ( )
inline

Definition at line 48 of file pbd/pbd/timer.h.

◆ suspended()

bool PBD::Timer::suspended ( ) const
inlineprotected

Definition at line 61 of file pbd/pbd/timer.h.

◆ timeout_handler()

bool PBD::Timer::timeout_handler ( )
private

Member Data Documentation

◆ m_main_context

const Glib::RefPtr<Glib::MainContext> PBD::Timer::m_main_context
private

Definition at line 78 of file pbd/pbd/timer.h.

◆ m_suspended

bool PBD::Timer::m_suspended
private

Definition at line 80 of file pbd/pbd/timer.h.

◆ m_timeout_interval

unsigned int PBD::Timer::m_timeout_interval
private

Definition at line 76 of file pbd/pbd/timer.h.

◆ m_timeout_source

GSource* PBD::Timer::m_timeout_source
private

Definition at line 74 of file pbd/pbd/timer.h.


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