forked from mapsme/omim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo_timer.hpp
57 lines (43 loc) · 1.03 KB
/
video_timer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "std/function.hpp"
/// Timer, synchronized to Vertical Sync
class VideoTimer
{
public:
typedef function<void()> TFrameFn;
enum EState
{
EStopped,
EPaused,
ERunning
};
protected:
TFrameFn m_frameFn;
EState m_state;
public:
VideoTimer(TFrameFn fn);
virtual ~VideoTimer();
TFrameFn frameFn() const;
void setFrameFn(TFrameFn fn);
EState state() const;
virtual void resume() = 0;
virtual void pause() = 0;
virtual void start() = 0;
virtual void stop() = 0;
};
class EmptyVideoTimer : public VideoTimer
{
typedef VideoTimer base_t;
public:
EmptyVideoTimer();
~EmptyVideoTimer();
void start();
void resume();
void pause();
void stop();
void perform();
};
extern "C" VideoTimer * CreateIOSVideoTimer(VideoTimer::TFrameFn frameFn);
extern "C" VideoTimer * CreateAppleVideoTimer(VideoTimer::TFrameFn frameFn);
extern "C" VideoTimer * CreateWin32VideoTimer(VideoTimer::TFrameFn frameFn);
extern "C" VideoTimer * CreatePThreadVideoTimer(VideoTimer::TFrameFn frameFn);