Added LGPL standard comment, and copyright notices where necessary.
[wine] / dlls / quartz / impos.c
1 /*
2  * Implementation of IMediaPosition for FilterGraph.
3  *
4  * FIXME - stub.
5  *
6  * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include "config.h"
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "winuser.h"
29 #include "winerror.h"
30 #include "strmif.h"
31 #include "control.h"
32 #include "uuids.h"
33
34 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
36
37 #include "quartz_private.h"
38 #include "fgraph.h"
39
40
41 static HRESULT WINAPI
42 IMediaPosition_fnQueryInterface(IMediaPosition* iface,REFIID riid,void** ppobj)
43 {
44         CFilterGraph_THIS(iface,mediaposition);
45
46         TRACE("(%p)->()\n",This);
47
48         return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
49 }
50
51 static ULONG WINAPI
52 IMediaPosition_fnAddRef(IMediaPosition* iface)
53 {
54         CFilterGraph_THIS(iface,mediaposition);
55
56         TRACE("(%p)->()\n",This);
57
58         return IUnknown_AddRef(This->unk.punkControl);
59 }
60
61 static ULONG WINAPI
62 IMediaPosition_fnRelease(IMediaPosition* iface)
63 {
64         CFilterGraph_THIS(iface,mediaposition);
65
66         TRACE("(%p)->()\n",This);
67
68         return IUnknown_Release(This->unk.punkControl);
69 }
70
71 static HRESULT WINAPI
72 IMediaPosition_fnGetTypeInfoCount(IMediaPosition* iface,UINT* pcTypeInfo)
73 {
74         CFilterGraph_THIS(iface,mediaposition);
75
76         TRACE("(%p)->()\n",This);
77
78         return IDispatch_GetTypeInfoCount(
79                 CFilterGraph_IDispatch(This),pcTypeInfo);
80 }
81
82 static HRESULT WINAPI
83 IMediaPosition_fnGetTypeInfo(IMediaPosition* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
84 {
85         CFilterGraph_THIS(iface,mediaposition);
86
87         TRACE("(%p)->()\n",This);
88
89         return IDispatch_GetTypeInfo(
90                 CFilterGraph_IDispatch(This),iTypeInfo,lcid,ppobj);
91 }
92
93 static HRESULT WINAPI
94 IMediaPosition_fnGetIDsOfNames(IMediaPosition* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
95 {
96         CFilterGraph_THIS(iface,mediaposition);
97
98         TRACE("(%p)->()\n",This);
99
100         return IDispatch_GetIDsOfNames(
101                 CFilterGraph_IDispatch(This),riid,ppwszName,cNames,lcid,pDispId);
102 }
103
104 static HRESULT WINAPI
105 IMediaPosition_fnInvoke(IMediaPosition* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
106 {
107         CFilterGraph_THIS(iface,mediaposition);
108
109         TRACE("(%p)->()\n",This);
110
111         return IDispatch_Invoke(
112                 CFilterGraph_IDispatch(This),
113                 DispId,riid,lcid,wFlags,pDispParams,pVarRes,pExcepInfo,puArgErr);
114 }
115
116
117 static HRESULT WINAPI
118 IMediaPosition_fnget_Duration(IMediaPosition* iface,REFTIME* prefTime)
119 {
120         CFilterGraph_THIS(iface,mediaposition);
121
122         FIXME("(%p)->() stub!\n",This);
123
124         return E_NOTIMPL;
125 }
126
127 static HRESULT WINAPI
128 IMediaPosition_fnput_CurrentPosition(IMediaPosition* iface,REFTIME refTime)
129 {
130         CFilterGraph_THIS(iface,mediaposition);
131
132         FIXME("(%p)->() stub!\n",This);
133
134         return E_NOTIMPL;
135 }
136
137 static HRESULT WINAPI
138 IMediaPosition_fnget_CurrentPosition(IMediaPosition* iface,REFTIME* prefTime)
139 {
140         CFilterGraph_THIS(iface,mediaposition);
141
142         FIXME("(%p)->() stub!\n",This);
143
144         return E_NOTIMPL;
145 }
146
147 static HRESULT WINAPI
148 IMediaPosition_fnget_StopTime(IMediaPosition* iface,REFTIME* prefTime)
149 {
150         CFilterGraph_THIS(iface,mediaposition);
151
152         FIXME("(%p)->() stub!\n",This);
153
154         return E_NOTIMPL;
155 }
156
157 static HRESULT WINAPI
158 IMediaPosition_fnput_StopTime(IMediaPosition* iface,REFTIME refTime)
159 {
160         CFilterGraph_THIS(iface,mediaposition);
161
162         FIXME("(%p)->() stub!\n",This);
163
164         return E_NOTIMPL;
165 }
166
167 static HRESULT WINAPI
168 IMediaPosition_fnget_PrerollTime(IMediaPosition* iface,REFTIME* prefTime)
169 {
170         CFilterGraph_THIS(iface,mediaposition);
171
172         FIXME("(%p)->() stub!\n",This);
173
174         return E_NOTIMPL;
175 }
176
177 static HRESULT WINAPI
178 IMediaPosition_fnput_PrerollTime(IMediaPosition* iface,REFTIME refTime)
179 {
180         CFilterGraph_THIS(iface,mediaposition);
181
182         FIXME("(%p)->() stub!\n",This);
183
184         return E_NOTIMPL;
185 }
186
187 static HRESULT WINAPI
188 IMediaPosition_fnput_Rate(IMediaPosition* iface,double dblRate)
189 {
190         CFilterGraph_THIS(iface,mediaposition);
191
192         FIXME("(%p)->() stub!\n",This);
193
194         return E_NOTIMPL;
195 }
196
197 static HRESULT WINAPI
198 IMediaPosition_fnget_Rate(IMediaPosition* iface,double* pdblRate)
199 {
200         CFilterGraph_THIS(iface,mediaposition);
201
202         FIXME("(%p)->() stub!\n",This);
203
204         return E_NOTIMPL;
205 }
206
207 static HRESULT WINAPI
208 IMediaPosition_fnCanSeekForward(IMediaPosition* iface,LONG* pCanSeek)
209 {
210         CFilterGraph_THIS(iface,mediaposition);
211
212         FIXME("(%p)->() stub!\n",This);
213
214         return E_NOTIMPL;
215 }
216
217 static HRESULT WINAPI
218 IMediaPosition_fnCanSeekBackward(IMediaPosition* iface,LONG* pCanSeek)
219 {
220         CFilterGraph_THIS(iface,mediaposition);
221
222         FIXME("(%p)->() stub!\n",This);
223
224         return E_NOTIMPL;
225 }
226
227
228 static ICOM_VTABLE(IMediaPosition) imediaposition =
229 {
230         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
231         /* IUnknown fields */
232         IMediaPosition_fnQueryInterface,
233         IMediaPosition_fnAddRef,
234         IMediaPosition_fnRelease,
235         /* IDispatch fields */
236         IMediaPosition_fnGetTypeInfoCount,
237         IMediaPosition_fnGetTypeInfo,
238         IMediaPosition_fnGetIDsOfNames,
239         IMediaPosition_fnInvoke,
240         /* IMediaPosition fields */
241         IMediaPosition_fnget_Duration,
242         IMediaPosition_fnput_CurrentPosition,
243         IMediaPosition_fnget_CurrentPosition,
244         IMediaPosition_fnget_StopTime,
245         IMediaPosition_fnput_StopTime,
246         IMediaPosition_fnget_PrerollTime,
247         IMediaPosition_fnput_PrerollTime,
248         IMediaPosition_fnput_Rate,
249         IMediaPosition_fnget_Rate,
250         IMediaPosition_fnCanSeekForward,
251         IMediaPosition_fnCanSeekBackward,
252 };
253
254
255 HRESULT CFilterGraph_InitIMediaPosition( CFilterGraph* pfg )
256 {
257         TRACE("(%p)\n",pfg);
258         ICOM_VTBL(&pfg->mediaposition) = &imediaposition;
259
260         return NOERROR;
261 }
262
263 void CFilterGraph_UninitIMediaPosition( CFilterGraph* pfg )
264 {
265         TRACE("(%p)\n",pfg);
266 }