diff options
author | Robin Gareus <robin@gareus.org> | 2015-10-30 15:50:12 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-10-30 15:55:26 +0100 |
commit | 7abfe85498080f202b19e02744df1e5352a06ce0 (patch) | |
tree | 27335a39a091be35f261da862473c00e24f7c3df /libs/pbd/timer.cc | |
parent | 3e634396378f14b337d7f10d01968466fb3f0e94 (diff) |
add API to suspend timers signal emission.
Diffstat (limited to 'libs/pbd/timer.cc')
-rw-r--r-- | libs/pbd/timer.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/pbd/timer.cc b/libs/pbd/timer.cc index 662c7ddc38..8312c53d14 100644 --- a/libs/pbd/timer.cc +++ b/libs/pbd/timer.cc @@ -26,6 +26,7 @@ Timer::Timer (unsigned int interval, : m_timeout_source(NULL) , m_timeout_interval(interval) , m_main_context(main_context) + , m_suspended(false) { } @@ -121,7 +122,9 @@ StandardTimer::on_elapsed() return false; } - m_signal(); + if (!suspended ()) { + m_signal(); + } return true; } @@ -149,7 +152,9 @@ BlinkTimer::on_elapsed() return false; } - m_blink_signal(blink_on = !blink_on); + if (!suspended ()) { + m_blink_signal(blink_on = !blink_on); + } return true; } |