sipxmedialib  Version 3.3
MpMMTimerWnt.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007-2009 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007-2009 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 // Author: Keith Kyzivat <kkyzivat AT SIPez DOT com>
12 
13 #ifndef _MpMMTimerWnt_h_
14 #define _MpMMTimerWnt_h_
15 
16 // SYSTEM INCLUDES
17 #define WIN32_LEAN_AND_MEAN
18 #include <windows.h>
19 #include <MMSystem.h>
20 
21 // APPLICATION INCLUDES
22 #include "mp/MpMMTimer.h"
23 #include "os/OsMutex.h"
24 
36 class MpMMTimerWnt : public MpMMTimer
37 {
38 /* //////////////////////////////// PUBLIC //////////////////////////////// */
39 public:
40 
41  static const char * const TYPE;
42 
43 /* =============================== CREATORS =============================== */
45 
46 
48 
49  virtual ~MpMMTimerWnt();
50 
52 
53 /* ============================= MANIPULATORS ============================= */
55 
56 
58  OsStatus setNotification(OsNotification* notification);
59 
61  OsStatus run(unsigned usecPeriodic);
62 
64  OsStatus stop();
65 
67  OsStatus waitForNextTick();
68 
70 
71 /* ============================== ACCESSORS =============================== */
73 
74 
76  OsStatus getResolution(unsigned& resolution);
77 
79  OsStatus getPeriodRange(unsigned* pMinUSecs, unsigned* pMaxUSecs = NULL);
80 
82 
83 /* =============================== INQUIRY ================================ */
85 
86 
87 
89 
90 /* ////////////////////////////// PROTECTED /////////////////////////////// */
91 protected:
94  unsigned mPeriodMSec;
95  unsigned mResolution;
96  HANDLE mEventHandle;
97  OsNotification* mpNotification;
98  MMRESULT mTimerId;
99 
101  static void CALLBACK timeProcCallback(UINT uID, UINT uMsg, DWORD_PTR dwUser,
102  DWORD_PTR dw1, DWORD_PTR dw2);
103 
104 /* /////////////////////////////// PRIVATE //////////////////////////////// */
105 private:
106 
107 };
108 
109 /* ============================ INLINE METHODS ============================ */
110 
111 #endif //_MpMMTimerWnt_h_
OsStatus stop()
Stop periodical firing.
Definition: MpMMTimerWnt.cpp:157
High-precision periodic timer (MultiMedia timer) base class.
Definition: MpMMTimer.h:44
Windows implementation of High-precision periodic timer (MultiMedia timer).
Definition: MpMMTimerWnt.h:36
MMTimerType
Definition: MpMMTimer.h:48
OsStatus run(unsigned usecPeriodic)
Start periodical firing.
Definition: MpMMTimerWnt.cpp:80
MMRESULT mTimerId
The ID of the MM timer we&#39;re using.
Definition: MpMMTimerWnt.h:98
OsStatus getPeriodRange(unsigned *pMinUSecs, unsigned *pMaxUSecs=NULL)
Get the range of timer periods that can be generated.
Definition: MpMMTimerWnt.cpp:237
OsStatus getResolution(unsigned &resolution)
Get resolution of timer in microseconds.
Definition: MpMMTimerWnt.cpp:232
HANDLE mEventHandle
Only valid in Linear mode, holds handle to an event.
Definition: MpMMTimerWnt.h:96
OsStatus waitForNextTick()
Definition: MpMMTimerWnt.cpp:203
BOOL mbInitialized
Whether we&#39;re fully initialized or not, or are in some failure state.
Definition: MpMMTimerWnt.h:92
OsStatus setNotification(OsNotification *notification)
Set notification for the OsNotification timer type.
Definition: MpMMTimerWnt.cpp:74
OsNotification * mpNotification
Notification object used to signal a tick of the timer.
Definition: MpMMTimerWnt.h:97
static const char *const TYPE
Definition: MpMMTimerWnt.h:41
unsigned mPeriodMSec
The current millisecond period being used. 0 when no timer.
Definition: MpMMTimerWnt.h:94
unsigned mResolution
Cached timer resolution in ms, queried for and stored at startup.
Definition: MpMMTimerWnt.h:95
virtual ~MpMMTimerWnt()
Definition: MpMMTimerWnt.cpp:63
MpMMTimerWnt(MpMMTimer::MMTimerType type)
Definition: MpMMTimerWnt.cpp:37
BOOL mbTimerStarted
Indicator of timer started or not.
Definition: MpMMTimerWnt.h:93
static void CALLBACK timeProcCallback(UINT uID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
Callback used by Windows Multimedia Timers.
Definition: MpMMTimerWnt.cpp:270