MythTV  master
mythtimer.h
Go to the documentation of this file.
1 #ifndef MYTHTIMER_H_
2 #define MYTHTIMER_H_
3 
4 #include <cinttypes>
5 #include <QElapsedTimer>
6 #include "mythbaseexp.h"
7 
14 {
15  public:
16  enum StartState {
19  };
20 
21  explicit MythTimer(StartState state = kStartInactive);
22 
23  void start(void);
24  int restart(void);
25  void stop(void);
26 
27  void addMSecs(int ms);
28 
29  int elapsed(void);
30  int64_t nsecsElapsed(void) const;
31  bool isRunning(void) const;
32 
33  private:
34  QElapsedTimer m_timer;
35  int m_offset {0};
36 };
37 
38 #endif
MythTimer::m_timer
QElapsedTimer m_timer
Definition: mythtimer.h:34
MythTimer::kStartInactive
@ kStartInactive
Definition: mythtimer.h:18
MythTimer
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:14
mythbaseexp.h
MythTimer::StartState
StartState
Definition: mythtimer.h:16
MBASE_PUBLIC
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
isRunning
static bool isRunning(const char *program)
Returns true if a program containing the specified string is running on this machine.
Definition: mythtv/programs/mythshutdown/main.cpp:203
MythTimer::kStartRunning
@ kStartRunning
Definition: mythtimer.h:17