]> git.saurik.com Git - wxWidgets.git/blob - src/msw/mediactrl_am.cpp
Test commit
[wxWidgets.git] / src / msw / mediactrl_am.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/mediactrl_am.cpp
3 // Purpose: ActiveMovie/WMP6/PocketPC 2000 Media Backend for Windows
4 // Author: Ryan Norton <wxprojects@comcast.net>
5 // Modified by:
6 // Created: 01/29/05
7 // RCS-ID: $Id$
8 // Copyright: (c) Ryan Norton
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // TODO: Actually test the CE IWMP....
13 // TODO: Actually test HTTP proxies...
14
15 //-----------------Introduction----------------------------------------------
16 // This is the media backend for Windows Media Player 6 and ActiveMovie,
17 // as well as PocketPC 2000, Windows Media Player Mobile 7 and 8.
18 //
19 // We use a combination of the WMP 6 IMediaPlayer interface as well as the
20 // ActiveMovie interface IActiveMovie that even exists on Windows 3. For
21 // mobile systems we switch to IWMP for WMP mobile 7 and 8 and possibly
22 // earlier. We just use ifdefs for differentiating between IWMP and
23 // IActiveMovie/IMediaPlayer as the IWMP and IMediaPlayer are virtually
24 // identical with a few minor exceptions.
25 //
26 // For supporting HTTP proxies and such we query the media player
27 // interface (IActiveMovie/IWMP) for the INSPlay (NetShow) interface.
28 //
29 // The IMediaPlayer/IActiveMovie/IWMP are rather clean and straightforward
30 // interfaces that are fairly simplistic.
31 //
32 // Docs for IMediaPlayer are at
33 // http://msdn.microsoft.com/library/en-us/wmp6sdk/htm/microsoftwindowsmediaplayercontrolversion64sdk.asp
34 //
35 // Docs for IWMP are at
36 // http://msdn.microsoft.com/library/en-us/wcewmp/html/_wcesdk_asx_wmp_control_reference.asp
37
38 //===========================================================================
39 // DECLARATIONS
40 //===========================================================================
41
42 //---------------------------------------------------------------------------
43 // Pre-compiled header stuff
44 //---------------------------------------------------------------------------
45
46 // For compilers that support precompilation, includes "wx.h".
47 #include "wx/wxprec.h"
48
49 #ifdef __BORLANDC__
50 #pragma hdrstop
51 #endif
52
53 // disable "cast truncates constant value" for VARIANT_BOOL values
54 // passed as parameters in VC6
55 #ifdef _MSC_VER
56 #pragma warning (disable:4310)
57 #endif
58
59 //---------------------------------------------------------------------------
60 // MediaCtrl include
61 //---------------------------------------------------------------------------
62 #include "wx/mediactrl.h"
63
64 //---------------------------------------------------------------------------
65 // Compilation guard
66 //---------------------------------------------------------------------------
67 #if wxUSE_MEDIACTRL
68
69 //---------------------------------------------------------------------------
70 // WX Includes
71 //---------------------------------------------------------------------------
72 #include "wx/log.h" // wxLogDebug
73 #include "wx/math.h" // log10 & pow
74 #include "wx/msw/private.h" // user info and wndproc setting/getting
75 #include "wx/dcclient.h"
76 #include "wx/timer.h"
77 #include "wx/dynlib.h"
78 #include "wx/stopwatch.h"
79
80 //---------------------------------------------------------------------------
81 // wxActiveXContainer - includes all the COM-specific stuff we need
82 //---------------------------------------------------------------------------
83 #include "wx/msw/ole/activex.h"
84
85 // It may sound odd, but you can actually compile this with
86 // __WXWINCE__ enabled on non-CE windows
87 //#define __WXWINCE__
88
89 //---------------------------------------------------------------------------
90 // IIDS - used by CoCreateInstance and IUnknown::QueryInterface
91 //
92 // [idl name] [idl decription]
93 // amcompat.idl Microsoft Active Movie Control (Ver 2.0)
94 // nscompat.idl Microsoft NetShow Player (Ver 1.0)
95 // msdxm.idl Windows Media Player (Ver 1.0)
96 // quartz.idl
97 //
98 // First, when I say I "from XXX.idl", I mean I go into the COM Browser
99 // ($Microsoft Visual Studio$/Common/Tools/OLEVIEW.EXE), open
100 // "type libraries", open a specific type library (for quartz for example its
101 // "ActiveMovie control type library (V1.0)"), save it as an .idl, compile the
102 // idl using the midl compiler that comes with visual studio
103 // ($Microsoft Visual Studio$/VC98/bin/midl.exe on VC6) with the /h argument
104 // to make it generate stubs (a .h & .c file), then clean up the generated
105 // interfaces I want with the STDMETHOD wrappers and then put them into
106 // mediactrl.cpp.
107 //
108 // According to the MSDN docs, IMediaPlayer requires Windows 98 SE
109 // or greater. NetShow is available on Windows 3.1 and I'm guessing
110 // IActiveMovie is too. IMediaPlayer is essentially the Windows Media
111 // Player 6.4 SDK.
112 //
113 // IWMP is from PlayerOCX.idl on PocketPC 2000, which uses CLSID_MediaPlayer
114 // as well as the main windows line.
115 //
116 // Some of these are not used but are kept here for future reference anyway
117 //---------------------------------------------------------------------------
118 const IID IID_IActiveMovie = {0x05589FA2,0xC356,0x11CE,{0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A}};
119 const IID IID_IActiveMovie2 = {0xB6CD6554,0xE9CB,0x11D0,{0x82,0x1F,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
120 const IID IID_IActiveMovie3 = {0x265EC140,0xAE62,0x11D1,{0x85,0x00,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
121
122 const IID IID_INSOPlay = {0x2179C5D1,0xEBFF,0x11CF,{0xB6,0xFD,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
123 const IID IID_INSPlay = {0xE7C4BE80,0x7960,0x11D0,{0xB7,0x27,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
124 const IID IID_INSPlay1 = {0x265EC141,0xAE62,0x11D1,{0x85,0x00,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
125
126 const IID IID_IMediaPlayer = {0x22D6F311,0xB0F6,0x11D0,{0x94,0xAB,0x00,0x80,0xC7,0x4C,0x7E,0x95}};
127 const IID IID_IMediaPlayer2 = {0x20D4F5E0,0x5475,0x11D2,{0x97,0x74,0x00,0x00,0xF8,0x08,0x55,0xE6}};
128
129
130 #ifdef __WXWINCE__
131 const IID IID_IWMP = {0x136B66EC,0xF30D,0x46A8,{0x88,0xDD,0xF2,0xD0,0x55,0x16,0x3E,0x49}};
132 #endif
133
134 const CLSID CLSID_ActiveMovie = {0x05589FA1,0xC356,0x11CE,{0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A}};
135 const CLSID CLSID_MediaPlayer = {0x22D6F312,0xB0F6,0x11D0,{0x94,0xAB,0x00,0x80,0xC7,0x4C,0x7E,0x95}};
136 const CLSID CLSID_NSPlay = {0x2179C5D3,0xEBFF,0x11CF,{0xB6,0xFD,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
137
138 const IID IID_IAMOpenProgress = {0x8E1C39A1, 0xDE53, 0x11CF,{0xAA, 0x63, 0x00, 0x80, 0xC7, 0x44, 0x52, 0x8D}};
139
140 // QUARTZ
141 const CLSID CLSID_FilgraphManager = {0xE436EBB3,0x524F,0x11CE,{0x9F,0x53,0x00,0x20,0xAF,0x0B,0xA7,0x70}};
142 const IID IID_IMediaEvent = {0x56A868B6,0x0AD4,0x11CE,{0xB0,0x3A,0x00,0x20,0xAF,0x0B,0xA7,0x70}};
143
144 //?? QUARTZ Also?
145 const CLSID CLSID_VideoMixingRenderer9 ={0x51B4ABF3, 0x748F, 0x4E3B,{0xA2, 0x76, 0xC8, 0x28, 0x33, 0x0E, 0x92, 0x6A}};
146 const IID IID_IVMRWindowlessControl9 = {0x8F537D09, 0xF85E, 0x4414,{0xB2, 0x3B, 0x50, 0x2E, 0x54, 0xC7, 0x99, 0x27}};
147 const IID IID_IFilterGraph = {0x56A8689F, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
148 const IID IID_IGraphBuilder = {0x56A868A9, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
149 const IID IID_IVMRFilterConfig9 = {0x5A804648, 0x4F66, 0x4867,{0x9C, 0x43, 0x4F, 0x5C, 0x82, 0x2C, 0xF1, 0xB8}};
150 const IID IID_IBaseFilter = {0x56A86895, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
151
152 //---------------------------------------------------------------------------
153 // QUARTZ COM INTERFACES (dumped from quartz.idl from MSVC COM Browser)
154 //---------------------------------------------------------------------------
155
156 struct IAMOpenProgress : public IUnknown
157 {
158 STDMETHOD(QueryProgress)(LONGLONG *pllTotal, LONGLONG *pllCurrent) PURE;
159 STDMETHOD(AbortOperation)(void) PURE;
160 };
161
162 struct IMediaEvent : public IDispatch
163 {
164 STDMETHOD(GetEventHandle)(LONG_PTR *) PURE;
165 STDMETHOD(GetEvent)(long *, LONG_PTR *, LONG_PTR *, long) PURE;
166 STDMETHOD(WaitForCompletion)(long, long *) PURE;
167 STDMETHOD(CancelDefaultHandling)(long) PURE;
168 STDMETHOD(RestoreDefaultHandling)(long) PURE;
169 STDMETHOD(FreeEventParams)(long, LONG_PTR, LONG_PTR) PURE;
170 };
171
172 //---------------------------------------------------------------------------
173 // ACTIVEMOVIE COM INTERFACES (dumped from amcompat.idl from MSVC COM Browser)
174 //---------------------------------------------------------------------------
175
176 enum ReadyStateConstants
177 {
178 amvUninitialized = 0,
179 amvLoading = 1,
180 amvInteractive = 3,
181 amvComplete = 4
182 };
183
184 enum StateConstants
185 {
186 amvNotLoaded = -1,
187 amvStopped = 0,
188 amvPaused = 1,
189 amvRunning = 2
190 };
191
192 enum DisplayModeConstants
193 {
194 amvTime = 0,
195 amvFrames = 1
196 };
197
198 enum WindowSizeConstants
199 {
200 amvOriginalSize = 0,
201 amvDoubleOriginalSize = 1,
202 amvOneSixteenthScreen = 2,
203 amvOneFourthScreen = 3,
204 amvOneHalfScreen = 4
205 };
206
207 enum AppearanceConstants
208 {
209 amvFlat = 0,
210 amv3D = 1
211 };
212
213 enum BorderStyleConstants
214 {
215 amvNone = 0,
216 amvFixedSingle = 1
217 };
218
219 struct IActiveMovie : public IDispatch
220 {
221 STDMETHOD(AboutBox)( void) PURE;
222 STDMETHOD(Run)( void) PURE;
223 STDMETHOD(Pause)( void) PURE;
224 STDMETHOD(Stop)( void) PURE;
225 STDMETHOD(get_ImageSourceWidth)(long __RPC_FAR *pWidth) PURE;
226 STDMETHOD(get_ImageSourceHeight)(long __RPC_FAR *pHeight) PURE;
227 STDMETHOD(get_Author)(BSTR __RPC_FAR *pbstrAuthor) PURE;
228 STDMETHOD(get_Title)(BSTR __RPC_FAR *pbstrTitle) PURE;
229 STDMETHOD(get_Copyright)(BSTR __RPC_FAR *pbstrCopyright) PURE;
230 STDMETHOD(get_Description)(BSTR __RPC_FAR *pbstrDescription) PURE;
231 STDMETHOD(get_Rating)(BSTR __RPC_FAR *pbstrRating) PURE;
232 STDMETHOD(get_FileName)(BSTR __RPC_FAR *pbstrFileName) PURE;
233 STDMETHOD(put_FileName)(BSTR pbstrFileName) PURE;
234 STDMETHOD(get_Duration)(double __RPC_FAR *pValue) PURE;
235 STDMETHOD(get_CurrentPosition)(double __RPC_FAR *pValue) PURE;
236 STDMETHOD(put_CurrentPosition)(double pValue) PURE;
237 STDMETHOD(get_PlayCount)(long __RPC_FAR *pPlayCount) PURE;
238 STDMETHOD(put_PlayCount)(long pPlayCount) PURE;
239 STDMETHOD(get_SelectionStart)(double __RPC_FAR *pValue) PURE;
240 STDMETHOD(put_SelectionStart)(double pValue) PURE;
241 STDMETHOD(get_SelectionEnd)(double __RPC_FAR *pValue) PURE;
242 STDMETHOD(put_SelectionEnd)(double pValue) PURE;
243 STDMETHOD(get_CurrentState)(StateConstants __RPC_FAR *pState) PURE;
244 STDMETHOD(get_Rate)(double __RPC_FAR *pValue) PURE;
245 STDMETHOD(put_Rate)(double pValue) PURE;
246 STDMETHOD(get_Volume)(long __RPC_FAR *pValue) PURE;
247 STDMETHOD(put_Volume)(long pValue) PURE;
248 STDMETHOD(get_Balance)(long __RPC_FAR *pValue) PURE;
249 STDMETHOD(put_Balance)(long pValue) PURE;
250 STDMETHOD(get_EnableContextMenu)(VARIANT_BOOL __RPC_FAR *pEnable) PURE;
251 STDMETHOD(put_EnableContextMenu)(VARIANT_BOOL pEnable) PURE;
252 STDMETHOD(get_ShowDisplay)(VARIANT_BOOL __RPC_FAR *Show) PURE;
253 STDMETHOD(put_ShowDisplay)(VARIANT_BOOL Show) PURE;
254 STDMETHOD(get_ShowControls)(VARIANT_BOOL __RPC_FAR *Show) PURE;
255 STDMETHOD(put_ShowControls)(VARIANT_BOOL Show) PURE;
256 STDMETHOD(get_ShowPositionControls)(VARIANT_BOOL __RPC_FAR *Show) PURE;
257 STDMETHOD(put_ShowPositionControls)(VARIANT_BOOL Show) PURE;
258 STDMETHOD(get_ShowSelectionControls)(VARIANT_BOOL __RPC_FAR *Show) PURE;
259 STDMETHOD(put_ShowSelectionControls)(VARIANT_BOOL Show) PURE;
260 STDMETHOD(get_ShowTracker)(VARIANT_BOOL __RPC_FAR *Show) PURE;
261 STDMETHOD(put_ShowTracker)(VARIANT_BOOL Show) PURE;
262 STDMETHOD(get_EnablePositionControls)(VARIANT_BOOL __RPC_FAR *Enable) PURE;
263 STDMETHOD(put_EnablePositionControls)(VARIANT_BOOL Enable) PURE;
264 STDMETHOD(get_EnableSelectionControls)(VARIANT_BOOL __RPC_FAR *Enable) PURE;
265 STDMETHOD(put_EnableSelectionControls)(VARIANT_BOOL Enable) PURE;
266 STDMETHOD(get_EnableTracker)(VARIANT_BOOL __RPC_FAR *Enable) PURE;
267 STDMETHOD(put_EnableTracker)(VARIANT_BOOL Enable) PURE;
268 STDMETHOD(get_AllowHideDisplay)(VARIANT_BOOL __RPC_FAR *Show) PURE;
269 STDMETHOD(put_AllowHideDisplay)(VARIANT_BOOL Show) PURE;
270 STDMETHOD(get_AllowHideControls)(VARIANT_BOOL __RPC_FAR *Show) PURE;
271 STDMETHOD(put_AllowHideControls)(VARIANT_BOOL Show) PURE;
272 STDMETHOD(get_DisplayMode)(DisplayModeConstants __RPC_FAR *pValue) PURE;
273 STDMETHOD(put_DisplayMode)(DisplayModeConstants pValue) PURE;
274 STDMETHOD(get_AllowChangeDisplayMode)(VARIANT_BOOL __RPC_FAR *fAllow) PURE;
275 STDMETHOD(put_AllowChangeDisplayMode)(VARIANT_BOOL fAllow) PURE;
276 STDMETHOD(get_FilterGraph)(IUnknown __RPC_FAR *__RPC_FAR *ppFilterGraph) PURE;
277 STDMETHOD(put_FilterGraph)(IUnknown __RPC_FAR *ppFilterGraph) PURE;
278 STDMETHOD(get_FilterGraphDispatch)(IDispatch __RPC_FAR *__RPC_FAR *pDispatch) PURE;
279 STDMETHOD(get_DisplayForeColor)(unsigned long __RPC_FAR *ForeColor) PURE;
280 STDMETHOD(put_DisplayForeColor)(unsigned long ForeColor) PURE;
281 STDMETHOD(get_DisplayBackColor)(unsigned long __RPC_FAR *BackColor) PURE;
282 STDMETHOD(put_DisplayBackColor)(unsigned long BackColor) PURE;
283 STDMETHOD(get_MovieWindowSize)(WindowSizeConstants __RPC_FAR *WindowSize) PURE;
284 STDMETHOD(put_MovieWindowSize)(WindowSizeConstants WindowSize) PURE;
285 STDMETHOD(get_FullScreenMode)(VARIANT_BOOL __RPC_FAR *pEnable) PURE;
286 STDMETHOD(put_FullScreenMode)(VARIANT_BOOL pEnable) PURE;
287 STDMETHOD(get_AutoStart)(VARIANT_BOOL __RPC_FAR *pEnable) PURE;
288 STDMETHOD(put_AutoStart)(VARIANT_BOOL pEnable) PURE;
289 STDMETHOD(get_AutoRewind)(VARIANT_BOOL __RPC_FAR *pEnable) PURE;
290 STDMETHOD(put_AutoRewind)(VARIANT_BOOL pEnable) PURE;
291 STDMETHOD(get_hWnd)(long __RPC_FAR *hWnd) PURE;
292 STDMETHOD(get_Appearance)(AppearanceConstants __RPC_FAR *pAppearance) PURE;
293 STDMETHOD(put_Appearance)(AppearanceConstants pAppearance) PURE;
294 STDMETHOD(get_BorderStyle)(BorderStyleConstants __RPC_FAR *pBorderStyle) PURE;
295 STDMETHOD(put_BorderStyle)(BorderStyleConstants pBorderStyle) PURE;
296 STDMETHOD(get_Enabled)(VARIANT_BOOL __RPC_FAR *pEnabled) PURE;
297 STDMETHOD(put_Enabled)(VARIANT_BOOL pEnabled) PURE;
298 STDMETHOD(get_Info)(long __RPC_FAR *ppInfo) PURE;
299 };
300
301
302
303 struct IActiveMovie2 : public IActiveMovie
304 {
305 STDMETHOD(IsSoundCardEnabled)(VARIANT_BOOL __RPC_FAR *pbSoundCard) PURE;
306 STDMETHOD(get_ReadyState)(ReadyStateConstants __RPC_FAR *pValue) PURE;
307 };
308
309 struct IActiveMovie3 : public IActiveMovie2
310 {
311 STDMETHOD(get_MediaPlayer)(IDispatch __RPC_FAR *__RPC_FAR *ppDispatch) PURE;
312 };
313
314
315 //---------------------------------------------------------------------------
316 // MEDIAPLAYER COM INTERFACES (dumped from msdxm.idl from MSVC COM Browser)
317 //---------------------------------------------------------------------------
318
319 enum MPPlayStateConstants
320 {
321 mpStopped = 0,
322 mpPaused = 1,
323 mpPlaying = 2,
324 mpWaiting = 3,
325 mpScanForward = 4,
326 mpScanReverse = 5,
327 mpClosed = 6
328 };
329
330 enum MPDisplaySizeConstants
331 {
332 mpDefaultSize = 0,
333 mpHalfSize = 1,
334 mpDoubleSize = 2,
335 mpFullScreen = 3,
336 mpFitToSize = 4,
337 mpOneSixteenthScreen = 5,
338 mpOneFourthScreen = 6,
339 mpOneHalfScreen = 7
340 };
341
342 enum MPReadyStateConstants
343 {
344 mpReadyStateUninitialized = 0,
345 mpReadyStateLoading = 1,
346 mpReadyStateInteractive = 3,
347 mpReadyStateComplete = 4
348 };
349
350 typedef unsigned long VB_OLE_COLOR;
351
352 enum MPDisplayModeConstants
353 {
354 mpTime = 0,
355 mpFrames = 1
356 };
357
358 enum MPMoreInfoType
359 {
360 mpShowURL = 0,
361 mpClipURL = 1,
362 mpBannerURL = 2
363 };
364
365 enum MPMediaInfoType
366 {
367 mpShowFilename = 0,
368 mpShowTitle = 1,
369 mpShowAuthor = 2,
370 mpShowCopyright = 3,
371 mpShowRating = 4,
372 mpShowDescription = 5,
373 mpShowLogoIcon = 6,
374 mpClipFilename = 7,
375 mpClipTitle = 8,
376 mpClipAuthor = 9,
377 mpClipCopyright = 10,
378 mpClipRating = 11,
379 mpClipDescription = 12,
380 mpClipLogoIcon = 13,
381 mpBannerImage = 14,
382 mpBannerMoreInfo = 15,
383 mpWatermark = 16
384 };
385
386 enum DVDMenuIDConstants
387 {
388 dvdMenu_Title = 2,
389 dvdMenu_Root = 3,
390 dvdMenu_Subpicture = 4,
391 dvdMenu_Audio = 5,
392 dvdMenu_Angle = 6,
393 dvdMenu_Chapter = 7
394 };
395
396 enum MPShowDialogConstants
397 {
398 mpShowDialogHelp = 0,
399 mpShowDialogStatistics = 1,
400 mpShowDialogOptions = 2,
401 mpShowDialogContextMenu = 3
402 };
403
404
405 struct IMediaPlayer : public IDispatch
406 {
407 STDMETHOD(get_CurrentPosition)(double __RPC_FAR *pCurrentPosition) PURE;
408 STDMETHOD(put_CurrentPosition)(double pCurrentPosition) PURE;
409 STDMETHOD(get_Duration)(double __RPC_FAR *pDuration) PURE;
410 STDMETHOD(get_ImageSourceWidth)(long __RPC_FAR *pWidth) PURE;
411 STDMETHOD(get_ImageSourceHeight)(long __RPC_FAR *pHeight) PURE;
412 STDMETHOD(get_MarkerCount)(long __RPC_FAR *pMarkerCount) PURE;
413 STDMETHOD(get_CanScan)(VARIANT_BOOL __RPC_FAR *pCanScan) PURE;
414 STDMETHOD(get_CanSeek)(VARIANT_BOOL __RPC_FAR *pCanSeek) PURE;
415 STDMETHOD(get_CanSeekToMarkers)(VARIANT_BOOL __RPC_FAR *pCanSeekToMarkers) PURE;
416 STDMETHOD(get_CurrentMarker)(long __RPC_FAR *pCurrentMarker) PURE;
417 STDMETHOD(put_CurrentMarker)(long pCurrentMarker) PURE;
418 STDMETHOD(get_FileName)(BSTR __RPC_FAR *pbstrFileName) PURE;
419 STDMETHOD(put_FileName)(BSTR pbstrFileName) PURE;
420 STDMETHOD(get_SourceLink)(BSTR __RPC_FAR *pbstrSourceLink) PURE;
421 STDMETHOD(get_CreationDate)(DATE __RPC_FAR *pCreationDate) PURE;
422 STDMETHOD(get_ErrorCorrection)(BSTR __RPC_FAR *pbstrErrorCorrection) PURE;
423 STDMETHOD(get_Bandwidth)(long __RPC_FAR *pBandwidth) PURE;
424 STDMETHOD(get_SourceProtocol)(long __RPC_FAR *pSourceProtocol) PURE;
425 STDMETHOD(get_ReceivedPackets)(long __RPC_FAR *pReceivedPackets) PURE;
426 STDMETHOD(get_RecoveredPackets)(long __RPC_FAR *pRecoveredPackets) PURE;
427 STDMETHOD(get_LostPackets)(long __RPC_FAR *pLostPackets) PURE;
428 STDMETHOD(get_ReceptionQuality)(long __RPC_FAR *pReceptionQuality) PURE;
429 STDMETHOD(get_BufferingCount)(long __RPC_FAR *pBufferingCount) PURE;
430 STDMETHOD(get_IsBroadcast)(VARIANT_BOOL __RPC_FAR *pIsBroadcast) PURE;
431 STDMETHOD(get_BufferingProgress)(long __RPC_FAR *pBufferingProgress) PURE;
432 STDMETHOD(get_ChannelName)(BSTR __RPC_FAR *pbstrChannelName) PURE;
433 STDMETHOD(get_ChannelDescription)(BSTR __RPC_FAR *pbstrChannelDescription) PURE;
434 STDMETHOD(get_ChannelURL)(BSTR __RPC_FAR *pbstrChannelURL) PURE;
435 STDMETHOD(get_ContactAddress)(BSTR __RPC_FAR *pbstrContactAddress) PURE;
436 STDMETHOD(get_ContactPhone)(BSTR __RPC_FAR *pbstrContactPhone) PURE;
437 STDMETHOD(get_ContactEmail)(BSTR __RPC_FAR *pbstrContactEmail) PURE;
438 STDMETHOD(get_BufferingTime)(double __RPC_FAR *pBufferingTime) PURE;
439 STDMETHOD(put_BufferingTime)(double pBufferingTime) PURE;
440 STDMETHOD(get_AutoStart)(VARIANT_BOOL __RPC_FAR *pAutoStart) PURE;
441 STDMETHOD(put_AutoStart)(VARIANT_BOOL pAutoStart) PURE;
442 STDMETHOD(get_AutoRewind)(VARIANT_BOOL __RPC_FAR *pAutoRewind) PURE;
443 STDMETHOD(put_AutoRewind)(VARIANT_BOOL pAutoRewind) PURE;
444 STDMETHOD(get_Rate)(double __RPC_FAR *pRate) PURE;
445 STDMETHOD(put_Rate)(double pRate) PURE;
446 STDMETHOD(get_SendKeyboardEvents)(VARIANT_BOOL __RPC_FAR *pSendKeyboardEvents) PURE;
447 STDMETHOD(put_SendKeyboardEvents)(VARIANT_BOOL pSendKeyboardEvents) PURE;
448 STDMETHOD(get_SendMouseClickEvents)(VARIANT_BOOL __RPC_FAR *pSendMouseClickEvents) PURE;
449 STDMETHOD(put_SendMouseClickEvents)(VARIANT_BOOL pSendMouseClickEvents) PURE;
450 STDMETHOD(get_SendMouseMoveEvents)(VARIANT_BOOL __RPC_FAR *pSendMouseMoveEvents) PURE;
451 STDMETHOD(put_SendMouseMoveEvents)(VARIANT_BOOL pSendMouseMoveEvents) PURE;
452 STDMETHOD(get_PlayCount)(long __RPC_FAR *pPlayCount) PURE;
453 STDMETHOD(put_PlayCount)(long pPlayCount) PURE;
454 STDMETHOD(get_ClickToPlay)(VARIANT_BOOL __RPC_FAR *pClickToPlay) PURE;
455 STDMETHOD(put_ClickToPlay)(VARIANT_BOOL pClickToPlay) PURE;
456 STDMETHOD(get_AllowScan)(VARIANT_BOOL __RPC_FAR *pAllowScan) PURE;
457 STDMETHOD(put_AllowScan)(VARIANT_BOOL pAllowScan) PURE;
458 STDMETHOD(get_EnableContextMenu)(VARIANT_BOOL __RPC_FAR *pEnableContextMenu) PURE;
459 STDMETHOD(put_EnableContextMenu)(VARIANT_BOOL pEnableContextMenu) PURE;
460 STDMETHOD(get_CursorType)(long __RPC_FAR *pCursorType) PURE;
461 STDMETHOD(put_CursorType)(long pCursorType) PURE;
462 STDMETHOD(get_CodecCount)(long __RPC_FAR *pCodecCount) PURE;
463 STDMETHOD(get_AllowChangeDisplaySize)(VARIANT_BOOL __RPC_FAR *pAllowChangeDisplaySize) PURE;
464 STDMETHOD(put_AllowChangeDisplaySize)( VARIANT_BOOL pAllowChangeDisplaySize) PURE;
465 STDMETHOD(get_IsDurationValid)(VARIANT_BOOL __RPC_FAR *pIsDurationValid) PURE;
466 STDMETHOD(get_OpenState)(long __RPC_FAR *pOpenState) PURE;
467 STDMETHOD(get_SendOpenStateChangeEvents)(VARIANT_BOOL __RPC_FAR *pSendOpenStateChangeEvents) PURE;
468 STDMETHOD(put_SendOpenStateChangeEvents)(VARIANT_BOOL pSendOpenStateChangeEvents) PURE;
469 STDMETHOD(get_SendWarningEvents)( VARIANT_BOOL __RPC_FAR *pSendWarningEvents) PURE;
470 STDMETHOD(put_SendWarningEvents)(VARIANT_BOOL pSendWarningEvents) PURE;
471 STDMETHOD(get_SendErrorEvents)(VARIANT_BOOL __RPC_FAR *pSendErrorEvents) PURE;
472 STDMETHOD(put_SendErrorEvents)(VARIANT_BOOL pSendErrorEvents) PURE;
473 STDMETHOD(get_PlayState)(MPPlayStateConstants __RPC_FAR *pPlayState) PURE;
474 STDMETHOD(get_SendPlayStateChangeEvents)(VARIANT_BOOL __RPC_FAR *pSendPlayStateChangeEvents) PURE;
475 STDMETHOD(put_SendPlayStateChangeEvents)(VARIANT_BOOL pSendPlayStateChangeEvents) PURE;
476 STDMETHOD(get_DisplaySize)(MPDisplaySizeConstants __RPC_FAR *pDisplaySize) PURE;
477 STDMETHOD(put_DisplaySize)(MPDisplaySizeConstants pDisplaySize) PURE;
478 STDMETHOD(get_InvokeURLs)(VARIANT_BOOL __RPC_FAR *pInvokeURLs) PURE;
479 STDMETHOD(put_InvokeURLs)(VARIANT_BOOL pInvokeURLs) PURE;
480 STDMETHOD(get_BaseURL)(BSTR __RPC_FAR *pbstrBaseURL) PURE;
481 STDMETHOD(put_BaseURL)(BSTR pbstrBaseURL) PURE;
482 STDMETHOD(get_DefaultFrame)(BSTR __RPC_FAR *pbstrDefaultFrame) PURE;
483 STDMETHOD(put_DefaultFrame)(BSTR pbstrDefaultFrame) PURE;
484 STDMETHOD(get_HasError)(VARIANT_BOOL __RPC_FAR *pHasError) PURE;
485 STDMETHOD(get_ErrorDescription)(BSTR __RPC_FAR *pbstrErrorDescription) PURE;
486 STDMETHOD(get_ErrorCode)(long __RPC_FAR *pErrorCode) PURE;
487 STDMETHOD(get_AnimationAtStart)(VARIANT_BOOL __RPC_FAR *pAnimationAtStart) PURE;
488 STDMETHOD(put_AnimationAtStart)(VARIANT_BOOL pAnimationAtStart) PURE;
489 STDMETHOD(get_TransparentAtStart)( VARIANT_BOOL __RPC_FAR *pTransparentAtStart) PURE;
490 STDMETHOD(put_TransparentAtStart)(VARIANT_BOOL pTransparentAtStart) PURE;
491 STDMETHOD(get_Volume)(long __RPC_FAR *pVolume) PURE;
492 STDMETHOD(put_Volume)(long pVolume) PURE;
493 STDMETHOD(get_Balance)(long __RPC_FAR *pBalance) PURE;
494 STDMETHOD(put_Balance)(long pBalance) PURE;
495 STDMETHOD(get_ReadyState)(MPReadyStateConstants __RPC_FAR *pValue) PURE;
496 STDMETHOD(get_SelectionStart)(double __RPC_FAR *pValue) PURE;
497 STDMETHOD(put_SelectionStart)(double pValue) PURE;
498 STDMETHOD(get_SelectionEnd)(double __RPC_FAR *pValue) PURE;
499 STDMETHOD(put_SelectionEnd)(double pValue) PURE;
500 STDMETHOD(get_ShowDisplay)(VARIANT_BOOL __RPC_FAR *Show) PURE;
501 STDMETHOD(put_ShowDisplay)(VARIANT_BOOL Show) PURE;
502 STDMETHOD(get_ShowControls)(VARIANT_BOOL __RPC_FAR *Show) PURE;
503 STDMETHOD(put_ShowControls)(VARIANT_BOOL Show) PURE;
504 STDMETHOD(get_ShowPositionControls)(VARIANT_BOOL __RPC_FAR *Show) PURE;
505 STDMETHOD(put_ShowPositionControls)(VARIANT_BOOL Show) PURE;
506 STDMETHOD(get_ShowTracker)(VARIANT_BOOL __RPC_FAR *Show) PURE;
507 STDMETHOD(put_ShowTracker)(VARIANT_BOOL Show) PURE;
508 STDMETHOD(get_EnablePositionControls)(VARIANT_BOOL __RPC_FAR *Enable) PURE;
509 STDMETHOD(put_EnablePositionControls)(VARIANT_BOOL Enable) PURE;
510 STDMETHOD(get_EnableTracker)(VARIANT_BOOL __RPC_FAR *Enable) PURE;
511 STDMETHOD(put_EnableTracker)(VARIANT_BOOL Enable) PURE;
512 STDMETHOD(get_Enabled)(VARIANT_BOOL __RPC_FAR *pEnabled) PURE;
513 STDMETHOD(put_Enabled)(VARIANT_BOOL pEnabled) PURE;
514 STDMETHOD(get_DisplayForeColor)(VB_OLE_COLOR __RPC_FAR *ForeColor) PURE;
515 STDMETHOD(put_DisplayForeColor)(VB_OLE_COLOR ForeColor) PURE;
516 STDMETHOD(get_DisplayBackColor)(VB_OLE_COLOR __RPC_FAR *BackColor) PURE;
517 STDMETHOD(put_DisplayBackColor)(VB_OLE_COLOR BackColor) PURE;
518 STDMETHOD(get_DisplayMode)(MPDisplayModeConstants __RPC_FAR *pValue) PURE;
519 STDMETHOD(put_DisplayMode)(MPDisplayModeConstants pValue) PURE;
520 STDMETHOD(get_VideoBorder3D)(VARIANT_BOOL __RPC_FAR *pVideoBorderWidth) PURE;
521 STDMETHOD(put_VideoBorder3D)(VARIANT_BOOL pVideoBorderWidth) PURE;
522 STDMETHOD(get_VideoBorderWidth)(long __RPC_FAR *pVideoBorderWidth) PURE;
523 STDMETHOD(put_VideoBorderWidth)(long pVideoBorderWidth) PURE;
524 STDMETHOD(get_VideoBorderColor)(VB_OLE_COLOR __RPC_FAR *pVideoBorderWidth) PURE;
525 STDMETHOD(put_VideoBorderColor)(VB_OLE_COLOR pVideoBorderWidth) PURE;
526 STDMETHOD(get_ShowGotoBar)(VARIANT_BOOL __RPC_FAR *pbool) PURE;
527 STDMETHOD(put_ShowGotoBar)(VARIANT_BOOL pbool) PURE;
528 STDMETHOD(get_ShowStatusBar)(VARIANT_BOOL __RPC_FAR *pbool) PURE;
529 STDMETHOD(put_ShowStatusBar)(VARIANT_BOOL pbool) PURE;
530 STDMETHOD(get_ShowCaptioning)(VARIANT_BOOL __RPC_FAR *pbool) PURE;
531 STDMETHOD(put_ShowCaptioning)(VARIANT_BOOL pbool) PURE;
532 STDMETHOD(get_ShowAudioControls)(VARIANT_BOOL __RPC_FAR *pbool) PURE;
533 STDMETHOD(put_ShowAudioControls)(VARIANT_BOOL pbool) PURE;
534 STDMETHOD(get_CaptioningID)( BSTR __RPC_FAR *pstrText) PURE;
535 STDMETHOD(put_CaptioningID)(BSTR pstrText) PURE;
536 STDMETHOD(get_Mute)(VARIANT_BOOL __RPC_FAR *vbool) PURE;
537 STDMETHOD(put_Mute)(VARIANT_BOOL vbool) PURE;
538 STDMETHOD(get_CanPreview)(VARIANT_BOOL __RPC_FAR *pCanPreview) PURE;
539 STDMETHOD(get_PreviewMode)(VARIANT_BOOL __RPC_FAR *pPreviewMode) PURE;
540 STDMETHOD(put_PreviewMode)(VARIANT_BOOL pPreviewMode) PURE;
541 STDMETHOD(get_HasMultipleItems)(VARIANT_BOOL __RPC_FAR *pHasMuliItems) PURE;
542 STDMETHOD(get_Language)(long __RPC_FAR *pLanguage) PURE;
543 STDMETHOD(put_Language)(long pLanguage) PURE;
544 STDMETHOD(get_AudioStream)(long __RPC_FAR *pStream) PURE;
545 STDMETHOD(put_AudioStream)(long pStream) PURE;
546 STDMETHOD(get_SAMIStyle)(BSTR __RPC_FAR *pbstrStyle) PURE;
547 STDMETHOD(put_SAMIStyle)(BSTR pbstrStyle) PURE;
548 STDMETHOD(get_SAMILang)(BSTR __RPC_FAR *pbstrLang) PURE;
549 STDMETHOD(put_SAMILang)(BSTR pbstrLang) PURE;
550 STDMETHOD(get_SAMIFileName)(BSTR __RPC_FAR *pbstrFileName) PURE;
551 STDMETHOD(put_SAMIFileName)(BSTR pbstrFileName) PURE;
552 STDMETHOD(get_StreamCount)( long __RPC_FAR *pStreamCount) PURE;
553 STDMETHOD(get_ClientId)(BSTR __RPC_FAR *pbstrClientId) PURE;
554 STDMETHOD(get_ConnectionSpeed)(long __RPC_FAR *plConnectionSpeed) PURE;
555 STDMETHOD(get_AutoSize)(VARIANT_BOOL __RPC_FAR *pbool) PURE;
556 STDMETHOD(put_AutoSize)(VARIANT_BOOL pbool) PURE;
557 STDMETHOD(get_EnableFullScreenControls)(VARIANT_BOOL __RPC_FAR *pbVal) PURE;
558 STDMETHOD(put_EnableFullScreenControls)(VARIANT_BOOL pbVal) PURE;
559 STDMETHOD(get_ActiveMovie)(IDispatch __RPC_FAR *__RPC_FAR *ppdispatch) PURE;
560 STDMETHOD(get_NSPlay)(IDispatch __RPC_FAR *__RPC_FAR *ppdispatch) PURE;
561 STDMETHOD(get_WindowlessVideo)(VARIANT_BOOL __RPC_FAR *pbool) PURE;
562 STDMETHOD(put_WindowlessVideo)(VARIANT_BOOL pbool) PURE;
563 STDMETHOD(Play)(void) PURE;
564 STDMETHOD(Stop)(void) PURE;
565 STDMETHOD(Pause)(void) PURE;
566 STDMETHOD(GetMarkerTime)(long MarkerNum,
567 double __RPC_FAR *pMarkerTime) PURE;
568 STDMETHOD(GetMarkerName)(long MarkerNum,
569 BSTR __RPC_FAR *pbstrMarkerName) PURE;
570 STDMETHOD(AboutBox)(void) PURE;
571 STDMETHOD(GetCodecInstalled)(long CodecNum,
572 VARIANT_BOOL __RPC_FAR *pCodecInstalled) PURE;
573 STDMETHOD(GetCodecDescription)(long CodecNum,
574 BSTR __RPC_FAR *pbstrCodecDescription) PURE;
575 STDMETHOD(GetCodecURL)(long CodecNum,
576 BSTR __RPC_FAR *pbstrCodecURL) PURE;
577 STDMETHOD(GetMoreInfoURL)(MPMoreInfoType MoreInfoType,
578 BSTR __RPC_FAR *pbstrMoreInfoURL) PURE;
579 STDMETHOD(GetMediaInfoString)(MPMediaInfoType MediaInfoType,
580 BSTR __RPC_FAR *pbstrMediaInfo) PURE;
581 STDMETHOD(Cancel)(void) PURE;
582 STDMETHOD(Open)(BSTR bstrFileName) PURE;
583 STDMETHOD(IsSoundCardEnabled)(VARIANT_BOOL __RPC_FAR *pbSoundCard) PURE;
584 STDMETHOD(Next)(void) PURE;
585 STDMETHOD(Previous)(void) PURE;
586 STDMETHOD(StreamSelect)(long StreamNum) PURE;
587 STDMETHOD(FastForward)(void) PURE;
588 STDMETHOD(FastReverse)(void) PURE;
589 STDMETHOD(GetStreamName)(long StreamNum,
590 BSTR __RPC_FAR *pbstrStreamName) PURE;
591 STDMETHOD(GetStreamGroup)(long StreamNum,
592 long __RPC_FAR *pStreamGroup) PURE;
593 STDMETHOD(GetStreamSelected)(long StreamNum, VARIANT_BOOL __RPC_FAR *pStreamSelected) PURE;
594 };
595
596 struct IMediaPlayer2 : public IMediaPlayer
597 {
598 STDMETHOD(get_DVD)(struct IMediaPlayerDvd __RPC_FAR *__RPC_FAR *ppdispatch) PURE;
599 STDMETHOD(GetMediaParameter)(long EntryNum, BSTR bstrParameterName, BSTR __RPC_FAR *pbstrParameterValue) PURE;
600 STDMETHOD(GetMediaParameterName(long EntryNum, long Index, BSTR __RPC_FAR *pbstrParameterName) PURE;
601 STDMETHOD(get_EntryCount)(long __RPC_FAR *pNumberEntries) PURE;
602 STDMETHOD(GetCurrentEntry)(long __RPC_FAR *pEntryNumber) PURE;
603 STDMETHOD(SetCurrentEntry)(long EntryNumber) PURE;
604 STDMETHOD(ShowDialog)(MPShowDialogConstants mpDialogIndex) PURE;
605 };
606
607 //---------------------------------------------------------------------------
608 // NETSHOW COM INTERFACES (dumped from nscompat.idl from MSVC COM Browser)
609 //---------------------------------------------------------------------------
610
611 struct INSOPlay : public IDispatch
612 {
613 STDMETHOD(get_ImageSourceWidth)(long __RPC_FAR *pWidth) PURE;
614 STDMETHOD(get_ImageSourceHeight)(long __RPC_FAR *pHeight) PURE;
615 STDMETHOD(get_Duration)(double __RPC_FAR *pDuration) PURE;
616 STDMETHOD(get_Author)(BSTR __RPC_FAR *pbstrAuthor) PURE;
617 STDMETHOD(get_Copyright)(BSTR __RPC_FAR *pbstrCopyright) PURE;
618 STDMETHOD(get_Description)(BSTR __RPC_FAR *pbstrDescription) PURE;
619 STDMETHOD(get_Rating)(BSTR __RPC_FAR *pbstrRating) PURE;
620 STDMETHOD(get_Title)(BSTR __RPC_FAR *pbstrTitle) PURE;
621 STDMETHOD(get_SourceLink)(BSTR __RPC_FAR *pbstrSourceLink) PURE;
622 STDMETHOD(get_MarkerCount)(long __RPC_FAR *pMarkerCount) PURE;
623 STDMETHOD(get_CanScan)(VARIANT_BOOL __RPC_FAR *pCanScan) PURE;
624 STDMETHOD(get_CanSeek)(VARIANT_BOOL __RPC_FAR *pCanSeek) PURE;
625 STDMETHOD(get_CanSeekToMarkers)(VARIANT_BOOL __RPC_FAR *pCanSeekToMarkers) PURE;
626 STDMETHOD(get_CreationDate)(DATE __RPC_FAR *pCreationDate) PURE;
627 STDMETHOD(get_Bandwidth)(long __RPC_FAR *pBandwidth) PURE;
628 STDMETHOD(get_ErrorCorrection)(BSTR __RPC_FAR *pbstrErrorCorrection) PURE;
629 STDMETHOD(get_AutoStart)(VARIANT_BOOL __RPC_FAR *pAutoStart) PURE;
630 STDMETHOD(put_AutoStart)(VARIANT_BOOL pAutoStart) PURE;
631 STDMETHOD(get_AutoRewind)(VARIANT_BOOL __RPC_FAR *pAutoRewind) PURE;
632 STDMETHOD(put_AutoRewind)(VARIANT_BOOL pAutoRewind) PURE;
633 STDMETHOD(get_AllowChangeControlType)(VARIANT_BOOL __RPC_FAR *pAllowChangeControlType) PURE;
634 STDMETHOD(put_AllowChangeControlType)(VARIANT_BOOL pAllowChangeControlType) PURE;
635 STDMETHOD(get_InvokeURLs)(VARIANT_BOOL __RPC_FAR *pInvokeURLs) PURE;
636 STDMETHOD(put_InvokeURLs)(VARIANT_BOOL pInvokeURLs) PURE;
637 STDMETHOD(get_EnableContextMenu)(VARIANT_BOOL __RPC_FAR *pEnableContextMenu) PURE;
638 STDMETHOD(put_EnableContextMenu)(VARIANT_BOOL pEnableContextMenu) PURE;
639 STDMETHOD(get_TransparentAtStart)(VARIANT_BOOL __RPC_FAR *pTransparentAtStart) PURE;
640 STDMETHOD(put_TransparentAtStart)(VARIANT_BOOL pTransparentAtStart) PURE;
641 STDMETHOD(get_TransparentOnStop)(VARIANT_BOOL __RPC_FAR *pTransparentOnStop) PURE;
642 STDMETHOD(put_TransparentOnStop)(VARIANT_BOOL pTransparentOnStop) PURE;
643 STDMETHOD(get_ClickToPlay)(VARIANT_BOOL __RPC_FAR *pClickToPlay) PURE;
644 STDMETHOD(put_ClickToPlay)(VARIANT_BOOL pClickToPlay) PURE;
645 STDMETHOD(get_FileName)(BSTR __RPC_FAR *pbstrFileName) PURE;
646 STDMETHOD(put_FileName)(BSTR pbstrFileName) PURE;
647 STDMETHOD(get_CurrentPosition)(double __RPC_FAR *pCurrentPosition) PURE;
648 STDMETHOD(put_CurrentPosition)(double pCurrentPosition) PURE;
649 STDMETHOD(get_Rate)(double __RPC_FAR *pRate) PURE;
650 STDMETHOD(put_Rate)(double pRate) PURE;
651 STDMETHOD(get_CurrentMarker)(long __RPC_FAR *pCurrentMarker) PURE;
652 STDMETHOD(put_CurrentMarker)(long pCurrentMarker) PURE;
653 STDMETHOD(get_PlayCount)(long __RPC_FAR *pPlayCount) PURE;
654 STDMETHOD(put_PlayCount)(long pPlayCount) PURE;
655 STDMETHOD(get_CurrentState)(long __RPC_FAR *pCurrentState) PURE;
656 STDMETHOD(get_DisplaySize)(long __RPC_FAR *pDisplaySize) PURE;
657 STDMETHOD(put_DisplaySize)(long pDisplaySize) PURE;
658 STDMETHOD(get_MainWindow)(long __RPC_FAR *pMainWindow) PURE;
659 STDMETHOD(get_ControlType)(long __RPC_FAR *pControlType) PURE;
660 STDMETHOD(put_ControlType)(long pControlType) PURE;
661 STDMETHOD(get_AllowScan)(VARIANT_BOOL __RPC_FAR *pAllowScan) PURE;
662 STDMETHOD(put_AllowScan)(VARIANT_BOOL pAllowScan) PURE;
663 STDMETHOD(get_SendKeyboardEvents)(VARIANT_BOOL __RPC_FAR *pSendKeyboardEvents) PURE;
664 STDMETHOD(put_SendKeyboardEvents)(VARIANT_BOOL pSendKeyboardEvents) PURE;
665 STDMETHOD(get_SendMouseClickEvents)(VARIANT_BOOL __RPC_FAR *pSendMouseClickEvents) PURE;
666 STDMETHOD(put_SendMouseClickEvents)(VARIANT_BOOL pSendMouseClickEvents) PURE;
667 STDMETHOD(get_SendMouseMoveEvents)(VARIANT_BOOL __RPC_FAR *pSendMouseMoveEvents) PURE;
668 STDMETHOD(put_SendMouseMoveEvents)(VARIANT_BOOL pSendMouseMoveEvents) PURE;
669 STDMETHOD(get_SendStateChangeEvents)(VARIANT_BOOL __RPC_FAR *pSendStateChangeEvents) PURE;
670 STDMETHOD(put_SendStateChangeEvents)(VARIANT_BOOL pSendStateChangeEvents) PURE;
671 STDMETHOD(get_ReceivedPackets)(long __RPC_FAR *pReceivedPackets) PURE;
672 STDMETHOD(get_RecoveredPackets)(long __RPC_FAR *pRecoveredPackets) PURE;
673 STDMETHOD(get_LostPackets)(long __RPC_FAR *pLostPackets) PURE;
674 STDMETHOD(get_ReceptionQuality)(long __RPC_FAR *pReceptionQuality) PURE;
675 STDMETHOD(get_BufferingCount)(long __RPC_FAR *pBufferingCount) PURE;
676 STDMETHOD(get_CursorType)(long __RPC_FAR *pCursorType) PURE;
677 STDMETHOD(put_CursorType)(long pCursorType) PURE;
678 STDMETHOD(get_AnimationAtStart)(VARIANT_BOOL __RPC_FAR *pAnimationAtStart) PURE;
679 STDMETHOD(put_AnimationAtStart)(VARIANT_BOOL pAnimationAtStart) PURE;
680 STDMETHOD(get_AnimationOnStop)(VARIANT_BOOL __RPC_FAR *pAnimationOnStop) PURE;
681 STDMETHOD(put_AnimationOnStop)(VARIANT_BOOL pAnimationOnStop) PURE;
682 STDMETHOD(Play)(void) PURE;
683 STDMETHOD(Pause)(void) PURE;
684 STDMETHOD(Stop)(void) PURE;
685 STDMETHOD(GetMarkerTime)(long MarkerNum, double __RPC_FAR *pMarkerTime) PURE;
686 STDMETHOD(GetMarkerName)(long MarkerNum, BSTR __RPC_FAR *pbstrMarkerName) PURE;
687 };
688
689 struct INSPlay : public INSOPlay
690 {
691 STDMETHOD(get_ChannelName)(BSTR __RPC_FAR *pbstrChannelName) PURE;
692 STDMETHOD(get_ChannelDescription)(BSTR __RPC_FAR *pbstrChannelDescription) PURE;
693 STDMETHOD(get_ChannelURL)(BSTR __RPC_FAR *pbstrChannelURL) PURE;
694 STDMETHOD(get_ContactAddress)(BSTR __RPC_FAR *pbstrContactAddress) PURE;
695 STDMETHOD(get_ContactPhone)(BSTR __RPC_FAR *pbstrContactPhone) PURE;
696 STDMETHOD(get_ContactEmail)(BSTR __RPC_FAR *pbstrContactEmail) PURE;
697 STDMETHOD(get_AllowChangeDisplaySize)(VARIANT_BOOL __RPC_FAR *pAllowChangeDisplaySize) PURE;
698 STDMETHOD(put_AllowChangeDisplaySize)(VARIANT_BOOL pAllowChangeDisplaySize) PURE;
699 STDMETHOD(get_CodecCount)(long __RPC_FAR *pCodecCount) PURE;
700 STDMETHOD(get_IsBroadcast)(VARIANT_BOOL __RPC_FAR *pIsBroadcast) PURE;
701 STDMETHOD(get_IsDurationValid)(VARIANT_BOOL __RPC_FAR *pIsDurationValid) PURE;
702 STDMETHOD(get_SourceProtocol)(long __RPC_FAR *pSourceProtocol) PURE;
703 STDMETHOD(get_OpenState)(long __RPC_FAR *pOpenState) PURE;
704 STDMETHOD(get_SendOpenStateChangeEvents)(VARIANT_BOOL __RPC_FAR *pSendOpenStateChangeEvents) PURE;
705 STDMETHOD(put_SendOpenStateChangeEvents)(VARIANT_BOOL pSendOpenStateChangeEvents) PURE;
706 STDMETHOD(get_SendWarningEvents)(VARIANT_BOOL __RPC_FAR *pSendWarningEvents) PURE;
707 STDMETHOD(put_SendWarningEvents)(VARIANT_BOOL pSendWarningEvents) PURE;
708 STDMETHOD(get_SendErrorEvents)(VARIANT_BOOL __RPC_FAR *pSendErrorEvents) PURE;
709 STDMETHOD(put_SendErrorEvents)(VARIANT_BOOL pSendErrorEvents) PURE;
710 STDMETHOD(get_HasError)(VARIANT_BOOL __RPC_FAR *pHasError) PURE;
711 STDMETHOD(get_ErrorDescription)(BSTR __RPC_FAR *pbstrErrorDescription) PURE;
712 STDMETHOD(get_ErrorCode)(long __RPC_FAR *pErrorCode) PURE;
713 STDMETHOD(get_PlayState)(long __RPC_FAR *pPlayState) PURE;
714 STDMETHOD(get_SendPlayStateChangeEvents)(VARIANT_BOOL __RPC_FAR *pSendPlayStateChangeEvents) PURE;
715 STDMETHOD(put_SendPlayStateChangeEvents)(VARIANT_BOOL pSendPlayStateChangeEvents) PURE;
716 STDMETHOD(get_BufferingTime)(double __RPC_FAR *pBufferingTime) PURE;
717 STDMETHOD(put_BufferingTime)(double pBufferingTime) PURE;
718 STDMETHOD(get_UseFixedUDPPort)(VARIANT_BOOL __RPC_FAR *pUseFixedUDPPort) PURE;
719 STDMETHOD(put_UseFixedUDPPort)(VARIANT_BOOL pUseFixedUDPPort) PURE;
720 STDMETHOD(get_FixedUDPPort)(long __RPC_FAR *pFixedUDPPort) PURE;
721 STDMETHOD(put_FixedUDPPort)(long pFixedUDPPort) PURE;
722 STDMETHOD(get_UseHTTPProxy)(VARIANT_BOOL __RPC_FAR *pUseHTTPProxy) PURE;
723 STDMETHOD(put_UseHTTPProxy)(VARIANT_BOOL pUseHTTPProxy) PURE;
724 STDMETHOD(get_EnableAutoProxy)(VARIANT_BOOL __RPC_FAR *pEnableAutoProxy) PURE;
725 STDMETHOD(put_EnableAutoProxy)(VARIANT_BOOL pEnableAutoProxy) PURE;
726 STDMETHOD(get_HTTPProxyHost)(BSTR __RPC_FAR *pbstrHTTPProxyHost) PURE;
727 STDMETHOD(put_HTTPProxyHost)(BSTR pbstrHTTPProxyHost) PURE;
728 STDMETHOD(get_HTTPProxyPort)(long __RPC_FAR *pHTTPProxyPort) PURE;
729 STDMETHOD(put_HTTPProxyPort)(long pHTTPProxyPort) PURE;
730 STDMETHOD(get_EnableMulticast)(VARIANT_BOOL __RPC_FAR *pEnableMulticast) PURE;
731 STDMETHOD(put_EnableMulticast)(VARIANT_BOOL pEnableMulticast) PURE;
732 STDMETHOD(get_EnableUDP)(VARIANT_BOOL __RPC_FAR *pEnableUDP) PURE;
733 STDMETHOD(put_EnableUDP)(VARIANT_BOOL pEnableUDP) PURE;
734 STDMETHOD(get_EnableTCP)(VARIANT_BOOL __RPC_FAR *pEnableTCP) PURE;
735 STDMETHOD(put_EnableTCP)(VARIANT_BOOL pEnableTCP) PURE;
736 STDMETHOD(get_EnableHTTP)(VARIANT_BOOL __RPC_FAR *pEnableHTTP) PURE;
737 STDMETHOD(put_EnableHTTP)(VARIANT_BOOL pEnableHTTP) PURE;
738 STDMETHOD(get_BufferingProgress)(long __RPC_FAR *pBufferingProgress) PURE;
739 STDMETHOD(get_BaseURL)(BSTR __RPC_FAR *pbstrBaseURL) PURE;
740 STDMETHOD(put_BaseURL)(BSTR pbstrBaseURL) PURE;
741 STDMETHOD(get_DefaultFrame)(BSTR __RPC_FAR *pbstrDefaultFrame) PURE;
742 STDMETHOD(put_DefaultFrame)(BSTR pbstrDefaultFrame) PURE;
743 STDMETHOD(AboutBox))(void) PURE;
744 STDMETHOD(Cancel)(void) PURE;
745 STDMETHOD(GetCodecInstalled)(long CodecNum, VARIANT_BOOL __RPC_FAR *pCodecInstalled) PURE;
746 STDMETHOD(GetCodecDescription)(long CodecNum, BSTR __RPC_FAR *pbstrCodecDescription) PURE;
747 STDMETHOD(GetCodecURL)(long CodecNum, BSTR __RPC_FAR *pbstrCodecURL) PURE;
748 STDMETHOD(Open)(BSTR bstrFileName) PURE;
749 };
750
751
752 struct INSPlay1 : public INSPlay
753 {
754 STDMETHOD(get_MediaPlayer)(IDispatch __RPC_FAR *__RPC_FAR *ppdispatch) PURE;
755 };
756
757 //---------------------------------------------------------------------------
758 // IWMP (PocketPC 2000) COM INTERFACES (dumped from PlayerOCX.idl)
759 //---------------------------------------------------------------------------
760
761 #ifdef __WXWINCE__
762
763 struct IWMP : public IDispatch
764 {
765 public:
766 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_AutoSize(
767 /* [in] */ VARIANT_BOOL vbool) = 0;
768
769 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_AutoSize(
770 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbool) = 0;
771
772 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderStyle(
773 /* [in] */ long style) = 0;
774
775 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderStyle(
776 /* [retval][out] */ long __RPC_FAR *pstyle) = 0;
777
778 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Enabled(
779 /* [in] */ VARIANT_BOOL vbool) = 0;
780
781 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Enabled(
782 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbool) = 0;
783
784 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FileName(
785 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
786
787 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_FileName(
788 /* [in] */ BSTR newVal) = 0;
789
790 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Volume(
791 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
792
793 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Volume(
794 /* [in] */ long newVal) = 0;
795
796 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Mute(
797 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
798
799 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Mute(
800 /* [in] */ VARIANT_BOOL newVal) = 0;
801
802 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AutoStart(
803 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
804
805 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AutoStart(
806 /* [in] */ VARIANT_BOOL newVal) = 0;
807
808 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PlayCount(
809 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
810
811 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PlayCount(
812 /* [in] */ long newVal) = 0;
813
814 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowStatusBar(
815 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
816
817 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowStatusBar(
818 /* [in] */ VARIANT_BOOL newVal) = 0;
819
820 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowAudioControls(
821 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
822
823 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowAudioControls(
824 /* [in] */ VARIANT_BOOL newVal) = 0;
825
826 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowCaptioning(
827 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
828
829 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowCaptioning(
830 /* [in] */ VARIANT_BOOL newVal) = 0;
831
832 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowControls(
833 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
834
835 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowControls(
836 /* [in] */ VARIANT_BOOL newVal) = 0;
837
838 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowDisplay(
839 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
840
841 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowDisplay(
842 /* [in] */ VARIANT_BOOL newVal) = 0;
843
844 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowGotoBar(
845 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
846
847 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowGotoBar(
848 /* [in] */ VARIANT_BOOL newVal) = 0;
849
850 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowPositionControls(
851 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
852
853 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowPositionControls(
854 /* [in] */ VARIANT_BOOL newVal) = 0;
855
856 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowTracker(
857 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
858
859 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowTracker(
860 /* [in] */ VARIANT_BOOL newVal) = 0;
861
862 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Startup( void) = 0;
863
864 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Shutdown( void) = 0;
865
866 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bandwidth(
867 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
868
869 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BaseURL(
870 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
871
872 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BaseURL(
873 /* [in] */ BSTR pVal) = 0;
874
875 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BufferingCount(
876 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
877
878 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BufferingProgress(
879 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
880
881 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BufferingTime(
882 /* [retval][out] */ double __RPC_FAR *pVal) = 0;
883
884 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CanSeek(
885 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
886
887 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CanSeekToMarkers(
888 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
889
890 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ChannelDescription(
891 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
892
893 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ChannelName(
894 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
895
896 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ChannelURL(
897 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
898
899 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ClientID(
900 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
901
902 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ConnectionSpeed(
903 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
904
905 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ContactAddress(
906 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
907
908 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ContactEmail(
909 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
910
911 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ContactPhone(
912 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
913
914 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CurrentMarker(
915 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
916
917 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CurrentMarker(
918 /* [in] */ long newVal) = 0;
919
920 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CurrentPosition(
921 /* [retval][out] */ double __RPC_FAR *pVal) = 0;
922
923 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CurrentPosition(
924 /* [in] */ double newVal) = 0;
925
926 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DefaultFrame(
927 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
928
929 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DefaultFrame(
930 /* [in] */ BSTR newVal) = 0;
931
932 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Duration(
933 /* [retval][out] */ double __RPC_FAR *pVal) = 0;
934
935 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EntryCount(
936 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
937
938 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ErrorCode(
939 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
940
941 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ErrorDescription(
942 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
943
944 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_HasError(
945 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
946
947 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_HasMultipleItems(
948 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
949
950 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ImageSourceHeight(
951 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
952
953 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ImageSourceWidth(
954 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
955
956 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InvokeURLs(
957 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
958
959 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InvokeURLs(
960 /* [in] */ VARIANT_BOOL newVal) = 0;
961
962 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_IsBroadcast(
963 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
964
965 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_IsDurationValid(
966 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
967
968 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LostPackets(
969 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
970
971 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MarkerCount(
972 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
973
974 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OpenState(
975 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
976
977 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PlayState(
978 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
979
980 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PreviewMode(
981 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
982
983 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PreviewMode(
984 /* [in] */ VARIANT_BOOL newVal) = 0;
985
986 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReadyState(
987 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
988
989 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReceivedPackets(
990 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
991
992 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReceptionQuality(
993 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
994
995 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_RecoveredPackets(
996 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
997
998 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SAMIFileName(
999 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
1000
1001 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SAMIFileName(
1002 /* [in] */ BSTR newVal) = 0;
1003
1004 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SAMILang(
1005 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
1006
1007 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SAMILang(
1008 /* [in] */ BSTR newVal) = 0;
1009
1010 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SAMIStyle(
1011 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
1012
1013 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SAMIStyle(
1014 /* [in] */ BSTR newVal) = 0;
1015
1016 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SelectionEnd(
1017 /* [retval][out] */ double __RPC_FAR *pVal) = 0;
1018
1019 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SelectionEnd(
1020 /* [in] */ double newVal) = 0;
1021
1022 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SelectionStart(
1023 /* [retval][out] */ double __RPC_FAR *pVal) = 0;
1024
1025 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SelectionStart(
1026 /* [in] */ double newVal) = 0;
1027
1028 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SendErrorEvents(
1029 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1030
1031 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SendErrorEvents(
1032 /* [in] */ VARIANT_BOOL newVal) = 0;
1033
1034 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SendKeyboardEvents(
1035 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1036
1037 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SendKeyboardEvents(
1038 /* [in] */ VARIANT_BOOL newVal) = 0;
1039
1040 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SendMouseClickEvents(
1041 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1042
1043 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SendMouseClickEvents(
1044 /* [in] */ VARIANT_BOOL newVal) = 0;
1045
1046 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SendMouseMoveEvents(
1047 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1048
1049 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SendMouseMoveEvents(
1050 /* [in] */ VARIANT_BOOL newVal) = 0;
1051
1052 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SendOpenStateChangeEvents(
1053 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1054
1055 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SendOpenStateChangeEvents(
1056 /* [in] */ VARIANT_BOOL newVal) = 0;
1057
1058 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SendPlayStateChangeEvents(
1059 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1060
1061 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SendPlayStateChangeEvents(
1062 /* [in] */ VARIANT_BOOL newVal) = 0;
1063
1064 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SendWarningEvents(
1065 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1066
1067 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SendWarningEvents(
1068 /* [in] */ VARIANT_BOOL newVal) = 0;
1069
1070 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SourceLink(
1071 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
1072
1073 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AboutBox( void) = 0;
1074
1075 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Cancel( void) = 0;
1076
1077 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetCodecDescription(
1078 /* [in] */ long nCodec,
1079 /* [retval][out] */ BSTR __RPC_FAR *pDescription) = 0;
1080
1081 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetCodecInstalled(
1082 /* [in] */ BSTR __RPC_FAR *pstrCodec,
1083 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pIsInstalled) = 0;
1084
1085 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetCurrentEntry(
1086 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1087
1088 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMarkerName(
1089 /* [in] */ long nMarker,
1090 /* [retval][out] */ BSTR __RPC_FAR *pMarkerName) = 0;
1091
1092 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMarkerTime(
1093 /* [in] */ long nMarker,
1094 /* [retval][out] */ double __RPC_FAR *pMarkerTime) = 0;
1095
1096 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMediaInfoString(
1097 /* [in] */ long MPMediaInfoType,
1098 /* [retval][out] */ BSTR __RPC_FAR *pstrMediaInfo) = 0;
1099
1100 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Next( void) = 0;
1101
1102 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Open(
1103 BSTR pstrClip) = 0;
1104
1105 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Pause( void) = 0;
1106
1107 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Play( void) = 0;
1108
1109 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Previous( void) = 0;
1110
1111 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Stop( void) = 0;
1112
1113 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Rate(
1114 /* [retval][out] */ double __RPC_FAR *pVal) = 0;
1115
1116 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Rate(
1117 /* [in] */ double newVal) = 0;
1118
1119 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DisplaySize(
1120 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1121
1122 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DisplaySize(
1123 /* [in] */ long newVal) = 0;
1124
1125 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SourceProtocol(
1126 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1127
1128 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ErrorCorrection(
1129 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
1130
1131 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE FinalConstruct( void) = 0;
1132
1133 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AllowChangeDisplaySize(
1134 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1135
1136 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AllowChangeDisplaySize(
1137 /* [in] */ VARIANT_BOOL newVal) = 0;
1138
1139 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AllowScan(
1140 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1141
1142 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AllowScan(
1143 /* [in] */ VARIANT_BOOL newVal) = 0;
1144
1145 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AnimationAtStart(
1146 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1147
1148 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AnimationAtStart(
1149 /* [in] */ VARIANT_BOOL newVal) = 0;
1150
1151 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AudioStream(
1152 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1153
1154 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AudioStream(
1155 /* [in] */ long newVal) = 0;
1156
1157 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AutoRewind(
1158 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1159
1160 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AutoRewind(
1161 /* [in] */ VARIANT_BOOL newVal) = 0;
1162
1163 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Balance(
1164 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1165
1166 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Balance(
1167 /* [in] */ long newVal) = 0;
1168
1169 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CanPreview(
1170 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1171
1172 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CanScan(
1173 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1174
1175 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CaptioningID(
1176 /* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
1177
1178 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ClickToPlay(
1179 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1180
1181 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ClickToPlay(
1182 /* [in] */ VARIANT_BOOL newVal) = 0;
1183
1184 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CodecCount(
1185 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1186
1187 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CreationDate(
1188 /* [retval][out] */ DATE __RPC_FAR *pVal) = 0;
1189
1190 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CursorType(
1191 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1192
1193 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CursorType(
1194 /* [in] */ long newVal) = 0;
1195
1196 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DisplayBackColor(
1197 /* [retval][out] */ VB_OLE_COLOR __RPC_FAR *pVal) = 0;
1198
1199 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DisplayBackColor(
1200 /* [in] */ VB_OLE_COLOR newVal) = 0;
1201
1202 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DisplayForeColor(
1203 /* [retval][out] */ VB_OLE_COLOR __RPC_FAR *pVal) = 0;
1204
1205 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DisplayForeColor(
1206 /* [in] */ VB_OLE_COLOR newVal) = 0;
1207
1208 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DisplayMode(
1209 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1210
1211 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DisplayMode(
1212 /* [in] */ long newVal) = 0;
1213
1214 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EnableContextMenu(
1215 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1216
1217 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_EnableContextMenu(
1218 /* [in] */ VARIANT_BOOL newVal) = 0;
1219
1220 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EnableFullScreenControls(
1221 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1222
1223 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_EnableFullScreenControls(
1224 /* [in] */ VARIANT_BOOL newVal) = 0;
1225
1226 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EnablePositionControls(
1227 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1228
1229 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_EnablePositionControls(
1230 /* [in] */ VARIANT_BOOL newVal) = 0;
1231
1232 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EnableTracker(
1233 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1234
1235 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_EnableTracker(
1236 /* [in] */ VARIANT_BOOL newVal) = 0;
1237
1238 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Language(
1239 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1240
1241 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamCount(
1242 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1243
1244 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TransparentAtStart(
1245 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1246
1247 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TransparentAtStart(
1248 /* [in] */ VARIANT_BOOL newVal) = 0;
1249
1250 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_VideoBorder3D(
1251 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pVal) = 0;
1252
1253 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_VideoBorder3D(
1254 /* [in] */ VARIANT_BOOL newVal) = 0;
1255
1256 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_VideoBorderColor(
1257 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1258
1259 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_VideoBorderColor(
1260 /* [in] */ long newVal) = 0;
1261
1262 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_VideoBorderWidth(
1263 /* [retval][out] */ long __RPC_FAR *pVal) = 0;
1264
1265 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_VideoBorderWidth(
1266 /* [in] */ long newVal) = 0;
1267
1268 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE FastForward( void) = 0;
1269
1270 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE FastReverse( void) = 0;
1271
1272 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetCodecURL(
1273 /* [retval][out] */ BSTR __RPC_FAR *pstrCodecURL) = 0;
1274
1275 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMediaParameter(
1276 /* [in] */ long nParam,
1277 BSTR szParameterName,
1278 /* [retval][out] */ BSTR __RPC_FAR *pstrParameterValue) = 0;
1279
1280 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMediaParameterName(
1281 /* [in] */ long nParam,
1282 long nIndex,
1283 /* [retval][out] */ BSTR __RPC_FAR *pstrParameterName) = 0;
1284
1285 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMoreInfoURL(
1286 /* [retval][out] */ BSTR __RPC_FAR *pstrMoreInfoURL) = 0;
1287
1288 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetStreamGroup(
1289 /* [retval][out] */ BSTR __RPC_FAR *pstrStreamGroup) = 0;
1290
1291 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetStreamName(
1292 /* [retval][out] */ BSTR __RPC_FAR *pstrStreamName) = 0;
1293
1294 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetStreamSelected(
1295 /* [in] */ long nStream,
1296 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *fIsSelected) = 0;
1297
1298 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IsSoundCardEnabled(
1299 /* [retval][out] */ VARIANT_BOOL __RPC_FAR *fIsEnabled) = 0;
1300
1301 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetCurrentEntry(
1302 long nValue) = 0;
1303
1304 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ShowDialog(
1305 long nValue) = 0;
1306
1307 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE StreamSelect(
1308 long nSelect) = 0;
1309
1310 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE OnWindowMessage(
1311 UINT msg,
1312 WPARAM wParam,
1313 LPARAM lParam,
1314 LRESULT __RPC_FAR *plResult) = 0;
1315
1316 };
1317
1318
1319 #endif // CE
1320
1321 //---------------------------------------------------------------------------
1322 // MISC COM INTERFACES
1323 //---------------------------------------------------------------------------
1324 typedef enum _FilterState
1325 {
1326 State_Stopped,
1327 State_Paused,
1328 State_Running
1329 } FILTER_STATE;
1330 typedef enum _PinDirection {
1331 PINDIR_INPUT,
1332 PINDIR_OUTPUT
1333 } PIN_DIRECTION;
1334
1335 typedef struct _FilterInfo {
1336 WCHAR achName[128];
1337 struct IFilterGraph *pGraph;
1338 } FILTER_INFO;
1339
1340 typedef struct _PinInfo {
1341 struct IBaseFilter *pFilter;
1342 PIN_DIRECTION dir;
1343 WCHAR achName[128];
1344 } PIN_INFO;
1345
1346 struct IBaseFilter;
1347 struct IPin;
1348 struct IEnumFilters;
1349 typedef struct _MediaType {
1350 GUID majortype;
1351 GUID subtype;
1352 BOOL bFixedSizeSamples;
1353 BOOL bTemporalCompression;
1354 ULONG lSampleSize;
1355 GUID formattype;
1356 IUnknown *pUnk;
1357 ULONG cbFormat;
1358 BYTE *pbFormat;
1359 } AM_MEDIA_TYPE;
1360
1361 struct IFilterGraph : public IUnknown
1362 {
1363 STDMETHOD(AddFilter)(IBaseFilter *, LPCWSTR) PURE;
1364 STDMETHOD(RemoveFilter)(IBaseFilter *) PURE;
1365 STDMETHOD(EnumFilters)(IEnumFilters **) PURE;
1366 STDMETHOD(FindFilterByName)(LPCWSTR, IBaseFilter **) PURE;
1367 STDMETHOD(ConnectDirect)(IPin *, IPin *, const AM_MEDIA_TYPE *) PURE;
1368 STDMETHOD(Reconnect)(IPin *) PURE;
1369 STDMETHOD(Disconnect)(IPin *) PURE;
1370 STDMETHOD(SetDefaultSyncSource)() PURE;
1371 };
1372
1373 struct IGraphBuilder : public IFilterGraph
1374 {
1375 STDMETHOD(Connect)(IPin *, IPin *) PURE;
1376 STDMETHOD(Render)(IPin *) PURE;
1377 STDMETHOD(RenderFile)(LPCWSTR, LPCWSTR) PURE;
1378 STDMETHOD(AddSourceFilter)(LPCWSTR, LPCWSTR, IBaseFilter **) PURE;
1379 STDMETHOD(SetLogFile)(DWORD_PTR) PURE;
1380 STDMETHOD(Abort)() PURE;
1381 STDMETHOD(ShouldOperationContinue)() PURE;
1382 };
1383
1384 struct IReferenceClock;
1385 struct IEnumPins;
1386 #define REFERENCE_TIME LONGLONG
1387 struct IMediaFilter : public IPersist
1388 {
1389 STDMETHOD(Stop)( void) PURE;
1390 STDMETHOD(Pause)( void) PURE;
1391 STDMETHOD(Run)(REFERENCE_TIME tStart) PURE;
1392 STDMETHOD(GetState)(DWORD dwMilliSecsTimeout,
1393 FILTER_STATE *State) PURE;
1394 STDMETHOD(SetSyncSource)(IReferenceClock *pClock) PURE;
1395 STDMETHOD(GetSyncSource)(IReferenceClock **pClock) PURE;
1396 };
1397
1398 struct IBaseFilter : public IMediaFilter
1399 {
1400 STDMETHOD(EnumPins)(IEnumPins **ppEnum) PURE;
1401 STDMETHOD(FindPin)(LPCWSTR Id, IPin **ppPin) PURE;
1402 STDMETHOD(QueryFilterInfo)(FILTER_INFO *pInfo) PURE;
1403 STDMETHOD(JoinFilterGraph)(IFilterGraph *pGraph, LPCWSTR pName) PURE;
1404 STDMETHOD(QueryVendorInfo)(LPWSTR *pVendorInfo) PURE;
1405 };
1406
1407
1408 //---------------------------------------------------------------------------
1409 //
1410 // wxAMMediaBackend
1411 //
1412 //---------------------------------------------------------------------------
1413
1414 typedef BOOL (WINAPI* LPAMGETERRORTEXT)(HRESULT, wxChar *, DWORD);
1415
1416 class WXDLLIMPEXP_MEDIA wxAMMediaBackend : public wxMediaBackendCommonBase
1417 {
1418 public:
1419 wxAMMediaBackend();
1420 virtual ~wxAMMediaBackend();
1421
1422 virtual bool CreateControl(wxControl* ctrl, wxWindow* parent,
1423 wxWindowID id,
1424 const wxPoint& pos,
1425 const wxSize& size,
1426 long style,
1427 const wxValidator& validator,
1428 const wxString& name);
1429
1430 virtual bool Play();
1431 virtual bool Pause();
1432 virtual bool Stop();
1433
1434 virtual bool Load(const wxString& fileName);
1435 virtual bool Load(const wxURI& location);
1436 virtual bool Load(const wxURI& location, const wxURI& proxy);
1437
1438 bool DoLoad(const wxString& location);
1439 void FinishLoad();
1440
1441 virtual wxMediaState GetState();
1442
1443 virtual bool SetPosition(wxLongLong where);
1444 virtual wxLongLong GetPosition();
1445 virtual wxLongLong GetDuration();
1446
1447 virtual void Move(int x, int y, int w, int h);
1448 wxSize GetVideoSize() const;
1449
1450 virtual double GetPlaybackRate();
1451 virtual bool SetPlaybackRate(double);
1452
1453 virtual double GetVolume();
1454 virtual bool SetVolume(double);
1455
1456 virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags);
1457
1458 void DoGetDownloadProgress(wxLongLong*, wxLongLong*);
1459 virtual wxLongLong GetDownloadProgress()
1460 {
1461 wxLongLong progress, total;
1462 DoGetDownloadProgress(&progress, &total);
1463 return progress;
1464 }
1465 virtual wxLongLong GetDownloadTotal()
1466 {
1467 wxLongLong progress, total;
1468 DoGetDownloadProgress(&progress, &total);
1469 return total;
1470 }
1471
1472 wxActiveXContainer* m_pAX; // ActiveX host
1473 #ifdef __WXWINCE__
1474 IWMP* m_pWMP;
1475
1476 IWMP* GetMP() {return m_pWMP;}
1477 IWMP* GetAM() {return m_pWMP;}
1478 #else
1479 IActiveMovie* m_pAM;
1480 IMediaPlayer* m_pMP;
1481
1482 IMediaPlayer* GetMP() {return m_pMP;}
1483 IActiveMovie* GetAM() {return m_pAM;}
1484 #endif
1485 wxSize m_bestSize; // Cached size
1486
1487 #ifdef __WXDEBUG__ // Stuff for getting useful debugging strings
1488 wxDynamicLibrary m_dllQuartz;
1489 LPAMGETERRORTEXT m_lpAMGetErrorText;
1490 wxString GetErrorString(HRESULT hrdsv);
1491 #endif // __WXDEBUG__
1492
1493 friend class wxAMMediaEvtHandler;
1494 DECLARE_DYNAMIC_CLASS(wxAMMediaBackend)
1495 };
1496
1497 class WXDLLIMPEXP_MEDIA wxAMMediaEvtHandler : public wxEvtHandler
1498 {
1499 public:
1500 wxAMMediaEvtHandler(wxAMMediaBackend *amb) :
1501 m_amb(amb), m_bLoadEventSent(false)
1502 {
1503 m_amb->m_pAX->Connect(m_amb->m_pAX->GetId(),
1504 wxEVT_ACTIVEX,
1505 wxActiveXEventHandler(wxAMMediaEvtHandler::OnActiveX),
1506 NULL, this
1507 );
1508 }
1509
1510 void OnActiveX(wxActiveXEvent& event);
1511
1512 private:
1513 wxAMMediaBackend *m_amb;
1514 bool m_bLoadEventSent; // Whether or not FinishLoaded was already called
1515 // prevents it being called multiple times
1516
1517 DECLARE_NO_COPY_CLASS(wxAMMediaEvtHandler)
1518 };
1519
1520 //===========================================================================
1521 // IMPLEMENTATION
1522 //===========================================================================
1523
1524 //---------------------------------------------------------------------------
1525 //
1526 // wxAMMediaBackend
1527 //
1528 //---------------------------------------------------------------------------
1529
1530 IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend, wxMediaBackend)
1531
1532 //---------------------------------------------------------------------------
1533 // Usual debugging macros
1534 //---------------------------------------------------------------------------
1535 #ifdef __WXDEBUG__
1536 #define MAX_ERROR_TEXT_LEN 160
1537
1538 // Get the error string for Active Movie
1539 wxString wxAMMediaBackend::GetErrorString(HRESULT hrdsv)
1540 {
1541 wxChar szError[MAX_ERROR_TEXT_LEN];
1542 if( m_lpAMGetErrorText != NULL &&
1543 (*m_lpAMGetErrorText)(hrdsv, szError, MAX_ERROR_TEXT_LEN) == 0)
1544 {
1545 return wxString::Format(wxT("DirectShow error \"%s\" \n")
1546 wxT("(numeric %X)\n")
1547 wxT("occured"),
1548 szError, (int)hrdsv);
1549 }
1550 else
1551 {
1552 return wxString::Format(wxT("Unknown error \n")
1553 wxT("(numeric %X)\n")
1554 wxT("occured"),
1555 (int)hrdsv);
1556 }
1557 }
1558
1559 #define wxAMFAIL(x) wxFAIL_MSG(GetErrorString(x));
1560 #define wxVERIFY(x) wxASSERT((x))
1561 #define wxAMLOG(x) wxLogDebug(GetErrorString(x))
1562 #else
1563 #define wxAMVERIFY(x) (x)
1564 #define wxVERIFY(x) (x)
1565 #define wxAMLOG(x)
1566 #define wxAMFAIL(x)
1567 #endif
1568
1569 //---------------------------------------------------------------------------
1570 // wxAMMediaBackend Constructor
1571 //---------------------------------------------------------------------------
1572 wxAMMediaBackend::wxAMMediaBackend()
1573 :m_pAX(NULL),
1574 #ifdef __WXWINCE__
1575 m_pWMP(NULL)
1576 #else
1577 m_pAM(NULL),
1578 m_pMP(NULL)
1579 #endif
1580 {
1581 }
1582
1583 //---------------------------------------------------------------------------
1584 // wxAMMediaBackend Destructor
1585 //---------------------------------------------------------------------------
1586 wxAMMediaBackend::~wxAMMediaBackend()
1587 {
1588 if(m_pAX)
1589 {
1590 m_pAX->DissociateHandle();
1591 delete m_pAX;
1592 #ifndef __WXWINCE__
1593 m_pAM->Release();
1594 #endif
1595
1596 if (GetMP())
1597 GetMP()->Release();
1598
1599 m_ctrl->PopEventHandler(true);
1600 }
1601 }
1602
1603 //---------------------------------------------------------------------------
1604 // wxAMMediaBackend::CreateControl
1605 //---------------------------------------------------------------------------
1606 bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
1607 wxWindowID id,
1608 const wxPoint& pos,
1609 const wxSize& size,
1610 long style,
1611 const wxValidator& validator,
1612 const wxString& name)
1613 {
1614 // First get the AMGetErrorText procedure in debug
1615 // mode for more meaningful messages
1616 #ifdef __WXDEBUG__
1617 if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
1618 {
1619 m_lpAMGetErrorText = (LPAMGETERRORTEXT)
1620 m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText"));
1621 }
1622 #endif // __WXDEBUG__
1623
1624
1625
1626 #ifdef __WXWINCE__
1627 CLSID clsid;
1628
1629 // Try progids first - *.WMP is PocketPC and Mediaplayer.1 is CE.NET
1630 // later versions support straight creation from CLSID
1631 if (CLSIDFromProgID(L"WPCEOCX.WMP", &clsid) != S_OK &&
1632 CLSIDFromProgID(L"MediaPlayer.MediaPlayer.1", &clsid) != S_OK)
1633 {
1634 clsid = CLSID_MediaPlayer;
1635 }
1636
1637 // While the CLSID is the same as CLSID_MediaPlayer
1638 // CE only supports the IWMP interface
1639 if ( ::CoCreateInstance(clsid, NULL,
1640 CLSCTX_INPROC_SERVER,
1641 IID_IWMP, (void**)&m_pWMP) != 0 )
1642 {
1643 return false;
1644 }
1645
1646 #else
1647 // Now determine which (if any) media player interface is
1648 // available - IMediaPlayer or IActiveMovie
1649 if( ::CoCreateInstance(CLSID_MediaPlayer, NULL,
1650 CLSCTX_INPROC_SERVER,
1651 IID_IMediaPlayer, (void**)&m_pMP) != 0 )
1652 {
1653 if( ::CoCreateInstance(CLSID_ActiveMovie, NULL,
1654 CLSCTX_INPROC_SERVER,
1655 IID_IActiveMovie, (void**)&m_pAM) != 0 )
1656 return false;
1657 m_pAM->QueryInterface(IID_IMediaPlayer, (void**)&m_pMP);
1658 }
1659 else
1660 {
1661 m_pMP->QueryInterface(IID_IActiveMovie, (void**)&m_pAM);
1662 }
1663 #endif
1664
1665 //
1666 // Create window
1667 // By default wxWindow(s) is created with a border -
1668 // so we need to get rid of those
1669 //
1670 // Since we don't have a child window like most other
1671 // backends, we don't need wxCLIP_CHILDREN
1672 //
1673 if ( !ctrl->wxControl::Create(parent, id, pos, size,
1674 (style & ~wxBORDER_MASK) | wxBORDER_NONE,
1675 validator, name) )
1676 return false;
1677
1678 //
1679 // Now create the ActiveX container along with the media player
1680 // interface and query them
1681 //
1682 m_ctrl = wxStaticCast(ctrl, wxMediaCtrl);
1683 m_pAX = new wxActiveXContainer(ctrl,
1684 #ifdef __WXWINCE__
1685 IID_IWMP, m_pWMP
1686 #else
1687 m_pMP ? IID_IMediaPlayer : IID_IActiveMovie, m_pAM
1688 #endif
1689 );
1690 // Connect for events
1691 m_ctrl->PushEventHandler(new wxAMMediaEvtHandler(this));
1692
1693 //
1694 // Here we set up wx-specific stuff for the default
1695 // settings wxMediaCtrl says it will stay to
1696 //
1697 if(GetMP())
1698 {
1699 GetMP()->put_DisplaySize(mpFitToSize);
1700 #ifndef __WXWINCE__ // Not in CE's IWMP
1701 // TODO: Unsure what actual effect this has
1702 // In DirectShow Windowless video results in less delay when
1703 // dragging, for example - but this doesn't appear to really do anything
1704 // in practice (it may be something different...)...
1705 GetMP()->put_WindowlessVideo(VARIANT_TRUE);
1706 #endif
1707
1708 }
1709 #ifndef __WXWINCE__ // Not in CE's IWMP
1710 else
1711 GetAM()->put_MovieWindowSize(amvDoubleOriginalSize);
1712 #endif
1713
1714 // by default true
1715 GetAM()->put_AutoStart(VARIANT_FALSE);
1716 // by default enabled
1717 wxAMMediaBackend::ShowPlayerControls(wxMEDIACTRLPLAYERCONTROLS_NONE);
1718 // by default with AM only 0.5
1719 wxAMMediaBackend::SetVolume(1.0);
1720
1721 // don't erase the background of our control window so that resizing is a
1722 // bit smoother
1723 m_ctrl->SetBackgroundStyle(wxBG_STYLE_CUSTOM);
1724
1725 // success
1726 return true;
1727 }
1728
1729 //---------------------------------------------------------------------------
1730 // wxAMMediaBackend::Load (file version)
1731 //---------------------------------------------------------------------------
1732 bool wxAMMediaBackend::Load(const wxString& fileName)
1733 {
1734 return DoLoad(fileName);
1735 }
1736
1737 //---------------------------------------------------------------------------
1738 // wxAMMediaBackend::Load (URL Version)
1739 //---------------------------------------------------------------------------
1740 bool wxAMMediaBackend::Load(const wxURI& location)
1741 {
1742 // Turn off loading from a proxy as user
1743 // may have set it previously
1744 INSPlay* pPlay = NULL;
1745 GetAM()->QueryInterface(IID_INSPlay, (void**) &pPlay);
1746 if(pPlay)
1747 {
1748 pPlay->put_UseHTTPProxy(VARIANT_FALSE);
1749 pPlay->Release();
1750 }
1751
1752 return DoLoad(location.BuildURI());
1753 }
1754
1755 //---------------------------------------------------------------------------
1756 // wxAMMediaBackend::Load (URL Version with Proxy)
1757 //---------------------------------------------------------------------------
1758 bool wxAMMediaBackend::Load(const wxURI& location, const wxURI& proxy)
1759 {
1760 // Set the proxy of the NETSHOW interface
1761 INSPlay* pPlay = NULL;
1762 GetAM()->QueryInterface(IID_INSPlay, (void**) &pPlay);
1763
1764 if(pPlay)
1765 {
1766 pPlay->put_UseHTTPProxy(VARIANT_TRUE);
1767 pPlay->put_HTTPProxyHost(wxBasicString(proxy.GetServer()).Get());
1768 pPlay->put_HTTPProxyPort(wxAtoi(proxy.GetPort()));
1769 pPlay->Release();
1770 }
1771
1772 return DoLoad(location.BuildURI());
1773 }
1774
1775 //---------------------------------------------------------------------------
1776 // wxAMMediaBackend::DoLoad
1777 //
1778 // Called by all functions - this actually renders
1779 // the file and sets up the filter graph
1780 //---------------------------------------------------------------------------
1781 bool wxAMMediaBackend::DoLoad(const wxString& location)
1782 {
1783 HRESULT hr;
1784
1785 // Play the movie the normal way through the embedded
1786 // WMP. Supposively Open is better in theory because
1787 // the docs say its async and put_FileName is not -
1788 // but in practice they both seem to be async anyway
1789 if(GetMP())
1790 hr = GetMP()->Open( wxBasicString(location).Get() );
1791 else
1792 hr = GetAM()->put_FileName( wxBasicString(location).Get() );
1793
1794 if(FAILED(hr))
1795 {
1796 wxAMLOG(hr);
1797 return false;
1798 }
1799
1800 return true;
1801 }
1802
1803 //---------------------------------------------------------------------------
1804 // wxAMMediaBackend::FinishLoad
1805 //
1806 // Called when the media has finished loaded and is ready to play
1807 //
1808 // Here we get the original size of the video and
1809 // send the loaded event to our watcher :).
1810 //---------------------------------------------------------------------------
1811 void wxAMMediaBackend::FinishLoad()
1812 {
1813 // Get the original video size
1814 GetAM()->get_ImageSourceWidth((long*)&m_bestSize.x);
1815 GetAM()->get_ImageSourceHeight((long*)&m_bestSize.y);
1816
1817 NotifyMovieLoaded();
1818 }
1819
1820 //---------------------------------------------------------------------------
1821 // wxAMMediaBackend::ShowPlayerControls
1822 //---------------------------------------------------------------------------
1823 bool wxAMMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags)
1824 {
1825 // Note that IMediaPlayer doesn't have a statusbar by
1826 // default but IActiveMovie does - so lets try to keep
1827 // the interface consistant
1828 if(!flags)
1829 {
1830 GetAM()->put_Enabled(VARIANT_FALSE);
1831 GetAM()->put_ShowControls(VARIANT_FALSE);
1832 if(GetMP())
1833 GetMP()->put_ShowStatusBar(VARIANT_FALSE);
1834 }
1835 else
1836 {
1837 GetAM()->put_Enabled(VARIANT_TRUE);
1838 GetAM()->put_ShowControls(VARIANT_TRUE);
1839
1840 GetAM()->put_ShowPositionControls(
1841 (flags & wxMEDIACTRLPLAYERCONTROLS_STEP) ?
1842 VARIANT_TRUE : VARIANT_FALSE);
1843
1844 if(GetMP())
1845 {
1846 GetMP()->put_ShowStatusBar(VARIANT_TRUE);
1847 GetMP()->put_ShowAudioControls(
1848 (flags & wxMEDIACTRLPLAYERCONTROLS_VOLUME) ?
1849 VARIANT_TRUE : VARIANT_FALSE);
1850 }
1851 }
1852
1853 return true;
1854 }
1855
1856 //---------------------------------------------------------------------------
1857 // wxAMMediaBackend::Play
1858 //
1859 // Plays the stream. If it is non-seekable, it will restart it (implicit).
1860 //
1861 // Note that we use SUCCEEDED here because run/pause/stop tend to be overly
1862 // picky and return warnings on pretty much every call
1863 //---------------------------------------------------------------------------
1864 bool wxAMMediaBackend::Play()
1865 {
1866 // Actually try to play the movie (will fail if not loaded completely)
1867 #ifdef __WXWINCE__
1868 HRESULT hr = m_pWMP->Play();
1869 #else
1870 HRESULT hr = GetAM()->Run();
1871 #endif
1872 if(SUCCEEDED(hr))
1873 {
1874 return true;
1875 }
1876 wxAMLOG(hr);
1877 return false;
1878 }
1879
1880 //---------------------------------------------------------------------------
1881 // wxAMMediaBackend::Pause
1882 //
1883 // Pauses the stream.
1884 //---------------------------------------------------------------------------
1885 bool wxAMMediaBackend::Pause()
1886 {
1887 HRESULT hr = GetAM()->Pause();
1888 if(SUCCEEDED(hr))
1889 return true;
1890 wxAMLOG(hr);
1891 return false;
1892 }
1893
1894 //---------------------------------------------------------------------------
1895 // wxAMMediaBackend::Stop
1896 //
1897 // Stops the stream.
1898 //---------------------------------------------------------------------------
1899 bool wxAMMediaBackend::Stop()
1900 {
1901 HRESULT hr = GetAM()->Stop();
1902 if(SUCCEEDED(hr))
1903 {
1904 // Seek to beginning
1905 wxAMMediaBackend::SetPosition(0);
1906 return true;
1907 }
1908 wxAMLOG(hr);
1909 return false;
1910 }
1911
1912 //---------------------------------------------------------------------------
1913 // wxAMMediaBackend::SetPosition
1914 //
1915 // 1) Translates the current position's time to directshow time,
1916 // which is in a scale of 1 second (in a double)
1917 // 2) Sets the play position of the IActiveMovie interface -
1918 // passing NULL as the stop position means to keep the old
1919 // stop position
1920 //---------------------------------------------------------------------------
1921 bool wxAMMediaBackend::SetPosition(wxLongLong where)
1922 {
1923 HRESULT hr = GetAM()->put_CurrentPosition(
1924 ((LONGLONG)where.GetValue()) / 1000.0
1925 );
1926 if(FAILED(hr))
1927 {
1928 wxAMLOG(hr);
1929 return false;
1930 }
1931
1932 return true;
1933 }
1934
1935 //---------------------------------------------------------------------------
1936 // wxAMMediaBackend::GetPosition
1937 //
1938 // 1) Obtains the current play and stop positions from IMediaSeeking
1939 // 2) Returns the play position translated to our time base
1940 //---------------------------------------------------------------------------
1941 wxLongLong wxAMMediaBackend::GetPosition()
1942 {
1943 double outCur;
1944 HRESULT hr = GetAM()->get_CurrentPosition(&outCur);
1945 if(FAILED(hr))
1946 {
1947 wxAMLOG(hr);
1948 return 0;
1949 }
1950
1951 // h,m,s,milli - outCur is in 1 second (double)
1952 outCur *= 1000;
1953 wxLongLong ll;
1954 ll.Assign(outCur);
1955
1956 return ll;
1957 }
1958
1959 //---------------------------------------------------------------------------
1960 // wxAMMediaBackend::GetVolume
1961 //
1962 // Gets the volume through the IActiveMovie interface -
1963 // value ranges from 0 (MAX volume) to -10000 (minimum volume).
1964 // -100 per decibel (Logorithmic in 0.01db per step).
1965 //---------------------------------------------------------------------------
1966 double wxAMMediaBackend::GetVolume()
1967 {
1968 long lVolume;
1969 HRESULT hr = GetAM()->get_Volume(&lVolume);
1970 if(FAILED(hr))
1971 {
1972 wxAMLOG(hr);
1973 return 0.0;
1974 }
1975
1976 // Volume conversion from Greg Hazel
1977 double dVolume = (double)lVolume / 125;
1978
1979 // convert to 0 to 1
1980 dVolume = pow(10.0, dVolume/20.0);
1981 // handle -INF
1982 dVolume *= 1 + pow(10.0, -5.0);
1983 dVolume -= pow(10.0, -5.0);
1984 return dVolume;
1985 }
1986
1987 //---------------------------------------------------------------------------
1988 // wxAMMediaBackend::SetVolume
1989 //
1990 // Sets the volume through the IActiveMovie interface -
1991 // value ranges from 0 (MAX volume) to -10000 (minimum volume).
1992 // -100 per decibel (Logorithmic in 0.01db per step).
1993 //---------------------------------------------------------------------------
1994 bool wxAMMediaBackend::SetVolume(double dVolume)
1995 {
1996 // Volume conversion from Greg Hazel
1997 long lVolume;
1998 // handle -INF
1999 dVolume *= 1 - pow(10.0, -5.0);
2000 dVolume += pow(10.0, -5.0);
2001 // convert to -100db to 0db
2002 dVolume = 20 * log10(dVolume);
2003 // scale to -10000 to 0
2004 lVolume = (long)(125 * dVolume);
2005
2006 HRESULT hr = GetAM()->put_Volume( lVolume );
2007 if(FAILED(hr))
2008 {
2009 wxAMLOG(hr);
2010 return false;
2011 }
2012 return true;
2013 }
2014
2015 //---------------------------------------------------------------------------
2016 // wxAMMediaBackend::GetDuration
2017 //
2018 // 1) Obtains the duration of the media from IActiveMovie
2019 // 2) Converts that value to our time base, and returns it
2020 //
2021 // NB: With VBR MP3 files the default DirectShow MP3 render does not
2022 // read the Xing header correctly, resulting in skewed values for duration
2023 // and seeking
2024 //---------------------------------------------------------------------------
2025 wxLongLong wxAMMediaBackend::GetDuration()
2026 {
2027 double outDuration;
2028 HRESULT hr = GetAM()->get_Duration(&outDuration);
2029 if(FAILED(hr))
2030 {
2031 wxAMLOG(hr);
2032 return 0;
2033 }
2034
2035 // h,m,s,milli - outDuration is in 1 second (double)
2036 outDuration *= 1000;
2037 wxLongLong ll;
2038 ll.Assign(outDuration);
2039
2040 return ll;
2041 }
2042
2043 //---------------------------------------------------------------------------
2044 // wxAMMediaBackend::GetState
2045 //
2046 // Returns the cached state
2047 //---------------------------------------------------------------------------
2048 wxMediaState wxAMMediaBackend::GetState()
2049 {
2050 StateConstants nState;
2051 #ifdef __WXWINCE__
2052 HRESULT hr = m_pWMP->get_PlayState((long*)&nState);
2053 #else
2054 HRESULT hr = GetAM()->get_CurrentState(&nState);
2055 #endif
2056 if(FAILED(hr))
2057 {
2058 wxAMLOG(hr);
2059 return wxMEDIASTATE_STOPPED;
2060 }
2061
2062 return (wxMediaState)nState;
2063 }
2064
2065 //---------------------------------------------------------------------------
2066 // wxAMMediaBackend::GetPlaybackRate
2067 //
2068 // Pretty simple way of obtaining the playback rate from
2069 // the IActiveMovie interface
2070 //---------------------------------------------------------------------------
2071 double wxAMMediaBackend::GetPlaybackRate()
2072 {
2073 double dRate;
2074 HRESULT hr = GetAM()->get_Rate(&dRate);
2075 if(FAILED(hr))
2076 {
2077 wxAMLOG(hr);
2078 return 0.0;
2079 }
2080 return dRate;
2081 }
2082
2083 //---------------------------------------------------------------------------
2084 // wxAMMediaBackend::SetPlaybackRate
2085 //
2086 // Sets the playback rate of the media - DirectShow is pretty good
2087 // about this, actually
2088 //---------------------------------------------------------------------------
2089 bool wxAMMediaBackend::SetPlaybackRate(double dRate)
2090 {
2091 HRESULT hr = GetAM()->put_Rate(dRate);
2092 if(FAILED(hr))
2093 {
2094 wxAMLOG(hr);
2095 return false;
2096 }
2097
2098 return true;
2099 }
2100
2101 //---------------------------------------------------------------------------
2102 // wxAMMediaBackend::GetDownloadXXX
2103 //
2104 // Queries for and gets the total size of the file and the current
2105 // progress in downloading that file from the IAMOpenProgress
2106 // interface from the media player interface's filter graph
2107 //---------------------------------------------------------------------------
2108 void wxAMMediaBackend::DoGetDownloadProgress(wxLongLong* pLoadProgress,
2109 wxLongLong* pLoadTotal)
2110 {
2111 #ifndef __WXWINCE__
2112 LONGLONG loadTotal = 0, loadProgress = 0;
2113 IUnknown* pFG;
2114 IAMOpenProgress* pOP;
2115 HRESULT hr;
2116 hr = m_pAM->get_FilterGraph(&pFG);
2117 if(SUCCEEDED(hr))
2118 {
2119 hr = pFG->QueryInterface(IID_IAMOpenProgress, (void**)&pOP);
2120 if(SUCCEEDED(hr))
2121 {
2122 hr = pOP->QueryProgress(&loadTotal, &loadProgress);
2123 pOP->Release();
2124 }
2125 pFG->Release();
2126 }
2127
2128 if(SUCCEEDED(hr))
2129 {
2130 *pLoadProgress = loadProgress;
2131 *pLoadTotal = loadTotal;
2132 }
2133 else
2134 #endif
2135 {
2136 // When not loading from a URL QueryProgress will return
2137 // E_NOINTERFACE or whatever
2138 // wxAMFAIL(hr);
2139 *pLoadProgress = 0;
2140 *pLoadTotal = 0;
2141 }
2142 }
2143
2144 //---------------------------------------------------------------------------
2145 // wxAMMediaBackend::GetVideoSize
2146 //
2147 // Obtains the cached original video size
2148 //---------------------------------------------------------------------------
2149 wxSize wxAMMediaBackend::GetVideoSize() const
2150 {
2151 return m_bestSize;
2152 }
2153
2154 //---------------------------------------------------------------------------
2155 // wxAMMediaBackend::Move
2156 //
2157 // We take care of this in our redrawing
2158 //---------------------------------------------------------------------------
2159 void wxAMMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y),
2160 int WXUNUSED(w), int WXUNUSED(h))
2161 {
2162 }
2163
2164 //---------------------------------------------------------------------------
2165 // wxAMMediaBackend::OnActiveX
2166 //
2167 // Handle events sent from our activex control (IActiveMovie/IMediaPlayer).
2168 //
2169 // The weird numbers in the switch statement here are "dispatch ids"
2170 // (the numbers in the id field like ( id(xxx) ) ) from amcompat.idl
2171 // and msdxm.idl.
2172 //---------------------------------------------------------------------------
2173 void wxAMMediaEvtHandler::OnActiveX(wxActiveXEvent& event)
2174 {
2175 switch(event.GetDispatchId())
2176 {
2177 #ifndef __WXWINCE__
2178 case 0x00000001: // statechange in IActiveMovie
2179 case 0x00000bc4: // playstatechange in IMediaPlayer
2180 #else
2181 case 0x00000011: // 17 == playstatechange on IWMP
2182 #endif
2183 if(event.ParamCount() >= 2)
2184 {
2185 switch (event[1].GetInteger())
2186 {
2187 case 0: // stopping
2188 if( m_amb->wxAMMediaBackend::GetPosition() ==
2189 m_amb->wxAMMediaBackend::GetDuration() )
2190 {
2191 if ( m_amb->SendStopEvent() )
2192 {
2193 // Seek to beginning of movie
2194 m_amb->wxAMMediaBackend::SetPosition(0);
2195
2196 // send the event to our child
2197 m_amb->QueueFinishEvent();
2198 }
2199 }
2200 else
2201 {
2202 m_amb->QueueStopEvent();
2203 }
2204 break;
2205 case 1: // pause
2206 m_amb->QueuePauseEvent();
2207 break;
2208 case 2: // play
2209 m_amb->QueuePlayEvent();
2210 break;
2211 default:
2212 break;
2213 }
2214 }
2215 else
2216 event.Skip();
2217 break;
2218
2219 #ifndef __WXWINCE__
2220 case 0x00000032: // opencomplete in IActiveMovie
2221 if(!m_bLoadEventSent)
2222 {
2223 m_amb->FinishLoad();
2224 }
2225 break;
2226
2227 case 0xfffffd9f: // readystatechange in IActiveMovie2 and IMediaPlayer
2228 #else
2229 case 0x00000013: // 19 == readystatechange in IWMP
2230 #endif
2231 if(event.ParamCount() >= 1)
2232 {
2233 if(event[0].GetInteger() == 0)
2234 {
2235 m_bLoadEventSent = false;
2236 }
2237 // Originally this was >= 3 here but on 3 we can't get the
2238 // size of the video (will error) - however on 4
2239 // it won't play on downloaded things until it is
2240 // completely downloaded so we use the lesser of two evils...
2241 else if(event[0].GetInteger() == 3 &&
2242 !m_bLoadEventSent)
2243 {
2244 m_bLoadEventSent = true;
2245 m_amb->FinishLoad();
2246 }
2247 }
2248 else
2249 event.Skip();
2250 break;
2251
2252 default:
2253 event.Skip();
2254 return;
2255 }
2256 }
2257
2258 //---------------------------------------------------------------------------
2259 // End of wxAMMediaBackend
2260 //---------------------------------------------------------------------------
2261
2262 // in source file that contains stuff you don't directly use
2263 #include "wx/html/forcelnk.h"
2264 FORCE_LINK_ME(wxmediabackend_am)
2265
2266 //---------------------------------------------------------------------------
2267 // End wxMediaCtrl Compilation Guard and this file
2268 //---------------------------------------------------------------------------
2269 #endif // wxUSE_MEDIACTRL