diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2013-09-10 16:41:48 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:00:59 +0300 |
commit | 8a76d786cd4d7bd62103e9ddcfd276f15ce59dbd (patch) | |
tree | 1e9e4496c33601c74a377801c1abab4fc04821a2 /platform/video_timer.cpp | |
parent | 0eca7c07eb095dd978112c522489817d3c5cd484 (diff) |
move EmptyVideoTimer to platform/video_timer.
Diffstat (limited to 'platform/video_timer.cpp')
-rw-r--r-- | platform/video_timer.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/platform/video_timer.cpp b/platform/video_timer.cpp index 8f731f58a3..8a2fab5c9d 100644 --- a/platform/video_timer.cpp +++ b/platform/video_timer.cpp @@ -1,5 +1,7 @@ #include "video_timer.hpp" +#include "../std/bind.hpp" + VideoTimer::VideoTimer(TFrameFn fn) : m_frameFn(fn), m_state(EStopped) {} @@ -20,3 +22,49 @@ void VideoTimer::setFrameFn(TFrameFn fn) { m_frameFn = fn; } + +namespace +{ + void empty() {} +} + +EmptyVideoTimer::EmptyVideoTimer() + : base_t(bind(&empty)) +{ +} + +EmptyVideoTimer::~EmptyVideoTimer() +{ + stop(); +} + +void EmptyVideoTimer::start() +{ + if (m_state == EStopped) + m_state = ERunning; +} + +void EmptyVideoTimer::resume() +{ + if (m_state == EPaused) + { + m_state = EStopped; + start(); + } +} + +void EmptyVideoTimer::pause() +{ + stop(); + m_state = EPaused; +} + +void EmptyVideoTimer::stop() +{ + if (m_state == ERunning) + m_state = EStopped; +} + +void EmptyVideoTimer::perform() +{ +} |