Added LGPL standard comment, and copyright notices where necessary.
[wine] / dlls / quartz / sysclock.h
1 /*
2  * Copyright (C) Hidenori TAKESHIMA
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef WINE_DSHOW_SYSCLOCK_H
20 #define WINE_DSHOW_SYSCLOCK_H
21
22 /*
23                 implements CLSID_SystemClock.
24
25         - At least, the following interfaces should be implemented:
26
27         IUnknown
28                 + IReferenceClock
29
30 */
31
32 #include "iunk.h"
33
34 typedef struct SC_IReferenceClockImpl
35 {
36         ICOM_VFIELD(IReferenceClock);
37 } SC_IReferenceClockImpl;
38
39
40 /* implementation limit */
41 #define WINE_QUARTZ_SYSCLOCK_TIMER_MAX  64
42
43 typedef struct QUARTZ_TimerEntry
44 {
45         DWORD                   dwAdvCookie;
46         BOOL                    fPeriodic;
47         HANDLE                  hEvent;
48         REFERENCE_TIME  rtStart;
49         REFERENCE_TIME  rtInterval;
50 } QUARTZ_TimerEntry;
51
52 typedef struct CSystemClock
53 {
54         QUARTZ_IUnkImpl unk;
55         SC_IReferenceClockImpl  refclk;
56
57         /* IReferenceClock fields. */
58         CRITICAL_SECTION        m_csClock;
59         DWORD   m_dwTimeLast;
60         REFERENCE_TIME  m_rtLast;
61         HANDLE  m_hThreadTimer;
62         HANDLE  m_hEventInit;
63         DWORD   m_idThreadTimer;
64
65         DWORD                   m_dwAdvCookieNext;
66         QUARTZ_TimerEntry       m_timerEntries[WINE_QUARTZ_SYSCLOCK_TIMER_MAX];
67 } CSystemClock;
68
69 #define CSystemClock_THIS(iface,member)         CSystemClock*   This = ((CSystemClock*)(((char*)iface)-offsetof(CSystemClock,member)))
70
71 HRESULT QUARTZ_CreateSystemClock(IUnknown* punkOuter,void** ppobj);
72
73 HRESULT CSystemClock_InitIReferenceClock( CSystemClock* psc );
74 void CSystemClock_UninitIReferenceClock( CSystemClock* psc );
75
76
77 #endif  /* WINE_DSHOW_SYSCLOCK_H */