1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/mediactrl.cpp
3 // Purpose: Built-in Media Backends for Windows
4 // Author: Ryan Norton <wxprojects@comcast.net>
8 // Copyright: (c) Ryan Norton
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 // extract different backends in different files (better yet, make backends
14 // dynamically loadable...), they have nothing to do with each other and this
15 // file is huge and also separate the standard contents from our code itself
18 //===========================================================================
20 //===========================================================================
22 //---------------------------------------------------------------------------
23 // Pre-compiled header stuff
24 //---------------------------------------------------------------------------
26 // For compilers that support precompilation, includes "wx.h".
27 #include "wx/wxprec.h"
35 #include "wx/mediactrl.h"
39 #include "wx/dcclient.h"
43 #include "wx/math.h" // log10 & pow
44 #include "wx/msw/private.h" // user info and wndproc setting/getting
45 #include "wx/dynlib.h"
47 //---------------------------------------------------------------------------
48 // Externals (somewhere in src/msw/app.cpp and src/msw/window.cpp)
49 //---------------------------------------------------------------------------
50 extern "C" WXDLLIMPEXP_BASE HINSTANCE
wxGetInstance(void);
52 extern WXDLLIMPEXP_CORE wxChar
*wxCanvasClassName
;
54 extern WXDLLIMPEXP_CORE
const wxChar
*wxCanvasClassName
;
57 LRESULT WXDLLIMPEXP_CORE APIENTRY _EXPORT
wxWndProc(HWND hWnd
, UINT message
,
58 WPARAM wParam
, LPARAM lParam
);
60 //---------------------------------------------------------------------------
61 // Killed MSVC warnings
62 //---------------------------------------------------------------------------
63 //disable "cast truncates constant value" for VARIANT_BOOL values
64 //passed as parameters in VC5 and up
66 #pragma warning (disable:4310)
69 //===========================================================================
70 // BACKEND DECLARATIONS
71 //===========================================================================
73 //---------------------------------------------------------------------------
75 //---------------------------------------------------------------------------
77 //---------------------------------------------------------------------------
78 // wxActiveXContainer - includes all the COM-specific stuff we need
79 //---------------------------------------------------------------------------
80 #include "wx/msw/ole/activex.h"
82 //---------------------------------------------------------------------------
83 // IIDS - used by CoCreateInstance and IUnknown::QueryInterface
85 // [idl name] [idl decription]
86 // amcompat.idl Microsoft Active Movie Control (Ver 2.0)
87 // nscompat.idl Microsoft NetShow Player (Ver 1.0)
88 // msdxm.idl Windows Media Player (Ver 1.0)
91 // First, when I say I "from XXX.idl", I mean I go into the COM Browser
92 // ($Microsoft Visual Studio$/Common/Tools/OLEVIEW.EXE), open
93 // "type libraries", open a specific type library (for quartz for example its
94 // "ActiveMovie control type library (V1.0)"), save it as an .idl, compile the
95 // idl using the midl compiler that comes with visual studio
96 // ($Microsoft Visual Studio$/VC98/bin/midl.exe on VC6) with the /h argument
97 // to make it generate stubs (a .h & .c file), then clean up the generated
98 // interfaces I want with the STDMETHOD wrappers and then put them into
101 // According to the MSDN docs, IMediaPlayer requires Windows 98 SE
102 // or greater. NetShow is available on Windows 3.1 and I'm guessing
103 // IActiveMovie is too. IMediaPlayer is essentially the Windows Media
106 // IWMP is from PlayerOCX.idl on PocketPC 2000, which uses CLSID_MediaPlayer
107 // as well as the main windows line.
109 // Some of these are not used but are kept here for future reference anyway
110 //---------------------------------------------------------------------------
111 const IID IID_IActiveMovie
= {0x05589FA2,0xC356,0x11CE,{0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A}};
112 const IID IID_IActiveMovie2
= {0xB6CD6554,0xE9CB,0x11D0,{0x82,0x1F,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
113 const IID IID_IActiveMovie3
= {0x265EC140,0xAE62,0x11D1,{0x85,0x00,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
115 const IID IID_INSOPlay
= {0x2179C5D1,0xEBFF,0x11CF,{0xB6,0xFD,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
116 const IID IID_INSPlay
= {0xE7C4BE80,0x7960,0x11D0,{0xB7,0x27,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
117 const IID IID_INSPlay1
= {0x265EC141,0xAE62,0x11D1,{0x85,0x00,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
119 const IID IID_IMediaPlayer
= {0x22D6F311,0xB0F6,0x11D0,{0x94,0xAB,0x00,0x80,0xC7,0x4C,0x7E,0x95}};
120 const IID IID_IMediaPlayer2
= {0x20D4F5E0,0x5475,0x11D2,{0x97,0x74,0x00,0x00,0xF8,0x08,0x55,0xE6}};
122 const IID IID_IWMP
= {0x136B66EC,0xF30D,0x46A8,{0x88,0xDD,0xF2,0xD0,0x55,0x16,0x3E,0x49}};
124 const CLSID CLSID_ActiveMovie
= {0x05589FA1,0xC356,0x11CE,{0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A}};
125 const CLSID CLSID_MediaPlayer
= {0x22D6F312,0xB0F6,0x11D0,{0x94,0xAB,0x00,0x80,0xC7,0x4C,0x7E,0x95}};
126 const CLSID CLSID_NSPlay
= {0x2179C5D3,0xEBFF,0x11CF,{0xB6,0xFD,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
128 const IID IID_IAMOpenProgress
= {0x8E1C39A1, 0xDE53, 0x11CF,{0xAA, 0x63, 0x00, 0x80, 0xC7, 0x44, 0x52, 0x8D}};
131 const CLSID CLSID_FilgraphManager
= {0xE436EBB3,0x524F,0x11CE,{0x9F,0x53,0x00,0x20,0xAF,0x0B,0xA7,0x70}};
132 const IID IID_IMediaEvent
= {0x56A868B6,0x0AD4,0x11CE,{0xB0,0x3A,0x00,0x20,0xAF,0x0B,0xA7,0x70}};
135 const CLSID CLSID_VideoMixingRenderer9
={0x51B4ABF3, 0x748F, 0x4E3B,{0xA2, 0x76, 0xC8, 0x28, 0x33, 0x0E, 0x92, 0x6A}};
136 const IID IID_IVMRWindowlessControl9
= {0x8F537D09, 0xF85E, 0x4414,{0xB2, 0x3B, 0x50, 0x2E, 0x54, 0xC7, 0x99, 0x27}};
137 const IID IID_IFilterGraph
= {0x56A8689F, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
138 const IID IID_IGraphBuilder
= {0x56A868A9, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
139 const IID IID_IVMRFilterConfig9
= {0x5A804648, 0x4F66, 0x4867,{0x9C, 0x43, 0x4F, 0x5C, 0x82, 0x2C, 0xF1, 0xB8}};
140 const IID IID_IBaseFilter
= {0x56A86895, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
142 //---------------------------------------------------------------------------
143 // QUARTZ COM INTERFACES (dumped from quartz.idl from MSVC COM Browser)
144 //---------------------------------------------------------------------------
146 struct IAMOpenProgress
: public IUnknown
148 STDMETHOD(QueryProgress
)(LONGLONG
*pllTotal
, LONGLONG
*pllCurrent
) PURE
;
149 STDMETHOD(AbortOperation
)(void) PURE
;
152 struct IMediaEvent
: public IDispatch
154 STDMETHOD(GetEventHandle
)(LONG_PTR
*) PURE
;
155 STDMETHOD(GetEvent
)(long *, LONG_PTR
*, LONG_PTR
*, long) PURE
;
156 STDMETHOD(WaitForCompletion
)(long, long *) PURE
;
157 STDMETHOD(CancelDefaultHandling
)(long) PURE
;
158 STDMETHOD(RestoreDefaultHandling
)(long) PURE
;
159 STDMETHOD(FreeEventParams
)(long, LONG_PTR
, LONG_PTR
) PURE
;
162 //---------------------------------------------------------------------------
163 // ACTIVEMOVIE COM INTERFACES (dumped from amcompat.idl from MSVC COM Browser)
164 //---------------------------------------------------------------------------
166 enum ReadyStateConstants
168 amvUninitialized
= 0,
182 enum DisplayModeConstants
188 enum WindowSizeConstants
191 amvDoubleOriginalSize
= 1,
192 amvOneSixteenthScreen
= 2,
193 amvOneFourthScreen
= 3,
197 enum AppearanceConstants
203 enum BorderStyleConstants
209 struct IActiveMovie
: public IDispatch
211 STDMETHOD(AboutBox
)( void) PURE
;
212 STDMETHOD(Run
)( void) PURE
;
213 STDMETHOD(Pause
)( void) PURE
;
214 STDMETHOD(Stop
)( void) PURE
;
215 STDMETHOD(get_ImageSourceWidth
)(long __RPC_FAR
*pWidth
) PURE
;
216 STDMETHOD(get_ImageSourceHeight
)(long __RPC_FAR
*pHeight
) PURE
;
217 STDMETHOD(get_Author
)(BSTR __RPC_FAR
*pbstrAuthor
) PURE
;
218 STDMETHOD(get_Title
)(BSTR __RPC_FAR
*pbstrTitle
) PURE
;
219 STDMETHOD(get_Copyright
)(BSTR __RPC_FAR
*pbstrCopyright
) PURE
;
220 STDMETHOD(get_Description
)(BSTR __RPC_FAR
*pbstrDescription
) PURE
;
221 STDMETHOD(get_Rating
)(BSTR __RPC_FAR
*pbstrRating
) PURE
;
222 STDMETHOD(get_FileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
223 STDMETHOD(put_FileName
)(BSTR pbstrFileName
) PURE
;
224 STDMETHOD(get_Duration
)(double __RPC_FAR
*pValue
) PURE
;
225 STDMETHOD(get_CurrentPosition
)(double __RPC_FAR
*pValue
) PURE
;
226 STDMETHOD(put_CurrentPosition
)(double pValue
) PURE
;
227 STDMETHOD(get_PlayCount
)(long __RPC_FAR
*pPlayCount
) PURE
;
228 STDMETHOD(put_PlayCount
)(long pPlayCount
) PURE
;
229 STDMETHOD(get_SelectionStart
)(double __RPC_FAR
*pValue
) PURE
;
230 STDMETHOD(put_SelectionStart
)(double pValue
) PURE
;
231 STDMETHOD(get_SelectionEnd
)(double __RPC_FAR
*pValue
) PURE
;
232 STDMETHOD(put_SelectionEnd
)(double pValue
) PURE
;
233 STDMETHOD(get_CurrentState
)(StateConstants __RPC_FAR
*pState
) PURE
;
234 STDMETHOD(get_Rate
)(double __RPC_FAR
*pValue
) PURE
;
235 STDMETHOD(put_Rate
)(double pValue
) PURE
;
236 STDMETHOD(get_Volume
)(long __RPC_FAR
*pValue
) PURE
;
237 STDMETHOD(put_Volume
)(long pValue
) PURE
;
238 STDMETHOD(get_Balance
)(long __RPC_FAR
*pValue
) PURE
;
239 STDMETHOD(put_Balance
)(long pValue
) PURE
;
240 STDMETHOD(get_EnableContextMenu
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
241 STDMETHOD(put_EnableContextMenu
)(VARIANT_BOOL pEnable
) PURE
;
242 STDMETHOD(get_ShowDisplay
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
243 STDMETHOD(put_ShowDisplay
)(VARIANT_BOOL Show
) PURE
;
244 STDMETHOD(get_ShowControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
245 STDMETHOD(put_ShowControls
)(VARIANT_BOOL Show
) PURE
;
246 STDMETHOD(get_ShowPositionControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
247 STDMETHOD(put_ShowPositionControls
)(VARIANT_BOOL Show
) PURE
;
248 STDMETHOD(get_ShowSelectionControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
249 STDMETHOD(put_ShowSelectionControls
)(VARIANT_BOOL Show
) PURE
;
250 STDMETHOD(get_ShowTracker
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
251 STDMETHOD(put_ShowTracker
)(VARIANT_BOOL Show
) PURE
;
252 STDMETHOD(get_EnablePositionControls
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
253 STDMETHOD(put_EnablePositionControls
)(VARIANT_BOOL Enable
) PURE
;
254 STDMETHOD(get_EnableSelectionControls
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
255 STDMETHOD(put_EnableSelectionControls
)(VARIANT_BOOL Enable
) PURE
;
256 STDMETHOD(get_EnableTracker
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
257 STDMETHOD(put_EnableTracker
)(VARIANT_BOOL Enable
) PURE
;
258 STDMETHOD(get_AllowHideDisplay
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
259 STDMETHOD(put_AllowHideDisplay
)(VARIANT_BOOL Show
) PURE
;
260 STDMETHOD(get_AllowHideControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
261 STDMETHOD(put_AllowHideControls
)(VARIANT_BOOL Show
) PURE
;
262 STDMETHOD(get_DisplayMode
)(DisplayModeConstants __RPC_FAR
*pValue
) PURE
;
263 STDMETHOD(put_DisplayMode
)(DisplayModeConstants pValue
) PURE
;
264 STDMETHOD(get_AllowChangeDisplayMode
)(VARIANT_BOOL __RPC_FAR
*fAllow
) PURE
;
265 STDMETHOD(put_AllowChangeDisplayMode
)(VARIANT_BOOL fAllow
) PURE
;
266 STDMETHOD(get_FilterGraph
)(IUnknown __RPC_FAR
*__RPC_FAR
*ppFilterGraph
) PURE
;
267 STDMETHOD(put_FilterGraph
)(IUnknown __RPC_FAR
*ppFilterGraph
) PURE
;
268 STDMETHOD(get_FilterGraphDispatch
)(IDispatch __RPC_FAR
*__RPC_FAR
*pDispatch
) PURE
;
269 STDMETHOD(get_DisplayForeColor
)(unsigned long __RPC_FAR
*ForeColor
) PURE
;
270 STDMETHOD(put_DisplayForeColor
)(unsigned long ForeColor
) PURE
;
271 STDMETHOD(get_DisplayBackColor
)(unsigned long __RPC_FAR
*BackColor
) PURE
;
272 STDMETHOD(put_DisplayBackColor
)(unsigned long BackColor
) PURE
;
273 STDMETHOD(get_MovieWindowSize
)(WindowSizeConstants __RPC_FAR
*WindowSize
) PURE
;
274 STDMETHOD(put_MovieWindowSize
)(WindowSizeConstants WindowSize
) PURE
;
275 STDMETHOD(get_FullScreenMode
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
276 STDMETHOD(put_FullScreenMode
)(VARIANT_BOOL pEnable
) PURE
;
277 STDMETHOD(get_AutoStart
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
278 STDMETHOD(put_AutoStart
)(VARIANT_BOOL pEnable
) PURE
;
279 STDMETHOD(get_AutoRewind
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
280 STDMETHOD(put_AutoRewind
)(VARIANT_BOOL pEnable
) PURE
;
281 STDMETHOD(get_hWnd
)(long __RPC_FAR
*hWnd
) PURE
;
282 STDMETHOD(get_Appearance
)(AppearanceConstants __RPC_FAR
*pAppearance
) PURE
;
283 STDMETHOD(put_Appearance
)(AppearanceConstants pAppearance
) PURE
;
284 STDMETHOD(get_BorderStyle
)(BorderStyleConstants __RPC_FAR
*pBorderStyle
) PURE
;
285 STDMETHOD(put_BorderStyle
)(BorderStyleConstants pBorderStyle
) PURE
;
286 STDMETHOD(get_Enabled
)(VARIANT_BOOL __RPC_FAR
*pEnabled
) PURE
;
287 STDMETHOD(put_Enabled
)(VARIANT_BOOL pEnabled
) PURE
;
288 STDMETHOD(get_Info
)(long __RPC_FAR
*ppInfo
) PURE
;
292 struct IActiveMovie2
: public IActiveMovie
294 STDMETHOD(IsSoundCardEnabled
)(VARIANT_BOOL __RPC_FAR
*pbSoundCard
) PURE
;
295 STDMETHOD(get_ReadyState
)(ReadyStateConstants __RPC_FAR
*pValue
) PURE
;
298 struct IActiveMovie3
: public IActiveMovie2
300 STDMETHOD(get_MediaPlayer
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppDispatch
) PURE
;
304 //---------------------------------------------------------------------------
305 // MEDIAPLAYER COM INTERFACES (dumped from msdxm.idl from MSVC COM Browser)
306 //---------------------------------------------------------------------------
308 enum MPPlayStateConstants
319 enum MPDisplaySizeConstants
326 mpOneSixteenthScreen
= 5,
327 mpOneFourthScreen
= 6,
331 enum MPReadyStateConstants
333 mpReadyStateUninitialized
= 0,
334 mpReadyStateLoading
= 1,
335 mpReadyStateInteractive
= 3,
336 mpReadyStateComplete
= 4
339 typedef unsigned long VB_OLE_COLOR
;
341 enum MPDisplayModeConstants
361 mpShowDescription
= 5,
366 mpClipCopyright
= 10,
368 mpClipDescription
= 12,
371 mpBannerMoreInfo
= 15,
375 enum DVDMenuIDConstants
379 dvdMenu_Subpicture
= 4,
385 enum MPShowDialogConstants
387 mpShowDialogHelp
= 0,
388 mpShowDialogStatistics
= 1,
389 mpShowDialogOptions
= 2,
390 mpShowDialogContextMenu
= 3
394 struct IMediaPlayer
: public IDispatch
396 STDMETHOD(get_CurrentPosition
)(double __RPC_FAR
*pCurrentPosition
) PURE
;
397 STDMETHOD(put_CurrentPosition
)(double pCurrentPosition
) PURE
;
398 STDMETHOD(get_Duration
)(double __RPC_FAR
*pDuration
) PURE
;
399 STDMETHOD(get_ImageSourceWidth
)(long __RPC_FAR
*pWidth
) PURE
;
400 STDMETHOD(get_ImageSourceHeight
)(long __RPC_FAR
*pHeight
) PURE
;
401 STDMETHOD(get_MarkerCount
)(long __RPC_FAR
*pMarkerCount
) PURE
;
402 STDMETHOD(get_CanScan
)(VARIANT_BOOL __RPC_FAR
*pCanScan
) PURE
;
403 STDMETHOD(get_CanSeek
)(VARIANT_BOOL __RPC_FAR
*pCanSeek
) PURE
;
404 STDMETHOD(get_CanSeekToMarkers
)(VARIANT_BOOL __RPC_FAR
*pCanSeekToMarkers
) PURE
;
405 STDMETHOD(get_CurrentMarker
)(long __RPC_FAR
*pCurrentMarker
) PURE
;
406 STDMETHOD(put_CurrentMarker
)(long pCurrentMarker
) PURE
;
407 STDMETHOD(get_FileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
408 STDMETHOD(put_FileName
)(BSTR pbstrFileName
) PURE
;
409 STDMETHOD(get_SourceLink
)(BSTR __RPC_FAR
*pbstrSourceLink
) PURE
;
410 STDMETHOD(get_CreationDate
)(DATE __RPC_FAR
*pCreationDate
) PURE
;
411 STDMETHOD(get_ErrorCorrection
)(BSTR __RPC_FAR
*pbstrErrorCorrection
) PURE
;
412 STDMETHOD(get_Bandwidth
)(long __RPC_FAR
*pBandwidth
) PURE
;
413 STDMETHOD(get_SourceProtocol
)(long __RPC_FAR
*pSourceProtocol
) PURE
;
414 STDMETHOD(get_ReceivedPackets
)(long __RPC_FAR
*pReceivedPackets
) PURE
;
415 STDMETHOD(get_RecoveredPackets
)(long __RPC_FAR
*pRecoveredPackets
) PURE
;
416 STDMETHOD(get_LostPackets
)(long __RPC_FAR
*pLostPackets
) PURE
;
417 STDMETHOD(get_ReceptionQuality
)(long __RPC_FAR
*pReceptionQuality
) PURE
;
418 STDMETHOD(get_BufferingCount
)(long __RPC_FAR
*pBufferingCount
) PURE
;
419 STDMETHOD(get_IsBroadcast
)(VARIANT_BOOL __RPC_FAR
*pIsBroadcast
) PURE
;
420 STDMETHOD(get_BufferingProgress
)(long __RPC_FAR
*pBufferingProgress
) PURE
;
421 STDMETHOD(get_ChannelName
)(BSTR __RPC_FAR
*pbstrChannelName
) PURE
;
422 STDMETHOD(get_ChannelDescription
)(BSTR __RPC_FAR
*pbstrChannelDescription
) PURE
;
423 STDMETHOD(get_ChannelURL
)(BSTR __RPC_FAR
*pbstrChannelURL
) PURE
;
424 STDMETHOD(get_ContactAddress
)(BSTR __RPC_FAR
*pbstrContactAddress
) PURE
;
425 STDMETHOD(get_ContactPhone
)(BSTR __RPC_FAR
*pbstrContactPhone
) PURE
;
426 STDMETHOD(get_ContactEmail
)(BSTR __RPC_FAR
*pbstrContactEmail
) PURE
;
427 STDMETHOD(get_BufferingTime
)(double __RPC_FAR
*pBufferingTime
) PURE
;
428 STDMETHOD(put_BufferingTime
)(double pBufferingTime
) PURE
;
429 STDMETHOD(get_AutoStart
)(VARIANT_BOOL __RPC_FAR
*pAutoStart
) PURE
;
430 STDMETHOD(put_AutoStart
)(VARIANT_BOOL pAutoStart
) PURE
;
431 STDMETHOD(get_AutoRewind
)(VARIANT_BOOL __RPC_FAR
*pAutoRewind
) PURE
;
432 STDMETHOD(put_AutoRewind
)(VARIANT_BOOL pAutoRewind
) PURE
;
433 STDMETHOD(get_Rate
)(double __RPC_FAR
*pRate
) PURE
;
434 STDMETHOD(put_Rate
)(double pRate
) PURE
;
435 STDMETHOD(get_SendKeyboardEvents
)(VARIANT_BOOL __RPC_FAR
*pSendKeyboardEvents
) PURE
;
436 STDMETHOD(put_SendKeyboardEvents
)(VARIANT_BOOL pSendKeyboardEvents
) PURE
;
437 STDMETHOD(get_SendMouseClickEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseClickEvents
) PURE
;
438 STDMETHOD(put_SendMouseClickEvents
)(VARIANT_BOOL pSendMouseClickEvents
) PURE
;
439 STDMETHOD(get_SendMouseMoveEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseMoveEvents
) PURE
;
440 STDMETHOD(put_SendMouseMoveEvents
)(VARIANT_BOOL pSendMouseMoveEvents
) PURE
;
441 STDMETHOD(get_PlayCount
)(long __RPC_FAR
*pPlayCount
) PURE
;
442 STDMETHOD(put_PlayCount
)(long pPlayCount
) PURE
;
443 STDMETHOD(get_ClickToPlay
)(VARIANT_BOOL __RPC_FAR
*pClickToPlay
) PURE
;
444 STDMETHOD(put_ClickToPlay
)(VARIANT_BOOL pClickToPlay
) PURE
;
445 STDMETHOD(get_AllowScan
)(VARIANT_BOOL __RPC_FAR
*pAllowScan
) PURE
;
446 STDMETHOD(put_AllowScan
)(VARIANT_BOOL pAllowScan
) PURE
;
447 STDMETHOD(get_EnableContextMenu
)(VARIANT_BOOL __RPC_FAR
*pEnableContextMenu
) PURE
;
448 STDMETHOD(put_EnableContextMenu
)(VARIANT_BOOL pEnableContextMenu
) PURE
;
449 STDMETHOD(get_CursorType
)(long __RPC_FAR
*pCursorType
) PURE
;
450 STDMETHOD(put_CursorType
)(long pCursorType
) PURE
;
451 STDMETHOD(get_CodecCount
)(long __RPC_FAR
*pCodecCount
) PURE
;
452 STDMETHOD(get_AllowChangeDisplaySize
)(VARIANT_BOOL __RPC_FAR
*pAllowChangeDisplaySize
) PURE
;
453 STDMETHOD(put_AllowChangeDisplaySize
)( VARIANT_BOOL pAllowChangeDisplaySize
) PURE
;
454 STDMETHOD(get_IsDurationValid
)(VARIANT_BOOL __RPC_FAR
*pIsDurationValid
) PURE
;
455 STDMETHOD(get_OpenState
)(long __RPC_FAR
*pOpenState
) PURE
;
456 STDMETHOD(get_SendOpenStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendOpenStateChangeEvents
) PURE
;
457 STDMETHOD(put_SendOpenStateChangeEvents
)(VARIANT_BOOL pSendOpenStateChangeEvents
) PURE
;
458 STDMETHOD(get_SendWarningEvents
)( VARIANT_BOOL __RPC_FAR
*pSendWarningEvents
) PURE
;
459 STDMETHOD(put_SendWarningEvents
)(VARIANT_BOOL pSendWarningEvents
) PURE
;
460 STDMETHOD(get_SendErrorEvents
)(VARIANT_BOOL __RPC_FAR
*pSendErrorEvents
) PURE
;
461 STDMETHOD(put_SendErrorEvents
)(VARIANT_BOOL pSendErrorEvents
) PURE
;
462 STDMETHOD(get_PlayState
)(MPPlayStateConstants __RPC_FAR
*pPlayState
) PURE
;
463 STDMETHOD(get_SendPlayStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendPlayStateChangeEvents
) PURE
;
464 STDMETHOD(put_SendPlayStateChangeEvents
)(VARIANT_BOOL pSendPlayStateChangeEvents
) PURE
;
465 STDMETHOD(get_DisplaySize
)(MPDisplaySizeConstants __RPC_FAR
*pDisplaySize
) PURE
;
466 STDMETHOD(put_DisplaySize
)(MPDisplaySizeConstants pDisplaySize
) PURE
;
467 STDMETHOD(get_InvokeURLs
)(VARIANT_BOOL __RPC_FAR
*pInvokeURLs
) PURE
;
468 STDMETHOD(put_InvokeURLs
)(VARIANT_BOOL pInvokeURLs
) PURE
;
469 STDMETHOD(get_BaseURL
)(BSTR __RPC_FAR
*pbstrBaseURL
) PURE
;
470 STDMETHOD(put_BaseURL
)(BSTR pbstrBaseURL
) PURE
;
471 STDMETHOD(get_DefaultFrame
)(BSTR __RPC_FAR
*pbstrDefaultFrame
) PURE
;
472 STDMETHOD(put_DefaultFrame
)(BSTR pbstrDefaultFrame
) PURE
;
473 STDMETHOD(get_HasError
)(VARIANT_BOOL __RPC_FAR
*pHasError
) PURE
;
474 STDMETHOD(get_ErrorDescription
)(BSTR __RPC_FAR
*pbstrErrorDescription
) PURE
;
475 STDMETHOD(get_ErrorCode
)(long __RPC_FAR
*pErrorCode
) PURE
;
476 STDMETHOD(get_AnimationAtStart
)(VARIANT_BOOL __RPC_FAR
*pAnimationAtStart
) PURE
;
477 STDMETHOD(put_AnimationAtStart
)(VARIANT_BOOL pAnimationAtStart
) PURE
;
478 STDMETHOD(get_TransparentAtStart
)( VARIANT_BOOL __RPC_FAR
*pTransparentAtStart
) PURE
;
479 STDMETHOD(put_TransparentAtStart
)(VARIANT_BOOL pTransparentAtStart
) PURE
;
480 STDMETHOD(get_Volume
)(long __RPC_FAR
*pVolume
) PURE
;
481 STDMETHOD(put_Volume
)(long pVolume
) PURE
;
482 STDMETHOD(get_Balance
)(long __RPC_FAR
*pBalance
) PURE
;
483 STDMETHOD(put_Balance
)(long pBalance
) PURE
;
484 STDMETHOD(get_ReadyState
)(MPReadyStateConstants __RPC_FAR
*pValue
) PURE
;
485 STDMETHOD(get_SelectionStart
)(double __RPC_FAR
*pValue
) PURE
;
486 STDMETHOD(put_SelectionStart
)(double pValue
) PURE
;
487 STDMETHOD(get_SelectionEnd
)(double __RPC_FAR
*pValue
) PURE
;
488 STDMETHOD(put_SelectionEnd
)(double pValue
) PURE
;
489 STDMETHOD(get_ShowDisplay
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
490 STDMETHOD(put_ShowDisplay
)(VARIANT_BOOL Show
) PURE
;
491 STDMETHOD(get_ShowControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
492 STDMETHOD(put_ShowControls
)(VARIANT_BOOL Show
) PURE
;
493 STDMETHOD(get_ShowPositionControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
494 STDMETHOD(put_ShowPositionControls
)(VARIANT_BOOL Show
) PURE
;
495 STDMETHOD(get_ShowTracker
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
496 STDMETHOD(put_ShowTracker
)(VARIANT_BOOL Show
) PURE
;
497 STDMETHOD(get_EnablePositionControls
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
498 STDMETHOD(put_EnablePositionControls
)(VARIANT_BOOL Enable
) PURE
;
499 STDMETHOD(get_EnableTracker
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
500 STDMETHOD(put_EnableTracker
)(VARIANT_BOOL Enable
) PURE
;
501 STDMETHOD(get_Enabled
)(VARIANT_BOOL __RPC_FAR
*pEnabled
) PURE
;
502 STDMETHOD(put_Enabled
)(VARIANT_BOOL pEnabled
) PURE
;
503 STDMETHOD(get_DisplayForeColor
)(VB_OLE_COLOR __RPC_FAR
*ForeColor
) PURE
;
504 STDMETHOD(put_DisplayForeColor
)(VB_OLE_COLOR ForeColor
) PURE
;
505 STDMETHOD(get_DisplayBackColor
)(VB_OLE_COLOR __RPC_FAR
*BackColor
) PURE
;
506 STDMETHOD(put_DisplayBackColor
)(VB_OLE_COLOR BackColor
) PURE
;
507 STDMETHOD(get_DisplayMode
)(MPDisplayModeConstants __RPC_FAR
*pValue
) PURE
;
508 STDMETHOD(put_DisplayMode
)(MPDisplayModeConstants pValue
) PURE
;
509 STDMETHOD(get_VideoBorder3D
)(VARIANT_BOOL __RPC_FAR
*pVideoBorderWidth
) PURE
;
510 STDMETHOD(put_VideoBorder3D
)(VARIANT_BOOL pVideoBorderWidth
) PURE
;
511 STDMETHOD(get_VideoBorderWidth
)(long __RPC_FAR
*pVideoBorderWidth
) PURE
;
512 STDMETHOD(put_VideoBorderWidth
)(long pVideoBorderWidth
) PURE
;
513 STDMETHOD(get_VideoBorderColor
)(VB_OLE_COLOR __RPC_FAR
*pVideoBorderWidth
) PURE
;
514 STDMETHOD(put_VideoBorderColor
)(VB_OLE_COLOR pVideoBorderWidth
) PURE
;
515 STDMETHOD(get_ShowGotoBar
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
516 STDMETHOD(put_ShowGotoBar
)(VARIANT_BOOL pbool
) PURE
;
517 STDMETHOD(get_ShowStatusBar
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
518 STDMETHOD(put_ShowStatusBar
)(VARIANT_BOOL pbool
) PURE
;
519 STDMETHOD(get_ShowCaptioning
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
520 STDMETHOD(put_ShowCaptioning
)(VARIANT_BOOL pbool
) PURE
;
521 STDMETHOD(get_ShowAudioControls
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
522 STDMETHOD(put_ShowAudioControls
)(VARIANT_BOOL pbool
) PURE
;
523 STDMETHOD(get_CaptioningID
)( BSTR __RPC_FAR
*pstrText
) PURE
;
524 STDMETHOD(put_CaptioningID
)(BSTR pstrText
) PURE
;
525 STDMETHOD(get_Mute
)(VARIANT_BOOL __RPC_FAR
*vbool
) PURE
;
526 STDMETHOD(put_Mute
)(VARIANT_BOOL vbool
) PURE
;
527 STDMETHOD(get_CanPreview
)(VARIANT_BOOL __RPC_FAR
*pCanPreview
) PURE
;
528 STDMETHOD(get_PreviewMode
)(VARIANT_BOOL __RPC_FAR
*pPreviewMode
) PURE
;
529 STDMETHOD(put_PreviewMode
)(VARIANT_BOOL pPreviewMode
) PURE
;
530 STDMETHOD(get_HasMultipleItems
)(VARIANT_BOOL __RPC_FAR
*pHasMuliItems
) PURE
;
531 STDMETHOD(get_Language
)(long __RPC_FAR
*pLanguage
) PURE
;
532 STDMETHOD(put_Language
)(long pLanguage
) PURE
;
533 STDMETHOD(get_AudioStream
)(long __RPC_FAR
*pStream
) PURE
;
534 STDMETHOD(put_AudioStream
)(long pStream
) PURE
;
535 STDMETHOD(get_SAMIStyle
)(BSTR __RPC_FAR
*pbstrStyle
) PURE
;
536 STDMETHOD(put_SAMIStyle
)(BSTR pbstrStyle
) PURE
;
537 STDMETHOD(get_SAMILang
)(BSTR __RPC_FAR
*pbstrLang
) PURE
;
538 STDMETHOD(put_SAMILang
)(BSTR pbstrLang
) PURE
;
539 STDMETHOD(get_SAMIFileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
540 STDMETHOD(put_SAMIFileName
)(BSTR pbstrFileName
) PURE
;
541 STDMETHOD(get_StreamCount
)( long __RPC_FAR
*pStreamCount
) PURE
;
542 STDMETHOD(get_ClientId
)(BSTR __RPC_FAR
*pbstrClientId
) PURE
;
543 STDMETHOD(get_ConnectionSpeed
)(long __RPC_FAR
*plConnectionSpeed
) PURE
;
544 STDMETHOD(get_AutoSize
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
545 STDMETHOD(put_AutoSize
)(VARIANT_BOOL pbool
) PURE
;
546 STDMETHOD(get_EnableFullScreenControls
)(VARIANT_BOOL __RPC_FAR
*pbVal
) PURE
;
547 STDMETHOD(put_EnableFullScreenControls
)(VARIANT_BOOL pbVal
) PURE
;
548 STDMETHOD(get_ActiveMovie
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
549 STDMETHOD(get_NSPlay
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
550 STDMETHOD(get_WindowlessVideo
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
551 STDMETHOD(put_WindowlessVideo
)(VARIANT_BOOL pbool
) PURE
;
552 STDMETHOD(Play
)(void) PURE
;
553 STDMETHOD(Stop
)(void) PURE
;
554 STDMETHOD(Pause
)(void) PURE
;
555 STDMETHOD(GetMarkerTime
)(long MarkerNum
,
556 double __RPC_FAR
*pMarkerTime
) PURE
;
557 STDMETHOD(GetMarkerName
)(long MarkerNum
,
558 BSTR __RPC_FAR
*pbstrMarkerName
) PURE
;
559 STDMETHOD(AboutBox
)(void) PURE
;
560 STDMETHOD(GetCodecInstalled
)(long CodecNum
,
561 VARIANT_BOOL __RPC_FAR
*pCodecInstalled
) PURE
;
562 STDMETHOD(GetCodecDescription
)(long CodecNum
,
563 BSTR __RPC_FAR
*pbstrCodecDescription
) PURE
;
564 STDMETHOD(GetCodecURL
)(long CodecNum
,
565 BSTR __RPC_FAR
*pbstrCodecURL
) PURE
;
566 STDMETHOD(GetMoreInfoURL
)(MPMoreInfoType MoreInfoType
,
567 BSTR __RPC_FAR
*pbstrMoreInfoURL
) PURE
;
568 STDMETHOD(GetMediaInfoString
)(MPMediaInfoType MediaInfoType
,
569 BSTR __RPC_FAR
*pbstrMediaInfo
) PURE
;
570 STDMETHOD(Cancel
)(void) PURE
;
571 STDMETHOD(Open
)(BSTR bstrFileName
) PURE
;
572 STDMETHOD(IsSoundCardEnabled
)(VARIANT_BOOL __RPC_FAR
*pbSoundCard
) PURE
;
573 STDMETHOD(Next
)(void) PURE
;
574 STDMETHOD(Previous
)(void) PURE
;
575 STDMETHOD(StreamSelect
)(long StreamNum
) PURE
;
576 STDMETHOD(FastForward
)(void) PURE
;
577 STDMETHOD(FastReverse
)(void) PURE
;
578 STDMETHOD(GetStreamName
)(long StreamNum
,
579 BSTR __RPC_FAR
*pbstrStreamName
) PURE
;
580 STDMETHOD(GetStreamGroup
)(long StreamNum
,
581 long __RPC_FAR
*pStreamGroup
) PURE
;
582 STDMETHOD(GetStreamSelected
)(long StreamNum
, VARIANT_BOOL __RPC_FAR
*pStreamSelected
) PURE
;
585 struct IMediaPlayer2
: public IMediaPlayer
587 STDMETHOD(get_DVD
)(struct IMediaPlayerDvd __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
588 STDMETHOD(GetMediaParameter
)(long EntryNum
, BSTR bstrParameterName
, BSTR __RPC_FAR
*pbstrParameterValue
) PURE
;
589 STDMETHOD(GetMediaParameterName(long EntryNum
, long Index
, BSTR __RPC_FAR
*pbstrParameterName
) PURE
;
590 STDMETHOD(get_EntryCount
)(long __RPC_FAR
*pNumberEntries
) PURE
;
591 STDMETHOD(GetCurrentEntry
)(long __RPC_FAR
*pEntryNumber
) PURE
;
592 STDMETHOD(SetCurrentEntry
)(long EntryNumber
) PURE
;
593 STDMETHOD(ShowDialog
)(MPShowDialogConstants mpDialogIndex
) PURE
;
596 //---------------------------------------------------------------------------
597 // NETSHOW COM INTERFACES (dumped from nscompat.idl from MSVC COM Browser)
598 //---------------------------------------------------------------------------
600 struct INSOPlay
: public IDispatch
602 STDMETHOD(get_ImageSourceWidth
)(long __RPC_FAR
*pWidth
) PURE
;
603 STDMETHOD(get_ImageSourceHeight
)(long __RPC_FAR
*pHeight
) PURE
;
604 STDMETHOD(get_Duration
)(double __RPC_FAR
*pDuration
) PURE
;
605 STDMETHOD(get_Author
)(BSTR __RPC_FAR
*pbstrAuthor
) PURE
;
606 STDMETHOD(get_Copyright
)(BSTR __RPC_FAR
*pbstrCopyright
) PURE
;
607 STDMETHOD(get_Description
)(BSTR __RPC_FAR
*pbstrDescription
) PURE
;
608 STDMETHOD(get_Rating
)(BSTR __RPC_FAR
*pbstrRating
) PURE
;
609 STDMETHOD(get_Title
)(BSTR __RPC_FAR
*pbstrTitle
) PURE
;
610 STDMETHOD(get_SourceLink
)(BSTR __RPC_FAR
*pbstrSourceLink
) PURE
;
611 STDMETHOD(get_MarkerCount
)(long __RPC_FAR
*pMarkerCount
) PURE
;
612 STDMETHOD(get_CanScan
)(VARIANT_BOOL __RPC_FAR
*pCanScan
) PURE
;
613 STDMETHOD(get_CanSeek
)(VARIANT_BOOL __RPC_FAR
*pCanSeek
) PURE
;
614 STDMETHOD(get_CanSeekToMarkers
)(VARIANT_BOOL __RPC_FAR
*pCanSeekToMarkers
) PURE
;
615 STDMETHOD(get_CreationDate
)(DATE __RPC_FAR
*pCreationDate
) PURE
;
616 STDMETHOD(get_Bandwidth
)(long __RPC_FAR
*pBandwidth
) PURE
;
617 STDMETHOD(get_ErrorCorrection
)(BSTR __RPC_FAR
*pbstrErrorCorrection
) PURE
;
618 STDMETHOD(get_AutoStart
)(VARIANT_BOOL __RPC_FAR
*pAutoStart
) PURE
;
619 STDMETHOD(put_AutoStart
)(VARIANT_BOOL pAutoStart
) PURE
;
620 STDMETHOD(get_AutoRewind
)(VARIANT_BOOL __RPC_FAR
*pAutoRewind
) PURE
;
621 STDMETHOD(put_AutoRewind
)(VARIANT_BOOL pAutoRewind
) PURE
;
622 STDMETHOD(get_AllowChangeControlType
)(VARIANT_BOOL __RPC_FAR
*pAllowChangeControlType
) PURE
;
623 STDMETHOD(put_AllowChangeControlType
)(VARIANT_BOOL pAllowChangeControlType
) PURE
;
624 STDMETHOD(get_InvokeURLs
)(VARIANT_BOOL __RPC_FAR
*pInvokeURLs
) PURE
;
625 STDMETHOD(put_InvokeURLs
)(VARIANT_BOOL pInvokeURLs
) PURE
;
626 STDMETHOD(get_EnableContextMenu
)(VARIANT_BOOL __RPC_FAR
*pEnableContextMenu
) PURE
;
627 STDMETHOD(put_EnableContextMenu
)(VARIANT_BOOL pEnableContextMenu
) PURE
;
628 STDMETHOD(get_TransparentAtStart
)(VARIANT_BOOL __RPC_FAR
*pTransparentAtStart
) PURE
;
629 STDMETHOD(put_TransparentAtStart
)(VARIANT_BOOL pTransparentAtStart
) PURE
;
630 STDMETHOD(get_TransparentOnStop
)(VARIANT_BOOL __RPC_FAR
*pTransparentOnStop
) PURE
;
631 STDMETHOD(put_TransparentOnStop
)(VARIANT_BOOL pTransparentOnStop
) PURE
;
632 STDMETHOD(get_ClickToPlay
)(VARIANT_BOOL __RPC_FAR
*pClickToPlay
) PURE
;
633 STDMETHOD(put_ClickToPlay
)(VARIANT_BOOL pClickToPlay
) PURE
;
634 STDMETHOD(get_FileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
635 STDMETHOD(put_FileName
)(BSTR pbstrFileName
) PURE
;
636 STDMETHOD(get_CurrentPosition
)(double __RPC_FAR
*pCurrentPosition
) PURE
;
637 STDMETHOD(put_CurrentPosition
)(double pCurrentPosition
) PURE
;
638 STDMETHOD(get_Rate
)(double __RPC_FAR
*pRate
) PURE
;
639 STDMETHOD(put_Rate
)(double pRate
) PURE
;
640 STDMETHOD(get_CurrentMarker
)(long __RPC_FAR
*pCurrentMarker
) PURE
;
641 STDMETHOD(put_CurrentMarker
)(long pCurrentMarker
) PURE
;
642 STDMETHOD(get_PlayCount
)(long __RPC_FAR
*pPlayCount
) PURE
;
643 STDMETHOD(put_PlayCount
)(long pPlayCount
) PURE
;
644 STDMETHOD(get_CurrentState
)(long __RPC_FAR
*pCurrentState
) PURE
;
645 STDMETHOD(get_DisplaySize
)(long __RPC_FAR
*pDisplaySize
) PURE
;
646 STDMETHOD(put_DisplaySize
)(long pDisplaySize
) PURE
;
647 STDMETHOD(get_MainWindow
)(long __RPC_FAR
*pMainWindow
) PURE
;
648 STDMETHOD(get_ControlType
)(long __RPC_FAR
*pControlType
) PURE
;
649 STDMETHOD(put_ControlType
)(long pControlType
) PURE
;
650 STDMETHOD(get_AllowScan
)(VARIANT_BOOL __RPC_FAR
*pAllowScan
) PURE
;
651 STDMETHOD(put_AllowScan
)(VARIANT_BOOL pAllowScan
) PURE
;
652 STDMETHOD(get_SendKeyboardEvents
)(VARIANT_BOOL __RPC_FAR
*pSendKeyboardEvents
) PURE
;
653 STDMETHOD(put_SendKeyboardEvents
)(VARIANT_BOOL pSendKeyboardEvents
) PURE
;
654 STDMETHOD(get_SendMouseClickEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseClickEvents
) PURE
;
655 STDMETHOD(put_SendMouseClickEvents
)(VARIANT_BOOL pSendMouseClickEvents
) PURE
;
656 STDMETHOD(get_SendMouseMoveEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseMoveEvents
) PURE
;
657 STDMETHOD(put_SendMouseMoveEvents
)(VARIANT_BOOL pSendMouseMoveEvents
) PURE
;
658 STDMETHOD(get_SendStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendStateChangeEvents
) PURE
;
659 STDMETHOD(put_SendStateChangeEvents
)(VARIANT_BOOL pSendStateChangeEvents
) PURE
;
660 STDMETHOD(get_ReceivedPackets
)(long __RPC_FAR
*pReceivedPackets
) PURE
;
661 STDMETHOD(get_RecoveredPackets
)(long __RPC_FAR
*pRecoveredPackets
) PURE
;
662 STDMETHOD(get_LostPackets
)(long __RPC_FAR
*pLostPackets
) PURE
;
663 STDMETHOD(get_ReceptionQuality
)(long __RPC_FAR
*pReceptionQuality
) PURE
;
664 STDMETHOD(get_BufferingCount
)(long __RPC_FAR
*pBufferingCount
) PURE
;
665 STDMETHOD(get_CursorType
)(long __RPC_FAR
*pCursorType
) PURE
;
666 STDMETHOD(put_CursorType
)(long pCursorType
) PURE
;
667 STDMETHOD(get_AnimationAtStart
)(VARIANT_BOOL __RPC_FAR
*pAnimationAtStart
) PURE
;
668 STDMETHOD(put_AnimationAtStart
)(VARIANT_BOOL pAnimationAtStart
) PURE
;
669 STDMETHOD(get_AnimationOnStop
)(VARIANT_BOOL __RPC_FAR
*pAnimationOnStop
) PURE
;
670 STDMETHOD(put_AnimationOnStop
)(VARIANT_BOOL pAnimationOnStop
) PURE
;
671 STDMETHOD(Play
)(void) PURE
;
672 STDMETHOD(Pause
)(void) PURE
;
673 STDMETHOD(Stop
)(void) PURE
;
674 STDMETHOD(GetMarkerTime
)(long MarkerNum
, double __RPC_FAR
*pMarkerTime
) PURE
;
675 STDMETHOD(GetMarkerName
)(long MarkerNum
, BSTR __RPC_FAR
*pbstrMarkerName
) PURE
;
678 struct INSPlay
: public INSOPlay
680 STDMETHOD(get_ChannelName
)(BSTR __RPC_FAR
*pbstrChannelName
) PURE
;
681 STDMETHOD(get_ChannelDescription
)(BSTR __RPC_FAR
*pbstrChannelDescription
) PURE
;
682 STDMETHOD(get_ChannelURL
)(BSTR __RPC_FAR
*pbstrChannelURL
) PURE
;
683 STDMETHOD(get_ContactAddress
)(BSTR __RPC_FAR
*pbstrContactAddress
) PURE
;
684 STDMETHOD(get_ContactPhone
)(BSTR __RPC_FAR
*pbstrContactPhone
) PURE
;
685 STDMETHOD(get_ContactEmail
)(BSTR __RPC_FAR
*pbstrContactEmail
) PURE
;
686 STDMETHOD(get_AllowChangeDisplaySize
)(VARIANT_BOOL __RPC_FAR
*pAllowChangeDisplaySize
) PURE
;
687 STDMETHOD(put_AllowChangeDisplaySize
)(VARIANT_BOOL pAllowChangeDisplaySize
) PURE
;
688 STDMETHOD(get_CodecCount
)(long __RPC_FAR
*pCodecCount
) PURE
;
689 STDMETHOD(get_IsBroadcast
)(VARIANT_BOOL __RPC_FAR
*pIsBroadcast
) PURE
;
690 STDMETHOD(get_IsDurationValid
)(VARIANT_BOOL __RPC_FAR
*pIsDurationValid
) PURE
;
691 STDMETHOD(get_SourceProtocol
)(long __RPC_FAR
*pSourceProtocol
) PURE
;
692 STDMETHOD(get_OpenState
)(long __RPC_FAR
*pOpenState
) PURE
;
693 STDMETHOD(get_SendOpenStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendOpenStateChangeEvents
) PURE
;
694 STDMETHOD(put_SendOpenStateChangeEvents
)(VARIANT_BOOL pSendOpenStateChangeEvents
) PURE
;
695 STDMETHOD(get_SendWarningEvents
)(VARIANT_BOOL __RPC_FAR
*pSendWarningEvents
) PURE
;
696 STDMETHOD(put_SendWarningEvents
)(VARIANT_BOOL pSendWarningEvents
) PURE
;
697 STDMETHOD(get_SendErrorEvents
)(VARIANT_BOOL __RPC_FAR
*pSendErrorEvents
) PURE
;
698 STDMETHOD(put_SendErrorEvents
)(VARIANT_BOOL pSendErrorEvents
) PURE
;
699 STDMETHOD(get_HasError
)(VARIANT_BOOL __RPC_FAR
*pHasError
) PURE
;
700 STDMETHOD(get_ErrorDescription
)(BSTR __RPC_FAR
*pbstrErrorDescription
) PURE
;
701 STDMETHOD(get_ErrorCode
)(long __RPC_FAR
*pErrorCode
) PURE
;
702 STDMETHOD(get_PlayState
)(long __RPC_FAR
*pPlayState
) PURE
;
703 STDMETHOD(get_SendPlayStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendPlayStateChangeEvents
) PURE
;
704 STDMETHOD(put_SendPlayStateChangeEvents
)(VARIANT_BOOL pSendPlayStateChangeEvents
) PURE
;
705 STDMETHOD(get_BufferingTime
)(double __RPC_FAR
*pBufferingTime
) PURE
;
706 STDMETHOD(put_BufferingTime
)(double pBufferingTime
) PURE
;
707 STDMETHOD(get_UseFixedUDPPort
)(VARIANT_BOOL __RPC_FAR
*pUseFixedUDPPort
) PURE
;
708 STDMETHOD(put_UseFixedUDPPort
)(VARIANT_BOOL pUseFixedUDPPort
) PURE
;
709 STDMETHOD(get_FixedUDPPort
)(long __RPC_FAR
*pFixedUDPPort
) PURE
;
710 STDMETHOD(put_FixedUDPPort
)(long pFixedUDPPort
) PURE
;
711 STDMETHOD(get_UseHTTPProxy
)(VARIANT_BOOL __RPC_FAR
*pUseHTTPProxy
) PURE
;
712 STDMETHOD(put_UseHTTPProxy
)(VARIANT_BOOL pUseHTTPProxy
) PURE
;
713 STDMETHOD(get_EnableAutoProxy
)(VARIANT_BOOL __RPC_FAR
*pEnableAutoProxy
) PURE
;
714 STDMETHOD(put_EnableAutoProxy
)(VARIANT_BOOL pEnableAutoProxy
) PURE
;
715 STDMETHOD(get_HTTPProxyHost
)(BSTR __RPC_FAR
*pbstrHTTPProxyHost
) PURE
;
716 STDMETHOD(put_HTTPProxyHost
)(BSTR pbstrHTTPProxyHost
) PURE
;
717 STDMETHOD(get_HTTPProxyPort
)(long __RPC_FAR
*pHTTPProxyPort
) PURE
;
718 STDMETHOD(put_HTTPProxyPort
)(long pHTTPProxyPort
) PURE
;
719 STDMETHOD(get_EnableMulticast
)(VARIANT_BOOL __RPC_FAR
*pEnableMulticast
) PURE
;
720 STDMETHOD(put_EnableMulticast
)(VARIANT_BOOL pEnableMulticast
) PURE
;
721 STDMETHOD(get_EnableUDP
)(VARIANT_BOOL __RPC_FAR
*pEnableUDP
) PURE
;
722 STDMETHOD(put_EnableUDP
)(VARIANT_BOOL pEnableUDP
) PURE
;
723 STDMETHOD(get_EnableTCP
)(VARIANT_BOOL __RPC_FAR
*pEnableTCP
) PURE
;
724 STDMETHOD(put_EnableTCP
)(VARIANT_BOOL pEnableTCP
) PURE
;
725 STDMETHOD(get_EnableHTTP
)(VARIANT_BOOL __RPC_FAR
*pEnableHTTP
) PURE
;
726 STDMETHOD(put_EnableHTTP
)(VARIANT_BOOL pEnableHTTP
) PURE
;
727 STDMETHOD(get_BufferingProgress
)(long __RPC_FAR
*pBufferingProgress
) PURE
;
728 STDMETHOD(get_BaseURL
)(BSTR __RPC_FAR
*pbstrBaseURL
) PURE
;
729 STDMETHOD(put_BaseURL
)(BSTR pbstrBaseURL
) PURE
;
730 STDMETHOD(get_DefaultFrame
)(BSTR __RPC_FAR
*pbstrDefaultFrame
) PURE
;
731 STDMETHOD(put_DefaultFrame
)(BSTR pbstrDefaultFrame
) PURE
;
732 STDMETHOD(AboutBox
))(void) PURE
;
733 STDMETHOD(Cancel
)(void) PURE
;
734 STDMETHOD(GetCodecInstalled
)(long CodecNum
, VARIANT_BOOL __RPC_FAR
*pCodecInstalled
) PURE
;
735 STDMETHOD(GetCodecDescription
)(long CodecNum
, BSTR __RPC_FAR
*pbstrCodecDescription
) PURE
;
736 STDMETHOD(GetCodecURL
)(long CodecNum
, BSTR __RPC_FAR
*pbstrCodecURL
) PURE
;
737 STDMETHOD(Open
)(BSTR bstrFileName
) PURE
;
741 struct INSPlay1
: public INSPlay
743 STDMETHOD(get_MediaPlayer
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
746 //---------------------------------------------------------------------------
747 // IWMP (PocketPC 2000) COM INTERFACES (dumped from PlayerOCX.idl)
748 //---------------------------------------------------------------------------
750 struct IWMP
: public IDispatch
753 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_AutoSize(
754 /* [in] */ VARIANT_BOOL vbool
) = 0;
756 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_AutoSize(
757 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pbool
) = 0;
759 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_BorderStyle(
760 /* [in] */ long style
) = 0;
762 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_BorderStyle(
763 /* [retval][out] */ long __RPC_FAR
*pstyle
) = 0;
765 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_Enabled(
766 /* [in] */ VARIANT_BOOL vbool
) = 0;
768 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_Enabled(
769 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pbool
) = 0;
771 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_FileName(
772 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
774 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_FileName(
775 /* [in] */ BSTR newVal
) = 0;
777 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Volume(
778 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
780 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Volume(
781 /* [in] */ long newVal
) = 0;
783 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Mute(
784 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
786 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Mute(
787 /* [in] */ VARIANT_BOOL newVal
) = 0;
789 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AutoStart(
790 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
792 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AutoStart(
793 /* [in] */ VARIANT_BOOL newVal
) = 0;
795 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_PlayCount(
796 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
798 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_PlayCount(
799 /* [in] */ long newVal
) = 0;
801 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowStatusBar(
802 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
804 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowStatusBar(
805 /* [in] */ VARIANT_BOOL newVal
) = 0;
807 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowAudioControls(
808 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
810 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowAudioControls(
811 /* [in] */ VARIANT_BOOL newVal
) = 0;
813 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowCaptioning(
814 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
816 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowCaptioning(
817 /* [in] */ VARIANT_BOOL newVal
) = 0;
819 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowControls(
820 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
822 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowControls(
823 /* [in] */ VARIANT_BOOL newVal
) = 0;
825 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowDisplay(
826 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
828 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowDisplay(
829 /* [in] */ VARIANT_BOOL newVal
) = 0;
831 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowGotoBar(
832 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
834 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowGotoBar(
835 /* [in] */ VARIANT_BOOL newVal
) = 0;
837 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowPositionControls(
838 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
840 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowPositionControls(
841 /* [in] */ VARIANT_BOOL newVal
) = 0;
843 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowTracker(
844 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
846 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowTracker(
847 /* [in] */ VARIANT_BOOL newVal
) = 0;
849 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Startup( void ) = 0;
851 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Shutdown( void ) = 0;
853 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Bandwidth(
854 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
856 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BaseURL(
857 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
859 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_BaseURL(
860 /* [in] */ BSTR pVal
) = 0;
862 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BufferingCount(
863 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
865 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BufferingProgress(
866 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
868 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BufferingTime(
869 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
871 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanSeek(
872 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
874 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanSeekToMarkers(
875 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
877 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ChannelDescription(
878 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
880 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ChannelName(
881 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
883 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ChannelURL(
884 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
886 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ClientID(
887 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
889 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ConnectionSpeed(
890 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
892 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ContactAddress(
893 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
895 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ContactEmail(
896 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
898 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ContactPhone(
899 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
901 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CurrentMarker(
902 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
904 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_CurrentMarker(
905 /* [in] */ long newVal
) = 0;
907 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CurrentPosition(
908 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
910 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_CurrentPosition(
911 /* [in] */ double newVal
) = 0;
913 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DefaultFrame(
914 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
916 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DefaultFrame(
917 /* [in] */ BSTR newVal
) = 0;
919 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Duration(
920 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
922 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EntryCount(
923 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
925 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ErrorCode(
926 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
928 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ErrorDescription(
929 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
931 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_HasError(
932 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
934 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_HasMultipleItems(
935 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
937 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ImageSourceHeight(
938 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
940 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ImageSourceWidth(
941 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
943 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_InvokeURLs(
944 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
946 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_InvokeURLs(
947 /* [in] */ VARIANT_BOOL newVal
) = 0;
949 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_IsBroadcast(
950 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
952 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_IsDurationValid(
953 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
955 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_LostPackets(
956 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
958 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_MarkerCount(
959 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
961 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_OpenState(
962 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
964 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_PlayState(
965 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
967 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_PreviewMode(
968 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
970 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_PreviewMode(
971 /* [in] */ VARIANT_BOOL newVal
) = 0;
973 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ReadyState(
974 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
976 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ReceivedPackets(
977 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
979 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ReceptionQuality(
980 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
982 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_RecoveredPackets(
983 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
985 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SAMIFileName(
986 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
988 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SAMIFileName(
989 /* [in] */ BSTR newVal
) = 0;
991 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SAMILang(
992 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
994 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SAMILang(
995 /* [in] */ BSTR newVal
) = 0;
997 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SAMIStyle(
998 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
1000 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SAMIStyle(
1001 /* [in] */ BSTR newVal
) = 0;
1003 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SelectionEnd(
1004 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
1006 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SelectionEnd(
1007 /* [in] */ double newVal
) = 0;
1009 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SelectionStart(
1010 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
1012 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SelectionStart(
1013 /* [in] */ double newVal
) = 0;
1015 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendErrorEvents(
1016 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1018 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendErrorEvents(
1019 /* [in] */ VARIANT_BOOL newVal
) = 0;
1021 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendKeyboardEvents(
1022 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1024 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendKeyboardEvents(
1025 /* [in] */ VARIANT_BOOL newVal
) = 0;
1027 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendMouseClickEvents(
1028 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1030 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendMouseClickEvents(
1031 /* [in] */ VARIANT_BOOL newVal
) = 0;
1033 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendMouseMoveEvents(
1034 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1036 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendMouseMoveEvents(
1037 /* [in] */ VARIANT_BOOL newVal
) = 0;
1039 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendOpenStateChangeEvents(
1040 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1042 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendOpenStateChangeEvents(
1043 /* [in] */ VARIANT_BOOL newVal
) = 0;
1045 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendPlayStateChangeEvents(
1046 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1048 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendPlayStateChangeEvents(
1049 /* [in] */ VARIANT_BOOL newVal
) = 0;
1051 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendWarningEvents(
1052 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1054 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendWarningEvents(
1055 /* [in] */ VARIANT_BOOL newVal
) = 0;
1057 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SourceLink(
1058 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
1060 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
AboutBox( void) = 0;
1062 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Cancel( void) = 0;
1064 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCodecDescription(
1065 /* [in] */ long nCodec
,
1066 /* [retval][out] */ BSTR __RPC_FAR
*pDescription
) = 0;
1068 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCodecInstalled(
1069 /* [in] */ BSTR __RPC_FAR
*pstrCodec
,
1070 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pIsInstalled
) = 0;
1072 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCurrentEntry(
1073 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1075 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMarkerName(
1076 /* [in] */ long nMarker
,
1077 /* [retval][out] */ BSTR __RPC_FAR
*pMarkerName
) = 0;
1079 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMarkerTime(
1080 /* [in] */ long nMarker
,
1081 /* [retval][out] */ double __RPC_FAR
*pMarkerTime
) = 0;
1083 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMediaInfoString(
1084 /* [in] */ long MPMediaInfoType
,
1085 /* [retval][out] */ BSTR __RPC_FAR
*pstrMediaInfo
) = 0;
1087 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Next( void) = 0;
1089 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Open(
1092 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Pause( void) = 0;
1094 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Play( void) = 0;
1096 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Previous( void) = 0;
1098 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Stop( void) = 0;
1100 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Rate(
1101 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
1103 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Rate(
1104 /* [in] */ double newVal
) = 0;
1106 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplaySize(
1107 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1109 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplaySize(
1110 /* [in] */ long newVal
) = 0;
1112 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SourceProtocol(
1113 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1115 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ErrorCorrection(
1116 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
1118 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
FinalConstruct( void) = 0;
1120 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AllowChangeDisplaySize(
1121 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1123 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AllowChangeDisplaySize(
1124 /* [in] */ VARIANT_BOOL newVal
) = 0;
1126 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AllowScan(
1127 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1129 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AllowScan(
1130 /* [in] */ VARIANT_BOOL newVal
) = 0;
1132 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AnimationAtStart(
1133 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1135 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AnimationAtStart(
1136 /* [in] */ VARIANT_BOOL newVal
) = 0;
1138 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AudioStream(
1139 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1141 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AudioStream(
1142 /* [in] */ long newVal
) = 0;
1144 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AutoRewind(
1145 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1147 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AutoRewind(
1148 /* [in] */ VARIANT_BOOL newVal
) = 0;
1150 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Balance(
1151 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1153 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Balance(
1154 /* [in] */ long newVal
) = 0;
1156 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanPreview(
1157 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1159 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanScan(
1160 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1162 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CaptioningID(
1163 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
1165 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ClickToPlay(
1166 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1168 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ClickToPlay(
1169 /* [in] */ VARIANT_BOOL newVal
) = 0;
1171 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CodecCount(
1172 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1174 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CreationDate(
1175 /* [retval][out] */ DATE __RPC_FAR
*pVal
) = 0;
1177 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CursorType(
1178 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1180 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_CursorType(
1181 /* [in] */ long newVal
) = 0;
1183 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplayBackColor(
1184 /* [retval][out] */ VB_OLE_COLOR __RPC_FAR
*pVal
) = 0;
1186 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplayBackColor(
1187 /* [in] */ VB_OLE_COLOR newVal
) = 0;
1189 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplayForeColor(
1190 /* [retval][out] */ VB_OLE_COLOR __RPC_FAR
*pVal
) = 0;
1192 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplayForeColor(
1193 /* [in] */ VB_OLE_COLOR newVal
) = 0;
1195 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplayMode(
1196 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1198 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplayMode(
1199 /* [in] */ long newVal
) = 0;
1201 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnableContextMenu(
1202 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1204 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnableContextMenu(
1205 /* [in] */ VARIANT_BOOL newVal
) = 0;
1207 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnableFullScreenControls(
1208 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1210 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnableFullScreenControls(
1211 /* [in] */ VARIANT_BOOL newVal
) = 0;
1213 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnablePositionControls(
1214 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1216 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnablePositionControls(
1217 /* [in] */ VARIANT_BOOL newVal
) = 0;
1219 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnableTracker(
1220 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1222 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnableTracker(
1223 /* [in] */ VARIANT_BOOL newVal
) = 0;
1225 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Language(
1226 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1228 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_StreamCount(
1229 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1231 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_TransparentAtStart(
1232 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1234 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_TransparentAtStart(
1235 /* [in] */ VARIANT_BOOL newVal
) = 0;
1237 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_VideoBorder3D(
1238 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1240 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_VideoBorder3D(
1241 /* [in] */ VARIANT_BOOL newVal
) = 0;
1243 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_VideoBorderColor(
1244 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1246 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_VideoBorderColor(
1247 /* [in] */ long newVal
) = 0;
1249 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_VideoBorderWidth(
1250 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1252 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_VideoBorderWidth(
1253 /* [in] */ long newVal
) = 0;
1255 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
FastForward( void) = 0;
1257 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
FastReverse( void) = 0;
1259 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCodecURL(
1260 /* [retval][out] */ BSTR __RPC_FAR
*pstrCodecURL
) = 0;
1262 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMediaParameter(
1263 /* [in] */ long nParam
,
1264 BSTR szParameterName
,
1265 /* [retval][out] */ BSTR __RPC_FAR
*pstrParameterValue
) = 0;
1267 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMediaParameterName(
1268 /* [in] */ long nParam
,
1270 /* [retval][out] */ BSTR __RPC_FAR
*pstrParameterName
) = 0;
1272 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMoreInfoURL(
1273 /* [retval][out] */ BSTR __RPC_FAR
*pstrMoreInfoURL
) = 0;
1275 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetStreamGroup(
1276 /* [retval][out] */ BSTR __RPC_FAR
*pstrStreamGroup
) = 0;
1278 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetStreamName(
1279 /* [retval][out] */ BSTR __RPC_FAR
*pstrStreamName
) = 0;
1281 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetStreamSelected(
1282 /* [in] */ long nStream
,
1283 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*fIsSelected
) = 0;
1285 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
IsSoundCardEnabled(
1286 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*fIsEnabled
) = 0;
1288 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
SetCurrentEntry(
1291 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
ShowDialog(
1294 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
StreamSelect(
1297 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
OnWindowMessage(
1301 LRESULT __RPC_FAR
*plResult
) = 0;
1304 //---------------------------------------------------------------------------
1305 // MISC COM INTERFACES
1306 //---------------------------------------------------------------------------
1307 typedef enum _FilterState
1315 typedef enum _PinDirection
1322 typedef struct _FilterInfo
1325 struct IFilterGraph
*pGraph
;
1329 typedef struct _PinInfo
1331 struct IBaseFilter
*pFilter
;
1339 struct IEnumFilters
;
1340 typedef struct _MediaType
1344 BOOL bFixedSizeSamples
;
1345 BOOL bTemporalCompression
;
1354 struct IFilterGraph
: public IUnknown
1356 STDMETHOD(AddFilter
)(IBaseFilter
*, LPCWSTR
) PURE
;
1357 STDMETHOD(RemoveFilter
)(IBaseFilter
*) PURE
;
1358 STDMETHOD(EnumFilters
)(IEnumFilters
**) PURE
;
1359 STDMETHOD(FindFilterByName
)(LPCWSTR
, IBaseFilter
**) PURE
;
1360 STDMETHOD(ConnectDirect
)(IPin
*, IPin
*, const AM_MEDIA_TYPE
*) PURE
;
1361 STDMETHOD(Reconnect
)(IPin
*) PURE
;
1362 STDMETHOD(Disconnect
)(IPin
*) PURE
;
1363 STDMETHOD(SetDefaultSyncSource
)() PURE
;
1366 struct IGraphBuilder
: public IFilterGraph
1368 STDMETHOD(Connect
)(IPin
*, IPin
*) PURE
;
1369 STDMETHOD(Render
)(IPin
*) PURE
;
1370 STDMETHOD(RenderFile
)(LPCWSTR
, LPCWSTR
) PURE
;
1371 STDMETHOD(AddSourceFilter
)(LPCWSTR
, LPCWSTR
, IBaseFilter
**) PURE
;
1372 STDMETHOD(SetLogFile
)(DWORD_PTR
) PURE
;
1373 STDMETHOD(Abort
)() PURE
;
1374 STDMETHOD(ShouldOperationContinue
)() PURE
;
1377 struct IReferenceClock
;
1379 #define REFERENCE_TIME LONGLONG
1380 struct IMediaFilter
: public IPersist
1382 STDMETHOD(Stop
)( void) PURE
;
1383 STDMETHOD(Pause
)( void) PURE
;
1384 STDMETHOD(Run
)(REFERENCE_TIME tStart
) PURE
;
1385 STDMETHOD(GetState
)(DWORD dwMilliSecsTimeout
,
1386 FILTER_STATE
*State
) PURE
;
1387 STDMETHOD(SetSyncSource
)(IReferenceClock
*pClock
) PURE
;
1388 STDMETHOD(GetSyncSource
)(IReferenceClock
**pClock
) PURE
;
1391 struct IBaseFilter
: public IMediaFilter
1393 STDMETHOD(EnumPins
)(IEnumPins
**ppEnum
) PURE
;
1394 STDMETHOD(FindPin
)(LPCWSTR Id
, IPin
**ppPin
) PURE
;
1395 STDMETHOD(QueryFilterInfo
)(FILTER_INFO
*pInfo
) PURE
;
1396 STDMETHOD(JoinFilterGraph
)(IFilterGraph
*pGraph
, LPCWSTR pName
) PURE
;
1397 STDMETHOD(QueryVendorInfo
)(LPWSTR
*pVendorInfo
) PURE
;
1401 //---------------------------------------------------------------------------
1403 //---------------------------------------------------------------------------
1405 typedef BOOL (WINAPI
* LPAMGETERRORTEXT
)(HRESULT
, wxChar
*, DWORD
);
1407 class WXDLLIMPEXP_MEDIA wxAMMediaBackend
: public wxMediaBackendCommonBase
1411 virtual ~wxAMMediaBackend();
1414 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
1419 const wxValidator
& validator
,
1420 const wxString
& name
);
1422 virtual bool Play();
1423 virtual bool Pause();
1424 virtual bool Stop();
1426 virtual bool Load(const wxString
& fileName
);
1427 virtual bool Load(const wxURI
& location
);
1428 virtual bool Load(const wxURI
& location
, const wxURI
& proxy
);
1430 bool DoLoad(const wxString
& location
);
1433 virtual wxMediaState
GetState();
1435 virtual bool SetPosition(wxLongLong where
);
1436 virtual wxLongLong
GetPosition();
1437 virtual wxLongLong
GetDuration();
1439 virtual void Move(int x
, int y
, int w
, int h
);
1440 wxSize
GetVideoSize() const;
1442 virtual double GetPlaybackRate();
1443 virtual bool SetPlaybackRate(double);
1445 virtual double GetVolume();
1446 virtual bool SetVolume(double);
1448 virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags
);
1451 void DoGetDownloadProgress(wxLongLong
*, wxLongLong
*);
1453 virtual wxLongLong
GetDownloadProgress()
1455 wxLongLong progress
, total
;
1456 DoGetDownloadProgress(&progress
, &total
);
1460 virtual wxLongLong
GetDownloadTotal()
1462 wxLongLong progress
, total
;
1463 DoGetDownloadProgress(&progress
, &total
);
1469 wxActiveXContainer
* m_pAX
;
1474 IWMP
* GetMP() { return m_pWMP
; }
1475 IWMP
* GetAM() { return m_pWMP
; }
1477 IActiveMovie
* m_pAM
;
1478 IMediaPlayer
* m_pMP
;
1480 IMediaPlayer
* GetMP() { return m_pMP
; }
1481 IActiveMovie
* GetAM() { return m_pAM
; }
1488 wxDynamicLibrary m_dllQuartz
;
1489 LPAMGETERRORTEXT m_lpAMGetErrorText
;
1490 wxString
GetErrorString(HRESULT hrdsv
);
1493 DECLARE_DYNAMIC_CLASS(wxAMMediaBackend
)
1496 //---------------------------------------------------------------------------
1497 // wxMCIMediaBackend
1498 //---------------------------------------------------------------------------
1500 //---------------------------------------------------------------------------
1502 //---------------------------------------------------------------------------
1504 #include <mmsystem.h>
1506 class WXDLLIMPEXP_MEDIA wxMCIMediaBackend
: public wxMediaBackendCommonBase
1509 wxMCIMediaBackend();
1510 ~wxMCIMediaBackend();
1512 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
1517 const wxValidator
& validator
,
1518 const wxString
& name
);
1520 virtual bool Play();
1521 virtual bool Pause();
1522 virtual bool Stop();
1524 virtual bool Load(const wxURI
& location
,
1526 { return wxMediaBackend::Load(location
, proxy
); }
1528 virtual bool Load(const wxString
& fileName
);
1529 virtual bool Load(const wxURI
& location
);
1531 virtual wxMediaState
GetState();
1533 virtual bool SetPosition(wxLongLong where
);
1534 virtual wxLongLong
GetPosition();
1535 virtual wxLongLong
GetDuration();
1537 virtual void Move(int x
, int y
, int w
, int h
);
1538 wxSize
GetVideoSize() const;
1540 virtual double GetPlaybackRate();
1541 virtual bool SetPlaybackRate(double dRate
);
1543 virtual double GetVolume();
1544 virtual bool SetVolume(double);
1546 static LRESULT CALLBACK
NotifyWndProc(HWND hWnd
, UINT nMsg
,
1547 WPARAM wParam
, LPARAM lParam
);
1549 LRESULT CALLBACK
OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
1550 WPARAM wParam
, LPARAM lParam
);
1552 MCIDEVICEID m_hDev
; //Our MCI Device ID/Handler
1553 HWND m_hNotifyWnd
; //Window to use for MCI events
1554 bool m_bVideo
; //Whether or not we have video
1556 DECLARE_DYNAMIC_CLASS(wxMCIMediaBackend
)
1560 //---------------------------------------------------------------------------
1563 // We don't include Quicktime headers here and define all the types
1564 // ourselves because looking for the quicktime libaries etc. would
1565 // be tricky to do and making this a dependency for the MSVC projects
1566 // would be unrealistic.
1568 // Thanks to Robert Roebling for the wxDL macro/library idea
1569 //---------------------------------------------------------------------------
1571 //---------------------------------------------------------------------------
1573 //---------------------------------------------------------------------------
1574 //#include <qtml.h> // Windoze QT include
1575 //#include <QuickTimeComponents.h> // Standard QT stuff
1576 #include "wx/dynlib.h"
1578 //---------------------------------------------------------------------------
1580 //---------------------------------------------------------------------------
1581 typedef struct MovieRecord
* Movie
;
1582 typedef wxInt16 OSErr
;
1583 typedef wxInt32 OSStatus
;
1586 typedef unsigned char Str255
[256];
1587 #define StringPtr unsigned char*
1588 #define newMovieActive 1
1589 #define newMovieAsyncOK (1 << 8)
1593 #define OSType unsigned long
1594 #define CGrafPtr struct GrafPort *
1595 #define TimeScale long
1596 #define TimeBase struct TimeBaseRecord *
1597 typedef struct ComponentInstanceRecord
* ComponentInstance
;
1598 #define kMovieLoadStatePlayable 10000
1600 #define MovieController ComponentInstance
1602 #ifndef URLDataHandlerSubType
1603 #if defined(__WATCOMC__) || defined(__MINGW32__)
1604 // use magic numbers for compilers which complain about multicharacter integers
1605 const OSType URLDataHandlerSubType
= 1970433056;
1606 const OSType VisualMediaCharacteristic
= 1702454643;
1608 const OSType URLDataHandlerSubType
= 'url ';
1609 const OSType VisualMediaCharacteristic
= 'eyes';
1617 Str255 name
; // Str63 on mac, Str255 on msw
1636 wide value
; // units
1637 TimeScale scale
; // units per second
1659 mcScaleMovieToFit
= 2,
1665 //---------------------------------------------------------------------------
1667 //---------------------------------------------------------------------------
1668 #define wxDL_METHOD_DEFINE( rettype, name, args, shortargs, defret ) \
1669 typedef rettype (* name ## Type) args ; \
1670 name ## Type pfn_ ## name; \
1672 { if (m_ok) return pfn_ ## name shortargs ; return defret; }
1674 #define wxDL_VOIDMETHOD_DEFINE( name, args, shortargs ) \
1675 typedef void (* name ## Type) args ; \
1676 name ## Type pfn_ ## name; \
1678 { if (m_ok) pfn_ ## name shortargs ; }
1680 #define wxDL_METHOD_LOAD( lib, name, success ) \
1681 pfn_ ## name = (name ## Type) lib.GetSymbol( wxT(#name), &success ); \
1682 if (!success) return false
1685 class WXDLLIMPEXP_MEDIA wxQuickTimeLibrary
1688 ~wxQuickTimeLibrary()
1690 if (m_dll
.IsLoaded())
1695 bool IsOk() const {return m_ok
;}
1698 wxDynamicLibrary m_dll
;
1702 wxDL_VOIDMETHOD_DEFINE( StartMovie
, (Movie m
), (m
) );
1703 wxDL_VOIDMETHOD_DEFINE( StopMovie
, (Movie m
), (m
) );
1704 wxDL_METHOD_DEFINE( bool, IsMovieDone
, (Movie m
), (m
), false);
1705 wxDL_VOIDMETHOD_DEFINE( GoToBeginningOfMovie
, (Movie m
), (m
) );
1706 wxDL_METHOD_DEFINE( OSErr
, GetMoviesError
, (), (), -1);
1707 wxDL_METHOD_DEFINE( OSErr
, EnterMovies
, (), (), -1);
1708 wxDL_VOIDMETHOD_DEFINE( ExitMovies
, (), () );
1709 wxDL_METHOD_DEFINE( OSErr
, InitializeQTML
, (long flags
), (flags
), -1);
1710 wxDL_VOIDMETHOD_DEFINE( TerminateQTML
, (), () );
1712 wxDL_METHOD_DEFINE( OSErr
, NativePathNameToFSSpec
,
1713 (char* inName
, FSSpec
* outFile
, long flags
),
1714 (inName
, outFile
, flags
), -1);
1716 wxDL_METHOD_DEFINE( OSErr
, OpenMovieFile
,
1717 (const FSSpec
* fileSpec
, short * resRefNum
, wxInt8 permission
),
1718 (fileSpec
, resRefNum
, permission
), -1 );
1720 wxDL_METHOD_DEFINE( OSErr
, CloseMovieFile
,
1721 (short resRefNum
), (resRefNum
), -1);
1723 wxDL_METHOD_DEFINE( OSErr
, NewMovieFromFile
,
1724 (Movie
* theMovie
, short resRefNum
, short * resId
,
1725 StringPtr resName
, short newMovieFlags
,
1726 bool * dataRefWasChanged
),
1727 (theMovie
, resRefNum
, resId
, resName
, newMovieFlags
,
1728 dataRefWasChanged
), -1);
1730 wxDL_VOIDMETHOD_DEFINE( SetMovieRate
, (Movie m
, Fixed rate
), (m
, rate
) );
1731 wxDL_METHOD_DEFINE( Fixed
, GetMovieRate
, (Movie m
), (m
), 0);
1732 wxDL_VOIDMETHOD_DEFINE( MoviesTask
, (Movie m
, long maxms
), (m
, maxms
) );
1733 wxDL_VOIDMETHOD_DEFINE( BlockMove
,
1734 (const char* p1
, const char* p2
, long s
), (p1
,p2
,s
) );
1735 wxDL_METHOD_DEFINE( Handle
, NewHandleClear
, (long s
), (s
), NULL
);
1737 wxDL_METHOD_DEFINE( OSErr
, NewMovieFromDataRef
,
1738 (Movie
* m
, short flags
, short * id
,
1739 Handle dataRef
, OSType dataRefType
),
1740 (m
,flags
,id
,dataRef
,dataRefType
), -1 );
1742 wxDL_VOIDMETHOD_DEFINE( DisposeHandle
, (Handle h
), (h
) );
1743 wxDL_VOIDMETHOD_DEFINE( GetMovieNaturalBoundsRect
, (Movie m
, Rect
* r
), (m
,r
) );
1744 wxDL_METHOD_DEFINE( void*, GetMovieIndTrackType
,
1745 (Movie m
, long index
, OSType type
, long flags
),
1746 (m
,index
,type
,flags
), NULL
);
1747 wxDL_VOIDMETHOD_DEFINE( CreatePortAssociation
,
1748 (void* hWnd
, void* junk
, long morejunk
), (hWnd
, junk
, morejunk
) );
1749 wxDL_METHOD_DEFINE(void*, GetNativeWindowPort
, (void* hWnd
), (hWnd
), NULL
);
1750 wxDL_VOIDMETHOD_DEFINE(SetMovieGWorld
, (Movie m
, CGrafPtr port
, void* whatever
),
1751 (m
, port
, whatever
) );
1752 wxDL_VOIDMETHOD_DEFINE(DisposeMovie
, (Movie m
), (m
) );
1753 wxDL_VOIDMETHOD_DEFINE(SetMovieBox
, (Movie m
, Rect
* r
), (m
,r
));
1754 wxDL_VOIDMETHOD_DEFINE(SetMovieTimeScale
, (Movie m
, long s
), (m
,s
));
1755 wxDL_METHOD_DEFINE(long, GetMovieDuration
, (Movie m
), (m
), 0);
1756 wxDL_METHOD_DEFINE(TimeBase
, GetMovieTimeBase
, (Movie m
), (m
), 0);
1757 wxDL_METHOD_DEFINE(TimeScale
, GetMovieTimeScale
, (Movie m
), (m
), 0);
1758 wxDL_METHOD_DEFINE(long, GetMovieTime
, (Movie m
, void* cruft
), (m
,cruft
), 0);
1759 wxDL_VOIDMETHOD_DEFINE(SetMovieTime
, (Movie m
, TimeRecord
* tr
), (m
,tr
) );
1760 wxDL_METHOD_DEFINE(short, GetMovieVolume
, (Movie m
), (m
), 0);
1761 wxDL_VOIDMETHOD_DEFINE(SetMovieVolume
, (Movie m
, short sVolume
), (m
,sVolume
) );
1762 wxDL_VOIDMETHOD_DEFINE(SetMovieTimeValue
, (Movie m
, long s
), (m
,s
));
1763 wxDL_METHOD_DEFINE(ComponentInstance
, NewMovieController
, (Movie m
, const Rect
* mr
, long fl
), (m
,mr
,fl
), 0);
1764 wxDL_VOIDMETHOD_DEFINE(DisposeMovieController
, (ComponentInstance ci
), (ci
));
1765 wxDL_METHOD_DEFINE(int, MCSetVisible
, (ComponentInstance m
, int b
), (m
, b
), 0);
1767 wxDL_VOIDMETHOD_DEFINE(PrePrerollMovie
, (Movie m
, long t
, Fixed r
, WXFARPROC p1
, void* p2
), (m
,t
,r
,p1
,p2
) );
1768 wxDL_VOIDMETHOD_DEFINE(PrerollMovie
, (Movie m
, long t
, Fixed r
), (m
,t
,r
) );
1769 wxDL_METHOD_DEFINE(Fixed
, GetMoviePreferredRate
, (Movie m
), (m
), 0);
1770 wxDL_METHOD_DEFINE(long, GetMovieLoadState
, (Movie m
), (m
), 0);
1771 wxDL_METHOD_DEFINE(void*, NewRoutineDescriptor
, (WXFARPROC f
, int l
, void* junk
), (f
, l
, junk
), 0);
1772 wxDL_VOIDMETHOD_DEFINE(DisposeRoutineDescriptor
, (void* f
), (f
));
1773 wxDL_METHOD_DEFINE(void*, GetCurrentArchitecture
, (), (), 0);
1774 wxDL_METHOD_DEFINE(int, MCDoAction
, (ComponentInstance ci
, long f
, void* p
), (ci
,f
,p
), 0);
1775 wxDL_VOIDMETHOD_DEFINE(MCSetControllerBoundsRect
, (ComponentInstance ci
, Rect
* r
), (ci
,r
));
1776 wxDL_VOIDMETHOD_DEFINE(DestroyPortAssociation
, (CGrafPtr g
), (g
));
1777 wxDL_VOIDMETHOD_DEFINE(NativeEventToMacEvent
, (MSG
* p1
, EventRecord
* p2
), (p1
,p2
));
1778 wxDL_VOIDMETHOD_DEFINE(MCIsPlayerEvent
, (ComponentInstance ci
, EventRecord
* p2
), (ci
, p2
));
1779 wxDL_METHOD_DEFINE(int, MCSetMovie
, (ComponentInstance ci
, Movie m
, void* p1
, Point w
),
1781 wxDL_VOIDMETHOD_DEFINE(MCPositionController
,
1782 (ComponentInstance ci
, Rect
* r
, void* junk
, void* morejunk
), (ci
,r
,junk
,morejunk
));
1783 wxDL_VOIDMETHOD_DEFINE(MCSetActionFilterWithRefCon
,
1784 (ComponentInstance ci
, WXFARPROC cb
, void* ref
), (ci
,cb
,ref
));
1785 wxDL_VOIDMETHOD_DEFINE(MCGetControllerInfo
, (MovieController mc
, long* flags
), (mc
,flags
));
1786 wxDL_VOIDMETHOD_DEFINE(BeginUpdate
, (CGrafPtr port
), (port
));
1787 wxDL_VOIDMETHOD_DEFINE(UpdateMovie
, (Movie m
), (m
));
1788 wxDL_VOIDMETHOD_DEFINE(EndUpdate
, (CGrafPtr port
), (port
));
1789 wxDL_METHOD_DEFINE( OSErr
, GetMoviesStickyError
, (), (), -1);
1792 bool wxQuickTimeLibrary::Initialize()
1796 // Turn off the wxDynamicLibrary logging as we're prepared to handle the
1800 if (!m_dll
.Load(wxT("qtmlClient.dll")))
1805 wxDL_METHOD_LOAD( m_dll
, StartMovie
, m_ok
);
1806 wxDL_METHOD_LOAD( m_dll
, StopMovie
, m_ok
);
1807 wxDL_METHOD_LOAD( m_dll
, IsMovieDone
, m_ok
);
1808 wxDL_METHOD_LOAD( m_dll
, GoToBeginningOfMovie
, m_ok
);
1809 wxDL_METHOD_LOAD( m_dll
, GetMoviesError
, m_ok
);
1810 wxDL_METHOD_LOAD( m_dll
, EnterMovies
, m_ok
);
1811 wxDL_METHOD_LOAD( m_dll
, ExitMovies
, m_ok
);
1812 wxDL_METHOD_LOAD( m_dll
, InitializeQTML
, m_ok
);
1813 wxDL_METHOD_LOAD( m_dll
, TerminateQTML
, m_ok
);
1814 wxDL_METHOD_LOAD( m_dll
, NativePathNameToFSSpec
, m_ok
);
1815 wxDL_METHOD_LOAD( m_dll
, OpenMovieFile
, m_ok
);
1816 wxDL_METHOD_LOAD( m_dll
, CloseMovieFile
, m_ok
);
1817 wxDL_METHOD_LOAD( m_dll
, NewMovieFromFile
, m_ok
);
1818 wxDL_METHOD_LOAD( m_dll
, GetMovieRate
, m_ok
);
1819 wxDL_METHOD_LOAD( m_dll
, SetMovieRate
, m_ok
);
1820 wxDL_METHOD_LOAD( m_dll
, MoviesTask
, m_ok
);
1821 wxDL_METHOD_LOAD( m_dll
, BlockMove
, m_ok
);
1822 wxDL_METHOD_LOAD( m_dll
, NewHandleClear
, m_ok
);
1823 wxDL_METHOD_LOAD( m_dll
, NewMovieFromDataRef
, m_ok
);
1824 wxDL_METHOD_LOAD( m_dll
, DisposeHandle
, m_ok
);
1825 wxDL_METHOD_LOAD( m_dll
, GetMovieNaturalBoundsRect
, m_ok
);
1826 wxDL_METHOD_LOAD( m_dll
, GetMovieIndTrackType
, m_ok
);
1827 wxDL_METHOD_LOAD( m_dll
, CreatePortAssociation
, m_ok
);
1828 wxDL_METHOD_LOAD( m_dll
, DestroyPortAssociation
, m_ok
);
1829 wxDL_METHOD_LOAD( m_dll
, GetNativeWindowPort
, m_ok
);
1830 wxDL_METHOD_LOAD( m_dll
, SetMovieGWorld
, m_ok
);
1831 wxDL_METHOD_LOAD( m_dll
, DisposeMovie
, m_ok
);
1832 wxDL_METHOD_LOAD( m_dll
, SetMovieBox
, m_ok
);
1833 wxDL_METHOD_LOAD( m_dll
, SetMovieTimeScale
, m_ok
);
1834 wxDL_METHOD_LOAD( m_dll
, GetMovieDuration
, m_ok
);
1835 wxDL_METHOD_LOAD( m_dll
, GetMovieTimeBase
, m_ok
);
1836 wxDL_METHOD_LOAD( m_dll
, GetMovieTimeScale
, m_ok
);
1837 wxDL_METHOD_LOAD( m_dll
, GetMovieTime
, m_ok
);
1838 wxDL_METHOD_LOAD( m_dll
, SetMovieTime
, m_ok
);
1839 wxDL_METHOD_LOAD( m_dll
, GetMovieVolume
, m_ok
);
1840 wxDL_METHOD_LOAD( m_dll
, SetMovieVolume
, m_ok
);
1841 wxDL_METHOD_LOAD( m_dll
, SetMovieTimeValue
, m_ok
);
1842 wxDL_METHOD_LOAD( m_dll
, NewMovieController
, m_ok
);
1843 wxDL_METHOD_LOAD( m_dll
, DisposeMovieController
, m_ok
);
1844 wxDL_METHOD_LOAD( m_dll
, MCSetVisible
, m_ok
);
1845 wxDL_METHOD_LOAD( m_dll
, PrePrerollMovie
, m_ok
);
1846 wxDL_METHOD_LOAD( m_dll
, PrerollMovie
, m_ok
);
1847 wxDL_METHOD_LOAD( m_dll
, GetMoviePreferredRate
, m_ok
);
1848 wxDL_METHOD_LOAD( m_dll
, GetMovieLoadState
, m_ok
);
1849 wxDL_METHOD_LOAD( m_dll
, MCDoAction
, m_ok
);
1850 wxDL_METHOD_LOAD( m_dll
, MCSetControllerBoundsRect
, m_ok
);
1851 wxDL_METHOD_LOAD( m_dll
, NativeEventToMacEvent
, m_ok
);
1852 wxDL_METHOD_LOAD( m_dll
, MCIsPlayerEvent
, m_ok
);
1853 wxDL_METHOD_LOAD( m_dll
, MCSetMovie
, m_ok
);
1854 wxDL_METHOD_LOAD( m_dll
, MCSetActionFilterWithRefCon
, m_ok
);
1855 wxDL_METHOD_LOAD( m_dll
, MCGetControllerInfo
, m_ok
);
1856 wxDL_METHOD_LOAD( m_dll
, BeginUpdate
, m_ok
);
1857 wxDL_METHOD_LOAD( m_dll
, UpdateMovie
, m_ok
);
1858 wxDL_METHOD_LOAD( m_dll
, EndUpdate
, m_ok
);
1859 wxDL_METHOD_LOAD( m_dll
, GetMoviesStickyError
, m_ok
);
1866 class WXDLLIMPEXP_MEDIA wxQTMediaBackend
: public wxMediaBackendCommonBase
1870 ~wxQTMediaBackend();
1872 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
1877 const wxValidator
& validator
,
1878 const wxString
& name
);
1880 virtual bool Play();
1881 virtual bool Pause();
1882 virtual bool Stop();
1884 virtual bool Load(const wxURI
& location
,
1886 { return wxMediaBackend::Load(location
, proxy
); }
1888 virtual bool Load(const wxString
& fileName
);
1889 virtual bool Load(const wxURI
& location
);
1891 virtual wxMediaState
GetState();
1893 virtual bool SetPosition(wxLongLong where
);
1894 virtual wxLongLong
GetPosition();
1895 virtual wxLongLong
GetDuration();
1897 virtual void Move(int x
, int y
, int w
, int h
);
1898 wxSize
GetVideoSize() const;
1900 virtual double GetPlaybackRate();
1901 virtual bool SetPlaybackRate(double dRate
);
1903 virtual double GetVolume();
1904 virtual bool SetVolume(double);
1909 static void PPRMProc (Movie theMovie
, OSErr theErr
, void* theRefCon
);
1911 // TODO: Last param actually long - does this work on 64bit machines?
1912 static Boolean
MCFilterProc(MovieController theController
,
1913 short action
, void *params
, LONG_PTR refCon
);
1915 static LRESULT CALLBACK
QTWndProc(HWND
, UINT
, WPARAM
, LPARAM
);
1917 virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags
);
1919 wxSize m_bestSize
; // Original movie size
1920 Movie m_movie
; // QT Movie handle/instance
1921 bool m_bVideo
; // Whether or not we have video
1922 bool m_bPlaying
; // Whether or not movie is playing
1923 wxTimer
* m_timer
; // Load or Play timer
1924 wxQuickTimeLibrary m_lib
; // DLL to load functions from
1925 ComponentInstance m_pMC
; // Movie Controller
1927 friend class wxQTMediaEvtHandler
;
1929 DECLARE_DYNAMIC_CLASS(wxQTMediaBackend
)
1932 // helper to hijack background erasing for the QT window
1933 class WXDLLIMPEXP_MEDIA wxQTMediaEvtHandler
: public wxEvtHandler
1936 wxQTMediaEvtHandler(wxQTMediaBackend
*qtb
, WXHWND hwnd
)
1941 m_qtb
->m_ctrl
->Connect(m_qtb
->m_ctrl
->GetId(),
1942 wxEVT_ERASE_BACKGROUND
,
1943 wxEraseEventHandler(wxQTMediaEvtHandler::OnEraseBackground
),
1947 void OnEraseBackground(wxEraseEvent
& event
);
1950 wxQTMediaBackend
*m_qtb
;
1953 DECLARE_NO_COPY_CLASS(wxQTMediaEvtHandler
)
1957 //===========================================================================
1959 //===========================================================================
1961 //---------------------------------------------------------------------------
1963 //---------------------------------------------------------------------------
1965 IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend
, wxMediaBackend
)
1967 //---------------------------------------------------------------------------
1968 // Usual debugging macros
1969 //---------------------------------------------------------------------------
1971 #define MAX_ERROR_TEXT_LEN 160
1973 // Get the error string for Active Movie
1974 wxString
wxAMMediaBackend::GetErrorString(HRESULT hrdsv
)
1976 wxChar szError
[MAX_ERROR_TEXT_LEN
];
1977 if ( m_lpAMGetErrorText
!= NULL
&&
1978 (*m_lpAMGetErrorText
)(hrdsv
, szError
, MAX_ERROR_TEXT_LEN
) == 0)
1980 return wxString::Format(wxT("DirectShow error \"%s\" \n")
1981 wxT("(numeric %X)\n")
1983 szError
, (int)hrdsv
);
1987 return wxString::Format(wxT("Unknown error \n")
1988 wxT("(numeric %X)\n")
1994 #define wxAMFAIL(x) wxFAIL_MSG(GetErrorString(x));
1995 #define wxVERIFY(x) wxASSERT((x))
1996 #define wxAMLOG(x) wxLogDebug(GetErrorString(x))
1998 #define wxAMVERIFY(x) (x)
1999 #define wxVERIFY(x) (x)
2004 //---------------------------------------------------------------------------
2005 // Standard macros for ease of use
2006 //---------------------------------------------------------------------------
2007 #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
2009 //---------------------------------------------------------------------------
2012 // Queries the control periodically to see if it has reached the point
2013 // in its loading cycle where we can begin playing the media - if so
2014 // then we finish up some things like getting the original size of the video
2015 // and then sending the loaded event to our handler
2016 //---------------------------------------------------------------------------
2017 class wxAMLoadTimer
: public wxTimer
2020 wxAMLoadTimer(wxAMMediaBackend
* parent
) :
2025 if (m_parent
->GetMP())
2027 MPReadyStateConstants nState
;
2029 #ifdef __WXWINCE__ //Cast to long needed for IWMP (??)
2030 m_parent
->GetMP()->get_ReadyState((long*)&nState
);
2032 m_parent
->GetMP()->get_ReadyState(&nState
);
2035 if (nState
!= mpReadyStateLoading
)
2038 m_parent
->FinishLoad();
2044 IActiveMovie2
* pAM2
= NULL
;
2045 ReadyStateConstants nState
;
2046 if (m_parent
->GetAM()->QueryInterface(IID_IActiveMovie2
, (void**)&pAM2
) == 0
2047 && pAM2
->get_ReadyState(&nState
) == 0)
2050 if (nState
!= amvLoading
)
2053 m_parent
->FinishLoad();
2063 m_parent
->FinishLoad();
2070 wxAMMediaBackend
* m_parent
; // Backend pointer
2073 //---------------------------------------------------------------------------
2076 // Sets m_hNotifyWnd to NULL to signify that we haven't loaded anything yet
2077 // Queries the control periodically to see if it has stopped -
2078 // if it has it sends the stop event
2079 //---------------------------------------------------------------------------
2080 class wxAMPlayTimer
: public wxTimer
2083 wxAMPlayTimer(wxAMMediaBackend
* parent
) :
2088 // NB: Stop events could get triggered by the interface
2089 // if ShowPlayerControls is enabled, so the "GetPosition == GetDuration"
2090 // hack is needed here to make an attempt at it not getting sent
2091 // - but its far from ideal - they can still get sent in some cases
2092 if (m_parent
->GetState() == wxMEDIASTATE_STOPPED
&&
2093 m_parent
->GetPosition() == m_parent
->GetDuration())
2095 if ( m_parent
->SendStopEvent() )
2097 // seek to beginning of movie
2098 m_parent
->wxAMMediaBackend::SetPosition(0);
2101 // send the event to our child
2102 m_parent
->QueueFinishEvent();
2108 wxAMMediaBackend
* m_parent
; //Backend pointer
2113 // The following is an alternative way - but it doesn't seem
2114 // to work with the IActiveMovie control - it probably processes
2116 //---------------------------------------------------------------------------
2119 // Query the IMediaEvent interface from the embedded WMP's
2120 // filtergraph, then process the events from it - sending
2121 // EC_COMPLETE events as stop events to the media control.
2122 //---------------------------------------------------------------------------
2123 class wxAMPlayTimer
: public wxTimer
2126 wxAMPlayTimer(wxAMMediaBackend
* pBE
) : m_pBE(pBE
), m_pME(NULL
)
2130 hr
= m_pBE
->GetAM()->get_FilterGraph(&pGB
);
2131 wxASSERT(SUCCEEDED(hr
));
2132 hr
= pGB
->QueryInterface(IID_IMediaEvent
, (void**)&m_pME
);
2133 wxASSERT(SUCCEEDED(hr
));
2139 SAFE_RELEASE(m_pME
);
2145 LONG_PTR evParam1
, evParam2
;
2147 // DirectShow keeps a list of queued events, and we need
2148 // to go through them one by one, stopping at (hopefully only one)
2149 // EC_COMPLETE message
2150 while ( m_pME
->GetEvent(&evCode
, &evParam1
, &evParam2
, 0) == 0 )
2152 // Cleanup memory that GetEvent allocated
2153 HRESULT hr
= m_pME
->FreeEventParams(evCode
, evParam1
, evParam2
);
2156 // Even though this makes a messagebox, this is Windows,
2157 // where we can do GUI stuff in separate threads :)
2158 wxFAIL_MSG(m_pBE
->GetErrorString(hr
));
2160 // If this is the end of the clip, notify handler
2161 else if (1 == evCode
) // EC_COMPLETE
2163 if ( m_pBE
->SendStopEvent() )
2166 m_pBE
->QueueFinishEvent();
2173 wxAMMediaBackend
* m_pBE
; // Backend pointer
2174 IMediaEvent
* m_pME
; // To determine when to send stop event
2178 //---------------------------------------------------------------------------
2179 // wxAMMediaBackend Constructor
2180 //---------------------------------------------------------------------------
2181 wxAMMediaBackend::wxAMMediaBackend()
2193 //---------------------------------------------------------------------------
2194 // wxAMMediaBackend Destructor
2195 //---------------------------------------------------------------------------
2196 wxAMMediaBackend::~wxAMMediaBackend()
2198 // Free memory from Load()
2203 m_pAX
->DissociateHandle();
2215 //---------------------------------------------------------------------------
2216 // wxAMMediaBackend::Clear
2218 // Free up interfaces and memory allocated by LoadXXX
2219 //---------------------------------------------------------------------------
2220 void wxAMMediaBackend::Clear()
2229 //---------------------------------------------------------------------------
2230 // wxAMMediaBackend::CreateControl
2231 //---------------------------------------------------------------------------
2232 bool wxAMMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
2237 const wxValidator
& validator
,
2238 const wxString
& name
)
2240 // First get the AMGetErrorText procedure in
2241 // debug mode for more meaningful messages
2243 if ( m_dllQuartz
.Load(_T("quartz.dll"), wxDL_VERBATIM
) )
2245 m_lpAMGetErrorText
= (LPAMGETERRORTEXT
)
2246 m_dllQuartz
.GetSymbolAorW(wxT("AMGetErrorText"));
2253 // Try progids first - *.WMP is PocketPC and Mediaplayer.1 is CE.NET
2254 // later versions support straight creation from CLSID
2255 if (CLSIDFromProgID(L
"WPCEOCX.WMP", &clsid
) != S_OK
&&
2256 CLSIDFromProgID(L
"MediaPlayer.MediaPlayer.1", &clsid
) != S_OK
)
2258 clsid
= CLSID_MediaPlayer
;
2261 // While the CLSID is the same as CLSID_MediaPlayer
2262 // CE only supports the IWMP interface
2263 if ( ::CoCreateInstance(clsid
, NULL
,
2264 CLSCTX_INPROC_SERVER
,
2265 IID_IWMP
, (void**)&m_pWMP
) != 0 )
2271 // determine which (if any) media player interface
2272 // is available - IMediaPlayer or IActiveMovie
2273 if ( ::CoCreateInstance(CLSID_MediaPlayer
, NULL
,
2274 CLSCTX_INPROC_SERVER
,
2275 IID_IMediaPlayer
, (void**)&m_pMP
) != 0 )
2277 if ( ::CoCreateInstance(CLSID_ActiveMovie
, NULL
,
2278 CLSCTX_INPROC_SERVER
,
2279 IID_IActiveMovie
, (void**)&m_pAM
) != 0 )
2284 m_pAM
->QueryInterface(IID_IMediaPlayer
, (void**)&m_pMP
);
2288 m_pMP
->QueryInterface(IID_IActiveMovie
, (void**)&m_pAM
);
2293 // By default wxWindow(s) is created with a border -
2294 // so we need to get rid of those
2296 // Since we don't have a child window like most other
2297 // backends, we don't need wxCLIP_CHILDREN
2298 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
2299 (style
& ~wxBORDER_MASK
) | wxBORDER_NONE
,
2305 // Create the ActiveX container along with the media player
2306 // interface and query them
2307 m_ctrl
= wxStaticCast(ctrl
, wxMediaCtrl
);
2308 m_pAX
= new wxActiveXContainer(ctrl
,
2312 m_pMP
? IID_IMediaPlayer
: IID_IActiveMovie
, m_pAM
2316 // Set up wx-specific stuff for the default
2317 // settings wxMediaCtrl says it will conform to (???)
2320 GetMP()->put_DisplaySize(mpFitToSize
);
2322 #ifndef __WXWINCE__ // Not in CE's IWMP
2323 // TODO: Unsure what actual effect this has
2324 GetMP()->put_WindowlessVideo(VARIANT_TRUE
);
2327 #ifndef __WXWINCE__ // Not in CE's IWMP
2329 GetAM()->put_MovieWindowSize(amvDoubleOriginalSize
);
2333 GetAM()->put_AutoStart(VARIANT_FALSE
);
2335 // by default enabled
2336 wxAMMediaBackend::ShowPlayerControls(wxMEDIACTRLPLAYERCONTROLS_NONE
);
2338 // by default with AM only 0.5
2339 wxAMMediaBackend::SetVolume(1.0);
2341 // don't erase the background of our control window
2342 // so that resizing is a bit smoother
2343 m_ctrl
->SetBackgroundStyle(wxBG_STYLE_CUSTOM
);
2349 //---------------------------------------------------------------------------
2350 // wxAMMediaBackend::Load (file version)
2351 //---------------------------------------------------------------------------
2352 bool wxAMMediaBackend::Load(const wxString
& fileName
)
2354 return DoLoad(fileName
);
2357 //---------------------------------------------------------------------------
2358 // wxAMMediaBackend::Load (URL Version)
2359 //---------------------------------------------------------------------------
2360 bool wxAMMediaBackend::Load(const wxURI
& location
)
2362 // Turn off loading from a proxy, as user may have set it previously
2363 INSPlay
* pPlay
= NULL
;
2364 GetAM()->QueryInterface(IID_INSPlay
, (void**) &pPlay
);
2367 pPlay
->put_UseHTTPProxy(VARIANT_FALSE
);
2371 return DoLoad(location
.BuildURI());
2374 //---------------------------------------------------------------------------
2375 // wxAMMediaBackend::Load (URL Version with Proxy)
2376 //---------------------------------------------------------------------------
2377 bool wxAMMediaBackend::Load(const wxURI
& location
, const wxURI
& proxy
)
2379 // Set the proxy of the NETSHOW interface
2380 INSPlay
* pPlay
= NULL
;
2381 GetAM()->QueryInterface(IID_INSPlay
, (void**) &pPlay
);
2385 pPlay
->put_UseHTTPProxy(VARIANT_TRUE
);
2386 pPlay
->put_HTTPProxyHost(wxBasicString(proxy
.GetServer()).Get());
2387 pPlay
->put_HTTPProxyPort(wxAtoi(proxy
.GetPort()));
2391 return DoLoad(location
.BuildURI());
2394 //---------------------------------------------------------------------------
2395 // wxAMMediaBackend::DoLoad
2397 // Called by all functions - this actually renders
2398 // the file and sets up the filter graph
2399 //---------------------------------------------------------------------------
2400 bool wxAMMediaBackend::DoLoad(const wxString
& location
)
2402 //Clear up previously allocated memory
2407 // Play the movie the normal way through the embedded WMP.
2408 // Supposedly, Open is better in theory because
2409 // the docs say its async and put_FileName is not -
2410 // but in practice they both appear to be async anyway
2412 hr
= GetMP()->Open( wxBasicString(location
).Get() );
2414 hr
= GetAM()->put_FileName( wxBasicString(location
).Get() );
2422 // In AM playing will FAIL if
2423 // the user plays before the media is loaded
2424 m_pTimer
= new wxAMLoadTimer(this);
2425 m_pTimer
->Start(20);
2430 //---------------------------------------------------------------------------
2431 // wxAMMediaBackend::FinishLoad
2433 // Called by our wxAMLoadTimer when the
2434 // embedded WMP tells its the media is ready to play.
2436 // Here we get the original size of the video and
2437 // send the loaded event to our watcher :).
2438 //---------------------------------------------------------------------------
2439 void wxAMMediaBackend::FinishLoad()
2441 // Get the original video size
2442 GetAM()->get_ImageSourceWidth((long*)&m_bestSize
.x
);
2443 GetAM()->get_ImageSourceHeight((long*)&m_bestSize
.y
);
2445 // Start the play timer to catch stop events
2446 // Previous load timer cleans up itself
2447 m_pTimer
= new wxAMPlayTimer(this);
2449 NotifyMovieLoaded();
2452 //---------------------------------------------------------------------------
2453 // wxAMMediaBackend::ShowPlayerControls
2454 //---------------------------------------------------------------------------
2455 bool wxAMMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags
)
2457 // Note that IMediaPlayer doesn't have a statusbar by
2458 // default but IActiveMovie does - so lets try to keep
2459 // the interface consistant
2462 GetAM()->put_Enabled(VARIANT_FALSE
);
2463 GetAM()->put_ShowControls(VARIANT_FALSE
);
2465 GetMP()->put_ShowStatusBar(VARIANT_FALSE
);
2469 GetAM()->put_Enabled(VARIANT_TRUE
);
2470 GetAM()->put_ShowControls(VARIANT_TRUE
);
2472 GetAM()->put_ShowPositionControls(
2473 (flags
& wxMEDIACTRLPLAYERCONTROLS_STEP
) ?
2474 VARIANT_TRUE
: VARIANT_FALSE
);
2478 GetMP()->put_ShowStatusBar(VARIANT_TRUE
);
2479 GetMP()->put_ShowAudioControls(
2480 (flags
& wxMEDIACTRLPLAYERCONTROLS_VOLUME
) ?
2481 VARIANT_TRUE
: VARIANT_FALSE
);
2488 //---------------------------------------------------------------------------
2489 // wxAMMediaBackend::Play
2491 // Plays the stream. If it is non-seekable, it will restart it (implicit).
2493 // Note that we use SUCCEEDED here because run/pause/stop tend to be overly
2494 // picky and return warnings on pretty much every call
2495 //---------------------------------------------------------------------------
2496 bool wxAMMediaBackend::Play()
2498 // Actually try to play the movie, even though it may not be loaded yet.
2500 HRESULT hr
= m_pWMP
->Play();
2502 HRESULT hr
= GetAM()->Run();
2506 m_pTimer
->Start(20);
2515 //---------------------------------------------------------------------------
2516 // wxAMMediaBackend::Pause
2518 // Pauses the stream.
2519 //---------------------------------------------------------------------------
2520 bool wxAMMediaBackend::Pause()
2522 HRESULT hr
= GetAM()->Pause();
2531 //---------------------------------------------------------------------------
2532 // wxAMMediaBackend::Stop
2534 // Stops the stream.
2535 //---------------------------------------------------------------------------
2536 bool wxAMMediaBackend::Stop()
2538 HRESULT hr
= GetAM()->Stop();
2541 // Seek to beginning
2542 wxAMMediaBackend::SetPosition(0);
2544 // Stop stop event timer
2554 //---------------------------------------------------------------------------
2555 // wxAMMediaBackend::SetPosition
2557 // 1) Translates the current position's time to directshow time,
2558 // which is in a scale of 1 second (in a double)
2559 // 2) Sets the play position of the IMediaSeeking interface -
2560 // passing NULL as the stop position means to keep the old
2562 //---------------------------------------------------------------------------
2563 bool wxAMMediaBackend::SetPosition(wxLongLong where
)
2565 HRESULT hr
= GetAM()->put_CurrentPosition(
2566 ((LONGLONG
)where
.GetValue()) / 1000.0 );
2576 //---------------------------------------------------------------------------
2577 // wxAMMediaBackend::GetPosition
2579 // 1) Obtains the current play and stop positions from IMediaSeeking
2580 // 2) Returns the play position translated to our time base
2581 //---------------------------------------------------------------------------
2582 wxLongLong
wxAMMediaBackend::GetPosition()
2585 HRESULT hr
= GetAM()->get_CurrentPosition(&outCur
);
2592 // h,m,s,milli - outdur is in 1 second (double)
2600 //---------------------------------------------------------------------------
2601 // wxAMMediaBackend::GetVolume
2603 // Gets the volume through the IBasicAudio interface -
2604 // value ranges from 0 (MAX volume) to -10000 (minimum volume).
2605 // -100 per decibel.
2606 //---------------------------------------------------------------------------
2607 double wxAMMediaBackend::GetVolume()
2610 HRESULT hr
= GetAM()->get_Volume(&lVolume
);
2617 return pow(10.0, lVolume
/ 2000.0);
2620 //---------------------------------------------------------------------------
2621 // wxAMMediaBackend::SetVolume
2623 // Sets the volume through the IBasicAudio interface -
2624 // value ranges from 0 (MAX volume) to -10000 (minimum volume).
2625 // -100 per decibel.
2626 //---------------------------------------------------------------------------
2627 bool wxAMMediaBackend::SetVolume(double dVolume
)
2629 // pow(10.0, -80.0) to correct 0 == -INF
2630 long lVolume
= (long)(2000.0 * log10( pow( 10.0, -80.0) + dVolume
) );
2631 HRESULT hr
= GetAM()->put_Volume( lVolume
);
2641 //---------------------------------------------------------------------------
2642 // wxAMMediaBackend::GetDuration
2644 // 1) Obtains the duration of the media from IAMMultiMediaStream
2645 // 2) Converts that value to our time base, and returns it
2647 // NB: With VBR MP3 files the default DirectShow MP3 render does not
2648 // read the Xing header correctly, resulting in skewed values for duration
2650 //---------------------------------------------------------------------------
2651 wxLongLong
wxAMMediaBackend::GetDuration()
2654 HRESULT hr
= GetAM()->get_Duration(&outDuration
);
2661 // h,m,s,milli - outdur is in 1 second (double)
2662 outDuration
*= 1000;
2664 ll
.Assign(outDuration
);
2669 //---------------------------------------------------------------------------
2670 // wxAMMediaBackend::GetState
2672 // Returns the cached state
2673 //---------------------------------------------------------------------------
2674 wxMediaState
wxAMMediaBackend::GetState()
2676 StateConstants nState
;
2678 HRESULT hr
= m_pWMP
->get_PlayState((long*)&nState
);
2680 HRESULT hr
= GetAM()->get_CurrentState(&nState
);
2685 return wxMEDIASTATE_STOPPED
;
2688 return (wxMediaState
)nState
;
2691 //---------------------------------------------------------------------------
2692 // wxAMMediaBackend::GetPlaybackRate
2694 // Pretty simple way of obtaining the playback rate from
2695 // the IMediaSeeking interface
2696 //---------------------------------------------------------------------------
2697 double wxAMMediaBackend::GetPlaybackRate()
2700 HRESULT hr
= GetAM()->get_Rate(&dRate
);
2710 //---------------------------------------------------------------------------
2711 // wxAMMediaBackend::SetPlaybackRate
2713 // Sets the playback rate of the media - DirectShow is pretty good
2714 // about this, actually
2715 //---------------------------------------------------------------------------
2716 bool wxAMMediaBackend::SetPlaybackRate(double dRate
)
2718 HRESULT hr
= GetAM()->put_Rate(dRate
);
2728 //---------------------------------------------------------------------------
2729 // wxAMMediaBackend::GetDownloadXXX
2731 // Queries for and gets the total size of the file and the current
2732 // progress in downloading that file from the IAMOpenProgress
2733 // interface from the media player interface's filter graph
2734 //---------------------------------------------------------------------------
2735 void wxAMMediaBackend::DoGetDownloadProgress(wxLongLong
* pLoadProgress
,
2736 wxLongLong
* pLoadTotal
)
2739 LONGLONG loadTotal
= 0, loadProgress
= 0;
2741 IAMOpenProgress
* pOP
;
2743 hr
= GetAM()->get_FilterGraph(&pFG
);
2746 hr
= pFG
->QueryInterface(IID_IAMOpenProgress
, (void**)&pOP
);
2749 hr
= pOP
->QueryProgress(&loadTotal
, &loadProgress
);
2758 *pLoadProgress
= loadProgress
;
2759 *pLoadTotal
= loadTotal
;
2764 // When not loading from a URL QueryProgress will return
2765 // E_NOINTERFACE or whatever
2772 //---------------------------------------------------------------------------
2773 // wxAMMediaBackend::GetVideoSize
2775 // Obtains the cached original video size
2776 //---------------------------------------------------------------------------
2777 wxSize
wxAMMediaBackend::GetVideoSize() const
2782 //---------------------------------------------------------------------------
2783 // wxAMMediaBackend::Move
2785 // We take care of this in our redrawing
2786 //---------------------------------------------------------------------------
2787 void wxAMMediaBackend::Move(int WXUNUSED(x
), int WXUNUSED(y
),
2788 int WXUNUSED(w
), int WXUNUSED(h
))
2792 //---------------------------------------------------------------------------
2793 // End of wxAMMediaBackend
2794 //---------------------------------------------------------------------------
2796 //---------------------------------------------------------------------------
2797 // wxMCIMediaBackend
2798 //---------------------------------------------------------------------------
2801 IMPLEMENT_DYNAMIC_CLASS(wxMCIMediaBackend
, wxMediaBackend
)
2803 //---------------------------------------------------------------------------
2804 // Usual debugging macros for MCI returns
2805 //---------------------------------------------------------------------------
2808 #define wxMCIVERIFY(arg) \
2811 if ( (nRet = (arg)) != 0) \
2814 mciGetErrorString(nRet, sz, 5000); \
2815 wxFAIL_MSG(wxString::Format(_T("MCI Error:%s"), sz)); \
2819 #define wxMCIVERIFY(arg) (arg);
2822 //---------------------------------------------------------------------------
2823 // Simulation for <digitalv.h>
2825 // Mingw and possibly other compilers don't have the digitalv.h header
2826 // that is needed to have some essential features of mci work with
2827 // windows - so we provide the declarations for the types we use here
2828 //---------------------------------------------------------------------------
2832 DWORD_PTR dwCallback
;
2833 #ifdef MCI_USE_OFFEXT
2844 DWORD_PTR dwCallback
;
2855 MCI_DGV_WINDOW_PARMS
;
2859 DWORD_PTR dwCallback
;
2869 DWORD_PTR dwCallback
;
2873 wxChar
* lpstrAlgorithm
;
2874 wxChar
* lpstrQuality
;
2876 MCI_DGV_SETAUDIO_PARMS
;
2878 //---------------------------------------------------------------------------
2879 // wxMCIMediaBackend Constructor
2881 // Here we don't need to do much except say we don't have any video :)
2882 //---------------------------------------------------------------------------
2883 wxMCIMediaBackend::wxMCIMediaBackend() : m_hNotifyWnd(NULL
), m_bVideo(false)
2887 //---------------------------------------------------------------------------
2888 // wxMCIMediaBackend Destructor
2890 // We close the MCI device - note that there may not be an MCI device here,
2891 // or it may fail - but we don't really care, since we're destructing
2892 //---------------------------------------------------------------------------
2893 wxMCIMediaBackend::~wxMCIMediaBackend()
2897 mciSendCommand(m_hDev
, MCI_CLOSE
, 0, 0);
2898 DestroyWindow(m_hNotifyWnd
);
2899 m_hNotifyWnd
= NULL
;
2903 //---------------------------------------------------------------------------
2904 // wxMCIMediaBackend::Create
2906 // Here we just tell wxMediaCtrl that MCI does exist (which it does, on all
2907 // msw systems, at least in some form dating back to win16 days)
2908 //---------------------------------------------------------------------------
2909 bool wxMCIMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
2914 const wxValidator
& validator
,
2915 const wxString
& name
)
2918 // By default wxWindow(s) is created with a border -
2919 // so we need to get rid of those, and create with
2920 // wxCLIP_CHILDREN, so that if the driver/backend
2921 // is a child window, it refereshes properly
2922 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
2923 (style
& ~wxBORDER_MASK
) | wxBORDER_NONE
| wxCLIP_CHILDREN
,
2927 m_ctrl
= wxStaticCast(ctrl
, wxMediaCtrl
);
2932 //---------------------------------------------------------------------------
2933 // wxMCIMediaBackend::Load (file version)
2935 // Here we have MCI load a file and device, set the time format to our
2936 // default (milliseconds), and set the video (if any) to play in the control
2937 //---------------------------------------------------------------------------
2938 bool wxMCIMediaBackend::Load(const wxString
& fileName
)
2940 // if the user already called load close the previous MCI device
2943 mciSendCommand(m_hDev
, MCI_CLOSE
, 0, 0);
2944 DestroyWindow(m_hNotifyWnd
);
2945 m_hNotifyWnd
= NULL
;
2948 // Opens a file and has MCI select a device. Normally you'd put
2949 // MCI_OPEN_TYPE in addition to MCI_OPEN_ELEMENT - however if you
2950 // omit this it tells MCI to select the device instead. This is good
2951 // because we have no reliable way of "enumerating" the devices in MCI
2952 MCI_OPEN_PARMS openParms
;
2953 openParms
.lpstrElementName
= (wxChar
*) fileName
.c_str();
2955 if (mciSendCommand(0, MCI_OPEN
, MCI_OPEN_ELEMENT
,
2956 (DWORD
)(LPVOID
)&openParms
) != 0)
2961 m_hDev
= openParms
.wDeviceID
;
2963 // set the time format for the device to milliseconds
2964 MCI_SET_PARMS setParms
;
2965 setParms
.dwCallback
= 0;
2966 setParms
.dwTimeFormat
= MCI_FORMAT_MILLISECONDS
;
2968 if (mciSendCommand(m_hDev
, MCI_SET
, MCI_SET_TIME_FORMAT
,
2969 (DWORD
)(LPVOID
)&setParms
) != 0)
2974 // tell the MCI device to display the video in our wxMediaCtrl
2975 MCI_DGV_WINDOW_PARMS windowParms
;
2976 windowParms
.hWnd
= (HWND
)m_ctrl
->GetHandle();
2978 m_bVideo
= (mciSendCommand(m_hDev
, MCI_WINDOW
,
2979 0x00010000L
, // MCI_DGV_WINDOW_HWND
2980 (DWORD
)(LPVOID
)&windowParms
) == 0);
2982 // Create a hidden window and register to handle MCI events
2983 // Note that wxCanvasClassName is already registered
2984 // and used by all wxWindows and normal wxControls
2985 m_hNotifyWnd
= ::CreateWindow(
2997 wxLogSysError( wxT("Could not create hidden needed for ")
2998 wxT("registering for MCI events!") );
3003 wxSetWindowProc(m_hNotifyWnd
, wxMCIMediaBackend::NotifyWndProc
);
3004 wxSetWindowUserData(m_hNotifyWnd
, this);
3006 NotifyMovieLoaded();
3011 //---------------------------------------------------------------------------
3012 // wxMCIMediaBackend::Load (URL version)
3014 // MCI doesn't support URLs directly (?)
3016 // TODO: Use wxURL/wxFileSystem and mmioInstallProc
3017 //---------------------------------------------------------------------------
3018 bool wxMCIMediaBackend::Load(const wxURI
& WXUNUSED(location
))
3023 //---------------------------------------------------------------------------
3024 // wxMCIMediaBackend::Play
3026 // Plays/Resumes the MCI device... a couple notes:
3027 // 1) Certain drivers will crash and burn if we don't pass them an
3028 // MCI_PLAY_PARMS, despite the documentation that says otherwise...
3029 // 2) There is a MCI_RESUME command, but MCI_PLAY does the same thing
3030 // and will resume from a stopped state also, so there's no need to
3031 // call both, for example
3032 //---------------------------------------------------------------------------
3033 bool wxMCIMediaBackend::Play()
3035 MCI_PLAY_PARMS playParms
;
3036 playParms
.dwCallback
= (DWORD
)m_hNotifyWnd
;
3038 bool bOK
= (mciSendCommand(m_hDev
, MCI_PLAY
, MCI_NOTIFY
,
3039 (DWORD
)(LPVOID
)&playParms
) == 0);
3042 m_ctrl
->Show(m_bVideo
);
3047 //---------------------------------------------------------------------------
3048 // wxMCIMediaBackend::Pause
3050 // Pauses the MCI device - nothing special
3051 //---------------------------------------------------------------------------
3052 bool wxMCIMediaBackend::Pause()
3054 return (mciSendCommand(m_hDev
, MCI_PAUSE
, MCI_WAIT
, 0) == 0);
3057 //---------------------------------------------------------------------------
3058 // wxMCIMediaBackend::Stop
3060 // Stops the MCI device & seeks to the beginning as wxMediaCtrl docs outline
3061 //---------------------------------------------------------------------------
3062 bool wxMCIMediaBackend::Stop()
3064 return (mciSendCommand(m_hDev
, MCI_STOP
, MCI_WAIT
, 0) == 0) &&
3065 (mciSendCommand(m_hDev
, MCI_SEEK
, MCI_SEEK_TO_START
, 0) == 0);
3068 //---------------------------------------------------------------------------
3069 // wxMCIMediaBackend::GetState
3071 // Here we get the state and convert it to a wxMediaState -
3072 // since we use direct comparisons with MCI_MODE_PLAY and
3073 // MCI_MODE_PAUSE, we don't care if the MCI_STATUS call
3075 //---------------------------------------------------------------------------
3076 wxMediaState
wxMCIMediaBackend::GetState()
3078 MCI_STATUS_PARMS statusParms
;
3079 statusParms
.dwItem
= MCI_STATUS_MODE
;
3081 mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3082 (DWORD
)(LPVOID
)&statusParms
);
3084 if (statusParms
.dwReturn
== MCI_MODE_PAUSE
)
3085 return wxMEDIASTATE_PAUSED
;
3086 else if (statusParms
.dwReturn
== MCI_MODE_PLAY
)
3087 return wxMEDIASTATE_PLAYING
;
3089 return wxMEDIASTATE_STOPPED
;
3092 //---------------------------------------------------------------------------
3093 // wxMCIMediaBackend::SetPosition
3095 // Here we set the position of the device in the stream.
3096 // Note that MCI actually stops the device after you seek it if the
3097 // device is playing/paused, so we need to play the file after
3098 // MCI seeks like normal APIs would
3099 //---------------------------------------------------------------------------
3100 bool wxMCIMediaBackend::SetPosition(wxLongLong where
)
3102 MCI_SEEK_PARMS seekParms
;
3103 seekParms
.dwCallback
= 0;
3105 #if wxUSE_LONGLONG_NATIVE && !wxUSE_LONGLONG_WX
3106 seekParms
.dwTo
= (DWORD
)where
.GetValue();
3107 #else // wxUSE_LONGLONG_WX
3108 // no way to return it in one piece
3109 wxASSERT( where
.GetHi() == 0 );
3110 seekParms
.dwTo
= (DWORD
)where
.GetLo();
3113 // device was playing?
3114 bool bReplay
= GetState() == wxMEDIASTATE_PLAYING
;
3116 if ( mciSendCommand(m_hDev
, MCI_SEEK
, MCI_TO
,
3117 (DWORD
)(LPVOID
)&seekParms
) != 0)
3122 // If the device was playing, resume it
3129 //---------------------------------------------------------------------------
3130 // wxMCIMediaBackend::GetPosition
3132 // Gets the position of the device in the stream using the current
3133 // time format... nothing special here...
3134 //---------------------------------------------------------------------------
3135 wxLongLong
wxMCIMediaBackend::GetPosition()
3137 MCI_STATUS_PARMS statusParms
;
3138 statusParms
.dwItem
= MCI_STATUS_POSITION
;
3140 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3141 (DWORD
)(LPSTR
)&statusParms
) != 0)
3146 return statusParms
.dwReturn
;
3149 //---------------------------------------------------------------------------
3150 // wxMCIMediaBackend::GetVolume
3152 // Gets the volume of the current media via the MCI_DGV_STATUS_VOLUME
3153 // message. Value ranges from 0 (minimum) to 1000 (maximum volume).
3154 //---------------------------------------------------------------------------
3155 double wxMCIMediaBackend::GetVolume()
3157 MCI_STATUS_PARMS statusParms
;
3158 statusParms
.dwCallback
= 0;
3159 statusParms
.dwItem
= 0x4019; // MCI_DGV_STATUS_VOLUME
3161 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3162 (DWORD
)(LPSTR
)&statusParms
) != 0)
3167 return ((double)statusParms
.dwReturn
) / 1000.0;
3170 //---------------------------------------------------------------------------
3171 // wxMCIMediaBackend::SetVolume
3173 // Sets the volume of the current media via the MCI_DGV_SETAUDIO_VOLUME
3174 // message. Value ranges from 0 (minimum) to 1000 (maximum volume).
3175 //---------------------------------------------------------------------------
3176 bool wxMCIMediaBackend::SetVolume(double dVolume
)
3178 MCI_DGV_SETAUDIO_PARMS audioParms
;
3179 audioParms
.dwCallback
= 0;
3180 audioParms
.dwItem
= 0x4002; // MCI_DGV_SETAUDIO_VOLUME
3181 audioParms
.dwValue
= (DWORD
) (dVolume
* 1000.0);
3182 audioParms
.dwOver
= 0;
3183 audioParms
.lpstrAlgorithm
= NULL
;
3184 audioParms
.lpstrQuality
= NULL
;
3186 if (mciSendCommand(m_hDev
, 0x0873, // MCI_SETAUDIO
3187 // MCI_DGV_SETAUDIO + (_ITEM | _VALUE)
3188 0x00800000L
| 0x01000000L
,
3189 (DWORD
)(LPSTR
)&audioParms
) != 0)
3197 //---------------------------------------------------------------------------
3198 // wxMCIMediaBackend::GetDuration
3200 // Gets the duration of the stream... nothing special
3201 //---------------------------------------------------------------------------
3202 wxLongLong
wxMCIMediaBackend::GetDuration()
3204 MCI_STATUS_PARMS statusParms
;
3205 statusParms
.dwItem
= MCI_STATUS_LENGTH
;
3207 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3208 (DWORD
)(LPSTR
)&statusParms
) != 0)
3213 return statusParms
.dwReturn
;
3216 //---------------------------------------------------------------------------
3217 // wxMCIMediaBackend::Move
3219 // Moves the window to a location
3220 //---------------------------------------------------------------------------
3221 void wxMCIMediaBackend::Move(int WXUNUSED(x
), int WXUNUSED(y
), int w
, int h
)
3223 if (m_hNotifyWnd
&& m_bVideo
)
3225 MCI_DGV_RECT_PARMS putParms
; // ifdefed MCI_DGV_PUT_PARMS
3226 memset(&putParms
, 0, sizeof(MCI_DGV_RECT_PARMS
));
3227 putParms
.rc
.bottom
= h
;
3228 putParms
.rc
.right
= w
;
3230 // wxStackWalker will crash and burn here on assert
3231 // and MCI doesn't like 0 and 0 for some reason (out of range)
3232 // so just don't it in that case
3235 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_PUT
,
3236 0x00040000L
, // MCI_DGV_PUT_DESTINATION
3237 (DWORD
)(LPSTR
)&putParms
) );
3242 //---------------------------------------------------------------------------
3243 // wxMCIMediaBackend::GetVideoSize
3245 // Gets the original size of the movie for sizers
3246 //---------------------------------------------------------------------------
3247 wxSize
wxMCIMediaBackend::GetVideoSize() const
3251 MCI_DGV_RECT_PARMS whereParms
; // ifdefed MCI_DGV_WHERE_PARMS
3253 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_WHERE
,
3254 0x00020000L
, // MCI_DGV_WHERE_SOURCE
3255 (DWORD
)(LPSTR
)&whereParms
) );
3257 return wxSize(whereParms
.rc
.right
, whereParms
.rc
.bottom
);
3260 return wxSize(0, 0);
3263 //---------------------------------------------------------------------------
3264 // wxMCIMediaBackend::GetPlaybackRate
3267 //---------------------------------------------------------------------------
3268 double wxMCIMediaBackend::GetPlaybackRate()
3273 //---------------------------------------------------------------------------
3274 // wxMCIMediaBackend::SetPlaybackRate
3277 //---------------------------------------------------------------------------
3278 bool wxMCIMediaBackend::SetPlaybackRate(double WXUNUSED(dRate
))
3281 MCI_WAVE_SET_SAMPLESPERSEC
3282 MCI_DGV_SET_PARMS setParms
;
3283 setParms
.dwSpeed
= (DWORD
) (dRate
* 1000.0);
3285 return (mciSendCommand(m_hDev
, MCI_SET
,
3286 0x00020000L
, // MCI_DGV_SET_SPEED
3287 (DWORD
)(LPSTR
)&setParms
) == 0);
3293 //---------------------------------------------------------------------------
3294 // [static] wxMCIMediaBackend::MSWWindowProc
3296 // Here we process a message when MCI reaches the stopping point
3298 //---------------------------------------------------------------------------
3299 LRESULT CALLBACK
wxMCIMediaBackend::NotifyWndProc(HWND hWnd
, UINT nMsg
,
3303 wxMCIMediaBackend
* backend
=
3304 (wxMCIMediaBackend
*)wxGetWindowUserData(hWnd
);
3306 return backend
->OnNotifyWndProc(hWnd
, nMsg
, wParam
, lParam
);
3309 LRESULT CALLBACK
wxMCIMediaBackend::OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
3313 if (nMsg
== MM_MCINOTIFY
)
3315 wxASSERT(lParam
== (LPARAM
) m_hDev
);
3316 if (wParam
== MCI_NOTIFY_SUCCESSFUL
&& lParam
== (LPARAM
)m_hDev
)
3318 if ( SendStopEvent() )
3320 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_SEEK
, MCI_SEEK_TO_START
, 0) );
3325 return DefWindowProc(hWnd
, nMsg
, wParam
, lParam
);
3327 #endif // __WXWINCE__
3329 //---------------------------------------------------------------------------
3332 // TODO: Use a less kludgy way to pause/get state/set state
3333 // FIXME: Greg Hazel reports that sometimes files that cannot be played
3334 // with this backend are treated as playable anyway - not verified though.
3335 //---------------------------------------------------------------------------
3337 IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend
, wxMediaBackend
)
3339 // Time between timer calls - this is the Apple recommendation to the TCL
3341 #define MOVIE_DELAY 20
3343 //---------------------------------------------------------------------------
3346 // QT, esp. QT for Windows is very picky about how you go about
3347 // async loading. If you were to go through a Windows message loop
3348 // or a MoviesTask or both and then check the movie load state
3349 // it would still return 1000 (loading)... even (pre)prerolling doesn't
3350 // help. However, making a load timer like this works
3351 //---------------------------------------------------------------------------
3352 class wxQTLoadTimer
: public wxTimer
3355 wxQTLoadTimer(Movie movie
, wxQTMediaBackend
* parent
, wxQuickTimeLibrary
* pLib
) :
3356 m_movie(movie
), m_parent(parent
), m_pLib(pLib
) {}
3360 m_pLib
->MoviesTask(m_movie
, 0);
3361 // kMovieLoadStatePlayable
3362 if (m_pLib
->GetMovieLoadState(m_movie
) >= 10000)
3364 m_parent
->FinishLoad();
3370 Movie m_movie
; //Our movie instance
3371 wxQTMediaBackend
* m_parent
; //Backend pointer
3372 wxQuickTimeLibrary
* m_pLib
; //Interfaces
3376 // --------------------------------------------------------------------------
3377 // wxQTPlayTimer - Handle Asyncronous Playing
3379 // 1) Checks to see if the movie is done, and if not continues
3380 // streaming the movie
3381 // 2) Sends the wxEVT_MEDIA_STOP event if we have reached the end of
3383 // --------------------------------------------------------------------------
3384 class wxQTPlayTimer
: public wxTimer
3387 wxQTPlayTimer(Movie movie
, wxQTMediaBackend
* parent
,
3388 wxQuickTimeLibrary
* pLib
) :
3389 m_movie(movie
), m_parent(parent
), m_pLib(pLib
) {}
3394 // OK, a little explaining - basically originally
3395 // we only called MoviesTask if the movie was actually
3396 // playing (not paused or stopped)... this was before
3397 // we realized MoviesTask actually handles repainting
3398 // of the current frame - so if you were to resize
3399 // or something it would previously not redraw that
3400 // portion of the movie.
3402 // So now we call MoviesTask always so that it repaints
3405 m_pLib
->MoviesTask(m_movie
, 0);
3408 // Handle the stop event - if the movie has reached
3409 // the end, notify our handler
3411 // m_bPlaying == !(Stopped | Paused)
3413 if (m_parent
->m_bPlaying
)
3415 if (m_pLib
->IsMovieDone(m_movie
))
3417 if ( m_parent
->SendStopEvent() )
3420 wxASSERT(m_pLib
->GetMoviesError() == noErr
);
3422 m_parent
->QueueFinishEvent();
3429 Movie m_movie
; // Our movie instance
3430 wxQTMediaBackend
* m_parent
; //Backend pointer
3431 wxQuickTimeLibrary
* m_pLib
; //Interfaces
3435 //---------------------------------------------------------------------------
3436 // wxQTMediaBackend::QTWndProc
3438 // Forwards events to the Movie Controller so that it can
3439 // redraw itself/process messages etc..
3440 //---------------------------------------------------------------------------
3441 LRESULT CALLBACK
wxQTMediaBackend::QTWndProc(HWND hWnd
, UINT nMsg
,
3442 WPARAM wParam
, LPARAM lParam
)
3444 wxQTMediaBackend
* pThis
= (wxQTMediaBackend
*)wxGetWindowUserData(hWnd
);
3449 msg
.wParam
= wParam
;
3450 msg
.lParam
= lParam
;
3454 EventRecord theEvent
;
3455 pThis
->m_lib
.NativeEventToMacEvent(&msg
, &theEvent
);
3456 pThis
->m_lib
.MCIsPlayerEvent(pThis
->m_pMC
, &theEvent
);
3458 return pThis
->m_ctrl
->MSWWindowProc(nMsg
, wParam
, lParam
);
3461 //---------------------------------------------------------------------------
3462 // wxQTMediaBackend Destructor
3464 // Sets m_timer to NULL signifying we havn't loaded anything yet
3465 //---------------------------------------------------------------------------
3466 wxQTMediaBackend::wxQTMediaBackend()
3467 : m_movie(NULL
), m_bPlaying(false), m_timer(NULL
), m_pMC(NULL
)
3471 //---------------------------------------------------------------------------
3472 // wxQTMediaBackend Destructor
3474 // 1) Cleans up the QuickTime movie instance
3475 // 2) Decrements the QuickTime reference counter - if this reaches
3476 // 0, QuickTime shuts down
3477 // 3) Decrements the QuickTime Windows Media Layer reference counter -
3478 // if this reaches 0, QuickTime shuts down the Windows Media Layer
3479 //---------------------------------------------------------------------------
3480 wxQTMediaBackend::~wxQTMediaBackend()
3489 m_lib
.DisposeMovieController(m_pMC
);
3493 // destroy wxQTMediaEvtHandler we pushed on it
3494 m_ctrl
->PopEventHandler(true);
3496 m_lib
.DestroyPortAssociation(
3497 (CGrafPtr
)m_lib
.GetNativeWindowPort(m_ctrl
->GetHWND()));
3499 //Note that ExitMovies() is not necessary, but
3500 //the docs are fuzzy on whether or not TerminateQTML is
3502 m_lib
.TerminateQTML();
3506 //---------------------------------------------------------------------------
3507 // wxQTMediaBackend::CreateControl
3509 // 1) Intializes QuickTime
3510 // 2) Creates the control window
3511 //---------------------------------------------------------------------------
3512 bool wxQTMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
3517 const wxValidator
& validator
,
3518 const wxString
& name
)
3520 if (!m_lib
.Initialize())
3523 int nError
= m_lib
.InitializeQTML(0);
3524 if (nError
!= noErr
) //-2093 no dll
3526 wxFAIL_MSG(wxString::Format(wxT("Couldn't Initialize Quicktime-%i"), nError
));
3530 m_lib
.EnterMovies();
3533 // By default wxWindow(s) is created with a border -
3534 // so we need to get rid of those
3536 // Since we don't have a child window like most other
3537 // backends, we don't need wxCLIP_CHILDREN
3538 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
3539 (style
& ~wxBORDER_MASK
) | wxBORDER_NONE
,
3545 m_ctrl
= wxStaticCast(ctrl
, wxMediaCtrl
);
3547 // Create a port association for our window so we
3548 // can use it as a WindowRef
3549 m_lib
.CreatePortAssociation(m_ctrl
->GetHWND(), NULL
, 0L);
3551 // Part of a suggestion from Greg Hazel
3552 // to repaint movie when idle
3553 m_ctrl
->PushEventHandler(new wxQTMediaEvtHandler(this, m_ctrl
->GetHWND()));
3559 //---------------------------------------------------------------------------
3560 // wxQTMediaBackend::Load (file version)
3562 // 1) Get an FSSpec from the Windows path name
3563 // 2) Open the movie
3564 // 3) Obtain the movie instance from the movie resource
3565 // 4) Close the movie resource
3566 // 5) Finish loading
3567 //---------------------------------------------------------------------------
3568 bool wxQTMediaBackend::Load(const wxString
& fileName
)
3575 short movieResFile
= 0; //= 0 because of annoying VC6 warning
3578 err
= m_lib
.NativePathNameToFSSpec(
3579 (char*) (const char*) fileName
.mb_str(),
3581 result
= (err
== noErr
);
3585 err
= m_lib
.OpenMovieFile(&sfFile
, &movieResFile
, fsRdPerm
);
3586 result
= (err
== noErr
);
3591 short movieResID
= 0;
3594 err
= m_lib
.NewMovieFromFile(
3600 NULL
); // wasChanged
3601 result
= (err
== noErr
&& m_lib
.GetMoviesStickyError() == noErr
);
3603 // check m_lib.GetMoviesStickyError() because it may not find the
3604 // proper codec and play black video and other strange effects,
3605 // not to mention mess up the dynamic backend loading scheme
3606 // of wxMediaCtrl - so it just does what the QuickTime player does
3609 m_lib
.CloseMovieFile(movieResFile
);
3617 //---------------------------------------------------------------------------
3618 // wxQTMediaBackend::PPRMProc (static)
3620 // Called when done PrePrerolling the movie.
3621 // Note that in 99% of the cases this does nothing...
3622 // Anyway we set up the loading timer here to tell us when the movie is done
3623 //---------------------------------------------------------------------------
3624 void wxQTMediaBackend::PPRMProc (Movie theMovie
,
3625 OSErr
WXUNUSED_UNLESS_DEBUG(theErr
),
3628 wxASSERT( theMovie
);
3629 wxASSERT( theRefCon
);
3630 wxASSERT( theErr
== noErr
);
3632 wxQTMediaBackend
* pBE
= (wxQTMediaBackend
*) theRefCon
;
3634 long lTime
= pBE
->m_lib
.GetMovieTime(theMovie
,NULL
);
3635 Fixed rate
= pBE
->m_lib
.GetMoviePreferredRate(theMovie
);
3636 pBE
->m_lib
.PrerollMovie(theMovie
, lTime
, rate
);
3637 pBE
->m_timer
= new wxQTLoadTimer(pBE
->m_movie
, pBE
, &pBE
->m_lib
);
3638 pBE
->m_timer
->Start(MOVIE_DELAY
);
3641 //---------------------------------------------------------------------------
3642 // wxQTMediaBackend::Load (URL Version)
3644 // 1) Build an escaped URI from location
3645 // 2) Create a handle to store the URI string
3646 // 3) Put the URI string inside the handle
3647 // 4) Make a QuickTime URL data ref from the handle with the URI in it
3648 // 5) Clean up the URI string handle
3649 // 6) Do some prerolling
3650 // 7) Finish Loading
3651 //---------------------------------------------------------------------------
3652 bool wxQTMediaBackend::Load(const wxURI
& location
)
3657 wxString theURI
= location
.BuildURI();
3659 Handle theHandle
= m_lib
.NewHandleClear(theURI
.length() + 1);
3660 wxASSERT(theHandle
);
3662 m_lib
.BlockMove(theURI
.mb_str(), *theHandle
, theURI
.length() + 1);
3664 // create the movie from the handle that refers to the URI
3665 OSErr err
= m_lib
.NewMovieFromDataRef(&m_movie
, newMovieActive
|
3667 /* | newMovieIdleImportOK */,
3669 URLDataHandlerSubType
);
3671 m_lib
.DisposeHandle(theHandle
);
3678 timeNow
= m_lib
.GetMovieTime(m_movie
, NULL
);
3679 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3681 playRate
= m_lib
.GetMoviePreferredRate(m_movie
);
3682 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3684 // Note that the callback here is optional,
3685 // but without it PrePrerollMovie can be buggy
3686 // (see Apple ml). Also, some may wonder
3687 // why we need this at all - this is because
3688 // Apple docs say QuickTime streamed movies
3689 // require it if you don't use a Movie Controller,
3690 // which we don't by default.
3692 m_lib
.PrePrerollMovie(m_movie
, timeNow
, playRate
,
3693 (WXFARPROC
)wxQTMediaBackend::PPRMProc
,
3702 //---------------------------------------------------------------------------
3703 // wxQTMediaBackend::FinishLoad
3705 // 1) Create the movie timer
3706 // 2) Get real size of movie for GetBestSize/sizers
3707 // 3) Set the movie time scale to something usable so that seeking
3708 // etc. will work correctly
3709 // 4) Set our Movie Controller to display the movie if it exists,
3710 // otherwise set the bounds of the Movie
3711 // 5) Refresh parent window
3712 //---------------------------------------------------------------------------
3713 void wxQTMediaBackend::FinishLoad()
3715 // Create the playing/streaming timer
3716 m_timer
= new wxQTPlayTimer(m_movie
, (wxQTMediaBackend
*) this, &m_lib
);
3719 m_timer
->Start(MOVIE_DELAY
, wxTIMER_CONTINUOUS
);
3721 // get the real size of the movie
3723 memset(&outRect
, 0, sizeof(Rect
)); // suppress annoying VC6 warning
3724 m_lib
.GetMovieNaturalBoundsRect (m_movie
, &outRect
);
3725 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3727 m_bestSize
.x
= outRect
.right
- outRect
.left
;
3728 m_bestSize
.y
= outRect
.bottom
- outRect
.top
;
3730 // Handle the movie GWorld
3734 thePoint
.h
= thePoint
.v
= 0;
3735 m_lib
.MCSetMovie(m_pMC
, m_movie
,
3736 m_lib
.GetNativeWindowPort(m_ctrl
->GetHandle()),
3738 m_lib
.MCSetVisible(m_pMC
, true);
3743 m_lib
.SetMovieGWorld(m_movie
,
3744 (CGrafPtr
) m_lib
.GetNativeWindowPort(m_ctrl
->GetHWND()),
3748 // Set the movie to millisecond precision
3749 m_lib
.SetMovieTimeScale(m_movie
, 1000);
3750 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3752 NotifyMovieLoaded();
3755 //---------------------------------------------------------------------------
3756 // wxQTMediaBackend::Play
3758 // 1) Start the QT movie
3759 // 2) Start the movie loading timer
3761 // NOTE: This will still return success even when
3762 // the movie is still loading, and as mentioned in wxQTLoadTimer
3763 // I don't know of a way to force this to be sync - so if its
3764 // still loading the function will return true but the movie will
3765 // still be in the stopped state
3766 //---------------------------------------------------------------------------
3767 bool wxQTMediaBackend::Play()
3769 m_lib
.StartMovie(m_movie
);
3772 return m_lib
.GetMoviesError() == noErr
;
3775 //---------------------------------------------------------------------------
3776 // wxQTMediaBackend::Pause
3778 // 1) Stop the movie
3779 // 2) Stop the movie timer
3780 //---------------------------------------------------------------------------
3781 bool wxQTMediaBackend::Pause()
3784 m_lib
.StopMovie(m_movie
);
3786 return m_lib
.GetMoviesError() == noErr
;
3789 //---------------------------------------------------------------------------
3790 // wxQTMediaBackend::Stop
3792 // 1) Stop the movie
3793 // 2) Stop the movie timer
3794 // 3) Seek to the beginning of the movie
3795 //---------------------------------------------------------------------------
3796 bool wxQTMediaBackend::Stop()
3800 m_lib
.StopMovie(m_movie
);
3801 if (m_lib
.GetMoviesError() == noErr
)
3802 m_lib
.GoToBeginningOfMovie(m_movie
);
3804 return m_lib
.GetMoviesError() == noErr
;
3807 //---------------------------------------------------------------------------
3808 // wxQTMediaBackend::GetPlaybackRate
3810 // Get the movie playback rate from ::GetMovieRate
3811 //---------------------------------------------------------------------------
3812 double wxQTMediaBackend::GetPlaybackRate()
3814 return ( ((double)m_lib
.GetMovieRate(m_movie
)) / 0x10000);
3817 //---------------------------------------------------------------------------
3818 // wxQTMediaBackend::SetPlaybackRate
3820 // Convert dRate to Fixed and Set the movie rate through SetMovieRate
3821 //---------------------------------------------------------------------------
3822 bool wxQTMediaBackend::SetPlaybackRate(double dRate
)
3824 m_lib
.SetMovieRate(m_movie
, (Fixed
) (dRate
* 0x10000));
3826 return m_lib
.GetMoviesError() == noErr
;
3829 //---------------------------------------------------------------------------
3830 // wxQTMediaBackend::SetPosition
3832 // 1) Create a time record struct (TimeRecord) with appropriate values
3833 // 2) Pass struct to SetMovieTime
3834 //---------------------------------------------------------------------------
3835 bool wxQTMediaBackend::SetPosition(wxLongLong where
)
3837 // NB: For some reason SetMovieTime does not work
3838 // correctly with the Quicktime Windows SDK (6)
3839 // From Muskelkatermann at the wxForum
3840 // http://www.solidsteel.nl/users/wxwidgets/viewtopic.php?t=2957
3841 // RN - note that I have not verified this but there
3842 // is no harm in calling SetMovieTimeValue instead
3844 TimeRecord theTimeRecord
;
3845 memset(&theTimeRecord
, 0, sizeof(TimeRecord
));
3846 theTimeRecord
.value
.lo
= where
.GetLo();
3847 theTimeRecord
.scale
= m_lib
.GetMovieTimeScale(m_movie
);
3848 theTimeRecord
.base
= m_lib
.GetMovieTimeBase(m_movie
);
3849 m_lib
.SetMovieTime(m_movie
, &theTimeRecord
);
3851 m_lib
.SetMovieTimeValue(m_movie
, where
.GetLo());
3854 return (m_lib
.GetMoviesError() == noErr
);
3857 //---------------------------------------------------------------------------
3858 // wxQTMediaBackend::GetPosition
3860 // 1) Calls GetMovieTime to get the position we are in in the movie
3861 // in milliseconds (we called
3862 //---------------------------------------------------------------------------
3863 wxLongLong
wxQTMediaBackend::GetPosition()
3865 return m_lib
.GetMovieTime(m_movie
, NULL
);
3868 //---------------------------------------------------------------------------
3869 // wxQTMediaBackend::GetVolume
3871 // Gets the volume through GetMovieVolume - which returns a 16 bit short -
3873 // +--------+--------+
3875 // +--------+--------+
3877 // (1) first 8 bits are value before decimal
3878 // (2) second 8 bits are value after decimal
3880 // Volume ranges from -1.0 (gain but no sound), 0 (no sound and no gain) to
3881 // 1 (full gain and sound)
3882 //---------------------------------------------------------------------------
3883 double wxQTMediaBackend::GetVolume()
3885 short sVolume
= m_lib
.GetMovieVolume(m_movie
);
3886 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3888 if (sVolume
& (128 << 8)) //negative - no sound
3891 return sVolume
/ 256.0;
3894 //---------------------------------------------------------------------------
3895 // wxQTMediaBackend::SetVolume
3897 // Sets the volume through SetMovieVolume - which takes a 16 bit short -
3899 // +--------+--------+
3901 // +--------+--------+
3903 // (1) first 8 bits are value before decimal
3904 // (2) second 8 bits are value after decimal
3906 // Volume ranges from -1.0 (gain but no sound), 0 (no sound and no gain) to
3907 // 1 (full gain and sound)
3908 //---------------------------------------------------------------------------
3909 bool wxQTMediaBackend::SetVolume(double dVolume
)
3911 m_lib
.SetMovieVolume(m_movie
, (short) (dVolume
* 256));
3912 return m_lib
.GetMoviesError() == noErr
;
3915 //---------------------------------------------------------------------------
3916 // wxQTMediaBackend::GetDuration
3918 // Calls GetMovieDuration
3919 //---------------------------------------------------------------------------
3920 wxLongLong
wxQTMediaBackend::GetDuration()
3922 return m_lib
.GetMovieDuration(m_movie
);
3925 //---------------------------------------------------------------------------
3926 // wxQTMediaBackend::GetState
3928 // Determines the current state:
3929 // if we are at the beginning, then we are stopped
3930 //---------------------------------------------------------------------------
3931 wxMediaState
wxQTMediaBackend::GetState()
3934 return wxMEDIASTATE_PLAYING
;
3935 else if ( !m_movie
|| wxQTMediaBackend::GetPosition() == 0 )
3936 return wxMEDIASTATE_STOPPED
;
3938 return wxMEDIASTATE_PAUSED
;
3941 //---------------------------------------------------------------------------
3942 // wxQTMediaBackend::Cleanup
3944 // Diposes of the movie timer, Disassociates the Movie Controller with
3945 // movie and hides it if it exists, and stops and disposes
3947 //---------------------------------------------------------------------------
3948 void wxQTMediaBackend::Cleanup()
3958 m_lib
.StopMovie(m_movie
);
3963 thePoint
.h
= thePoint
.v
= 0;
3964 m_lib
.MCSetVisible(m_pMC
, false);
3965 m_lib
.MCSetMovie(m_pMC
, NULL
, NULL
, thePoint
);
3968 m_lib
.DisposeMovie(m_movie
);
3972 //---------------------------------------------------------------------------
3973 // wxQTMediaBackend::ShowPlayerControls
3975 // Creates a movie controller for the Movie if the user wants it
3976 //---------------------------------------------------------------------------
3977 bool wxQTMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags
)
3981 // restore old wndproc
3982 wxSetWindowProc((HWND
)m_ctrl
->GetHWND(), wxWndProc
);
3983 m_lib
.DisposeMovieController(m_pMC
);
3986 // movie controller height
3990 if (flags
&& m_movie
)
3993 wxRect wxrect
= m_ctrl
->GetClientRect();
3995 // make room for controller
3996 if (wxrect
.width
< 320)
3999 rect
.top
= (short)wxrect
.y
;
4000 rect
.left
= (short)wxrect
.x
;
4001 rect
.right
= (short)(rect
.left
+ wxrect
.width
);
4002 rect
.bottom
= (short)(rect
.top
+ wxrect
.height
);
4006 m_pMC
= m_lib
.NewMovieController(m_movie
, &rect
, mcTopLeftMovie
|
4007 // mcScaleMovieToFit |
4010 m_lib
.MCDoAction(m_pMC
, 32, (void*)true); // mcActionSetKeysEnabled
4011 m_lib
.MCSetActionFilterWithRefCon(m_pMC
,
4012 (WXFARPROC
)wxQTMediaBackend::MCFilterProc
, (void*)this);
4013 m_bestSize
.y
+= 16; // movie controller height
4015 // By default the movie controller uses its own colour palette
4016 // for the movie which can be bad on some files, so turn it off.
4017 // Also turn off its frame / border for the movie
4018 // Also take care of a couple of the interface flags here
4020 m_lib
.MCDoAction(m_pMC
, 39/*mcActionGetFlags*/, (void*)&mcFlags
);
4023 // (1<< 0) /*mcFlagSuppressMovieFrame*/ |
4024 (1<< 3) /*mcFlagsUseWindowPalette*/
4025 | ((flags
& wxMEDIACTRLPLAYERCONTROLS_STEP
)
4026 ? 0 : (1<< 1) /*mcFlagSuppressStepButtons*/)
4027 | ((flags
& wxMEDIACTRLPLAYERCONTROLS_VOLUME
)
4028 ? 0 : (1<< 2) /*mcFlagSuppressSpeakerButton*/)
4029 // | (1<< 4) /*mcFlagDontInvalidate*/ // if we take care of repainting ourselves
4032 m_lib
.MCDoAction(m_pMC
, 38/*mcActionSetFlags*/, (void*)mcFlags
);
4034 // intercept the wndproc of our control window
4035 wxSetWindowProc((HWND
)m_ctrl
->GetHWND(), wxQTMediaBackend::QTWndProc
);
4037 // set the user data of our window
4038 wxSetWindowUserData((HWND
)m_ctrl
->GetHWND(), this);
4042 NotifyMovieSizeChanged();
4044 return m_lib
.GetMoviesError() == noErr
;
4047 //---------------------------------------------------------------------------
4048 // wxQTMediaBackend::MCFilterProc (static)
4050 // Callback for when the movie controller recieves a message
4051 //---------------------------------------------------------------------------
4052 Boolean
wxQTMediaBackend::MCFilterProc(MovieController
WXUNUSED(theController
),
4054 void * WXUNUSED(params
),
4057 // NB: potential optimisation
4061 wxQTMediaBackend
* pThis
= (wxQTMediaBackend
*)refCon
;
4066 // don't process idle events
4070 // play button triggered - MC will set movie to opposite state
4071 // of current - playing ? paused : playing
4073 pThis
->m_bPlaying
= !(pThis
->m_bPlaying
);
4075 // NB: Sometimes it doesn't redraw properly -
4076 // if you click on the button but don't move the mouse
4077 // the button will not change its state until you move
4078 // mcActionDraw and Refresh/Update combo do nothing
4079 // to help this unfortunately
4089 //---------------------------------------------------------------------------
4090 // wxQTMediaBackend::GetVideoSize
4092 // Returns the actual size of the QT movie
4093 //---------------------------------------------------------------------------
4094 wxSize
wxQTMediaBackend::GetVideoSize() const
4099 //---------------------------------------------------------------------------
4100 // wxQTMediaBackend::Move
4102 // Sets the bounds of either the Movie or Movie Controller
4103 //---------------------------------------------------------------------------
4104 void wxQTMediaBackend::Move(int WXUNUSED(x
), int WXUNUSED(y
), int w
, int h
)
4108 // make room for controller
4114 Rect theRect
= {0, 0, (short)h
, (short)w
};
4115 m_lib
.MCSetControllerBoundsRect(m_pMC
, &theRect
);
4119 Rect theRect
= {0, 0, (short)h
, (short)w
};
4120 m_lib
.SetMovieBox(m_movie
, &theRect
);
4123 wxASSERT(m_lib
.GetMoviesError() == noErr
);
4127 //---------------------------------------------------------------------------
4128 // wxQTMediaBackend::OnEraseBackground
4130 // Suggestion from Greg Hazel to repaint the movie when idle
4133 // TODO: We may be repainting too much here - under what exact circumstances
4134 // do we need this? I think Move also repaints correctly for the Movie
4135 // Controller, so in that instance we don't need this either
4136 //---------------------------------------------------------------------------
4137 void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent
& evt
)
4139 wxQuickTimeLibrary
& m_pLib
= m_qtb
->m_lib
;
4143 // repaint movie controller
4144 m_pLib
.MCDoAction(m_qtb
->m_pMC
, 2 /*mcActionDraw*/,
4145 m_pLib
.GetNativeWindowPort(m_hwnd
));
4147 else if ( m_qtb
->m_movie
)
4149 // no movie controller
4150 CGrafPtr port
= (CGrafPtr
)m_pLib
.GetNativeWindowPort(m_hwnd
);
4152 m_pLib
.BeginUpdate(port
);
4153 m_pLib
.UpdateMovie(m_qtb
->m_movie
);
4154 wxASSERT(m_pLib
.GetMoviesError() == noErr
);
4155 m_pLib
.EndUpdate(port
);
4160 // let the system repaint the window
4165 //---------------------------------------------------------------------------
4167 //---------------------------------------------------------------------------
4169 //in source file that contains stuff you don't directly use
4170 #include "wx/html/forcelnk.h"
4171 FORCE_LINK_ME(basewxmediabackends
)
4173 #endif //wxUSE_MEDIACTRL