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"
33 //---------------------------------------------------------------------------
35 //---------------------------------------------------------------------------
36 #include "wx/mediactrl.h"
38 //---------------------------------------------------------------------------
40 //---------------------------------------------------------------------------
43 //---------------------------------------------------------------------------
45 //---------------------------------------------------------------------------
46 #include "wx/log.h" // wxLogDebug
47 #include "wx/math.h" // log10 & pow
48 #include "wx/msw/private.h" // user info and wndproc setting/getting
49 #include "wx/dcclient.h"
51 #include "wx/dynlib.h"
53 //---------------------------------------------------------------------------
54 // Externals (somewhere in src/msw/app.cpp and src/msw/window.cpp)
55 //---------------------------------------------------------------------------
56 extern "C" WXDLLIMPEXP_BASE HINSTANCE
wxGetInstance(void);
58 extern WXDLLIMPEXP_CORE wxChar
*wxCanvasClassName
;
60 extern WXDLLIMPEXP_CORE
const wxChar
*wxCanvasClassName
;
63 LRESULT WXDLLIMPEXP_CORE APIENTRY _EXPORT
wxWndProc(HWND hWnd
, UINT message
,
64 WPARAM wParam
, LPARAM lParam
);
66 //===========================================================================
67 // BACKEND DECLARATIONS
68 //===========================================================================
70 //---------------------------------------------------------------------------
72 //---------------------------------------------------------------------------
74 //---------------------------------------------------------------------------
75 // wxActiveXContainer - includes all the COM-specific stuff we need
76 //---------------------------------------------------------------------------
77 #include "wx/msw/ole/activex.h"
79 //---------------------------------------------------------------------------
80 // IIDS - used by CoCreateInstance and IUnknown::QueryInterface
82 // [idl name] [idl decription]
83 // amcompat.idl Microsoft Active Movie Control (Ver 2.0)
84 // nscompat.idl Microsoft NetShow Player (Ver 1.0)
85 // msdxm.idl Windows Media Player (Ver 1.0)
88 // First, when I say I "from XXX.idl", I mean I go into the COM Browser
89 // ($Microsoft Visual Studio$/Common/Tools/OLEVIEW.EXE), open
90 // "type libraries", open a specific type library (for quartz for example its
91 // "ActiveMovie control type library (V1.0)"), save it as an .idl, compile the
92 // idl using the midl compiler that comes with visual studio
93 // ($Microsoft Visual Studio$/VC98/bin/midl.exe on VC6) with the /h argument
94 // to make it generate stubs (a .h & .c file), then clean up the generated
95 // interfaces I want with the STDMETHOD wrappers and then put them into
98 // According to the MSDN docs, IMediaPlayer requires Windows 98 SE
99 // or greater. NetShow is available on Windows 3.1 and I'm guessing
100 // IActiveMovie is too. IMediaPlayer is essentially the Windows Media
103 // IWMP is from PlayerOCX.idl on PocketPC 2000, which uses CLSID_MediaPlayer
104 // as well as the main windows line.
106 // Some of these are not used but are kept here for future reference anyway
107 //---------------------------------------------------------------------------
108 const IID IID_IActiveMovie
= {0x05589FA2,0xC356,0x11CE,{0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A}};
109 const IID IID_IActiveMovie2
= {0xB6CD6554,0xE9CB,0x11D0,{0x82,0x1F,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
110 const IID IID_IActiveMovie3
= {0x265EC140,0xAE62,0x11D1,{0x85,0x00,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
112 const IID IID_INSOPlay
= {0x2179C5D1,0xEBFF,0x11CF,{0xB6,0xFD,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
113 const IID IID_INSPlay
= {0xE7C4BE80,0x7960,0x11D0,{0xB7,0x27,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
114 const IID IID_INSPlay1
= {0x265EC141,0xAE62,0x11D1,{0x85,0x00,0x00,0xA0,0xC9,0x1F,0x9C,0xA0}};
116 const IID IID_IMediaPlayer
= {0x22D6F311,0xB0F6,0x11D0,{0x94,0xAB,0x00,0x80,0xC7,0x4C,0x7E,0x95}};
117 const IID IID_IMediaPlayer2
= {0x20D4F5E0,0x5475,0x11D2,{0x97,0x74,0x00,0x00,0xF8,0x08,0x55,0xE6}};
119 const IID IID_IWMP
= {0x136B66EC,0xF30D,0x46A8,{0x88,0xDD,0xF2,0xD0,0x55,0x16,0x3E,0x49}};
121 const CLSID CLSID_ActiveMovie
= {0x05589FA1,0xC356,0x11CE,{0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A}};
122 const CLSID CLSID_MediaPlayer
= {0x22D6F312,0xB0F6,0x11D0,{0x94,0xAB,0x00,0x80,0xC7,0x4C,0x7E,0x95}};
123 const CLSID CLSID_NSPlay
= {0x2179C5D3,0xEBFF,0x11CF,{0xB6,0xFD,0x00,0xAA,0x00,0xB4,0xE2,0x20}};
125 const IID IID_IAMOpenProgress
= {0x8E1C39A1, 0xDE53, 0x11CF,{0xAA, 0x63, 0x00, 0x80, 0xC7, 0x44, 0x52, 0x8D}};
128 const CLSID CLSID_FilgraphManager
= {0xE436EBB3,0x524F,0x11CE,{0x9F,0x53,0x00,0x20,0xAF,0x0B,0xA7,0x70}};
129 const IID IID_IMediaEvent
= {0x56A868B6,0x0AD4,0x11CE,{0xB0,0x3A,0x00,0x20,0xAF,0x0B,0xA7,0x70}};
132 const CLSID CLSID_VideoMixingRenderer9
={0x51B4ABF3, 0x748F, 0x4E3B,{0xA2, 0x76, 0xC8, 0x28, 0x33, 0x0E, 0x92, 0x6A}};
133 const IID IID_IVMRWindowlessControl9
= {0x8F537D09, 0xF85E, 0x4414,{0xB2, 0x3B, 0x50, 0x2E, 0x54, 0xC7, 0x99, 0x27}};
134 const IID IID_IFilterGraph
= {0x56A8689F, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
135 const IID IID_IGraphBuilder
= {0x56A868A9, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
136 const IID IID_IVMRFilterConfig9
= {0x5A804648, 0x4F66, 0x4867,{0x9C, 0x43, 0x4F, 0x5C, 0x82, 0x2C, 0xF1, 0xB8}};
137 const IID IID_IBaseFilter
= {0x56A86895, 0x0AD4, 0x11CE,{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
139 //---------------------------------------------------------------------------
140 // QUARTZ COM INTERFACES (dumped from quartz.idl from MSVC COM Browser)
141 //---------------------------------------------------------------------------
143 struct IAMOpenProgress
: public IUnknown
145 STDMETHOD(QueryProgress
)(LONGLONG
*pllTotal
, LONGLONG
*pllCurrent
) PURE
;
146 STDMETHOD(AbortOperation
)(void) PURE
;
149 struct IMediaEvent
: public IDispatch
151 STDMETHOD(GetEventHandle
)(LONG_PTR
*) PURE
;
152 STDMETHOD(GetEvent
)(long *, LONG_PTR
*, LONG_PTR
*, long) PURE
;
153 STDMETHOD(WaitForCompletion
)(long, long *) PURE
;
154 STDMETHOD(CancelDefaultHandling
)(long) PURE
;
155 STDMETHOD(RestoreDefaultHandling
)(long) PURE
;
156 STDMETHOD(FreeEventParams
)(long, LONG_PTR
, LONG_PTR
) PURE
;
159 //---------------------------------------------------------------------------
160 // ACTIVEMOVIE COM INTERFACES (dumped from amcompat.idl from MSVC COM Browser)
161 //---------------------------------------------------------------------------
163 enum ReadyStateConstants
165 amvUninitialized
= 0,
179 enum DisplayModeConstants
185 enum WindowSizeConstants
188 amvDoubleOriginalSize
= 1,
189 amvOneSixteenthScreen
= 2,
190 amvOneFourthScreen
= 3,
194 enum AppearanceConstants
200 enum BorderStyleConstants
206 struct IActiveMovie
: public IDispatch
208 STDMETHOD(AboutBox
)( void) PURE
;
209 STDMETHOD(Run
)( void) PURE
;
210 STDMETHOD(Pause
)( void) PURE
;
211 STDMETHOD(Stop
)( void) PURE
;
212 STDMETHOD(get_ImageSourceWidth
)(long __RPC_FAR
*pWidth
) PURE
;
213 STDMETHOD(get_ImageSourceHeight
)(long __RPC_FAR
*pHeight
) PURE
;
214 STDMETHOD(get_Author
)(BSTR __RPC_FAR
*pbstrAuthor
) PURE
;
215 STDMETHOD(get_Title
)(BSTR __RPC_FAR
*pbstrTitle
) PURE
;
216 STDMETHOD(get_Copyright
)(BSTR __RPC_FAR
*pbstrCopyright
) PURE
;
217 STDMETHOD(get_Description
)(BSTR __RPC_FAR
*pbstrDescription
) PURE
;
218 STDMETHOD(get_Rating
)(BSTR __RPC_FAR
*pbstrRating
) PURE
;
219 STDMETHOD(get_FileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
220 STDMETHOD(put_FileName
)(BSTR pbstrFileName
) PURE
;
221 STDMETHOD(get_Duration
)(double __RPC_FAR
*pValue
) PURE
;
222 STDMETHOD(get_CurrentPosition
)(double __RPC_FAR
*pValue
) PURE
;
223 STDMETHOD(put_CurrentPosition
)(double pValue
) PURE
;
224 STDMETHOD(get_PlayCount
)(long __RPC_FAR
*pPlayCount
) PURE
;
225 STDMETHOD(put_PlayCount
)(long pPlayCount
) PURE
;
226 STDMETHOD(get_SelectionStart
)(double __RPC_FAR
*pValue
) PURE
;
227 STDMETHOD(put_SelectionStart
)(double pValue
) PURE
;
228 STDMETHOD(get_SelectionEnd
)(double __RPC_FAR
*pValue
) PURE
;
229 STDMETHOD(put_SelectionEnd
)(double pValue
) PURE
;
230 STDMETHOD(get_CurrentState
)(StateConstants __RPC_FAR
*pState
) PURE
;
231 STDMETHOD(get_Rate
)(double __RPC_FAR
*pValue
) PURE
;
232 STDMETHOD(put_Rate
)(double pValue
) PURE
;
233 STDMETHOD(get_Volume
)(long __RPC_FAR
*pValue
) PURE
;
234 STDMETHOD(put_Volume
)(long pValue
) PURE
;
235 STDMETHOD(get_Balance
)(long __RPC_FAR
*pValue
) PURE
;
236 STDMETHOD(put_Balance
)(long pValue
) PURE
;
237 STDMETHOD(get_EnableContextMenu
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
238 STDMETHOD(put_EnableContextMenu
)(VARIANT_BOOL pEnable
) PURE
;
239 STDMETHOD(get_ShowDisplay
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
240 STDMETHOD(put_ShowDisplay
)(VARIANT_BOOL Show
) PURE
;
241 STDMETHOD(get_ShowControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
242 STDMETHOD(put_ShowControls
)(VARIANT_BOOL Show
) PURE
;
243 STDMETHOD(get_ShowPositionControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
244 STDMETHOD(put_ShowPositionControls
)(VARIANT_BOOL Show
) PURE
;
245 STDMETHOD(get_ShowSelectionControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
246 STDMETHOD(put_ShowSelectionControls
)(VARIANT_BOOL Show
) PURE
;
247 STDMETHOD(get_ShowTracker
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
248 STDMETHOD(put_ShowTracker
)(VARIANT_BOOL Show
) PURE
;
249 STDMETHOD(get_EnablePositionControls
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
250 STDMETHOD(put_EnablePositionControls
)(VARIANT_BOOL Enable
) PURE
;
251 STDMETHOD(get_EnableSelectionControls
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
252 STDMETHOD(put_EnableSelectionControls
)(VARIANT_BOOL Enable
) PURE
;
253 STDMETHOD(get_EnableTracker
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
254 STDMETHOD(put_EnableTracker
)(VARIANT_BOOL Enable
) PURE
;
255 STDMETHOD(get_AllowHideDisplay
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
256 STDMETHOD(put_AllowHideDisplay
)(VARIANT_BOOL Show
) PURE
;
257 STDMETHOD(get_AllowHideControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
258 STDMETHOD(put_AllowHideControls
)(VARIANT_BOOL Show
) PURE
;
259 STDMETHOD(get_DisplayMode
)(DisplayModeConstants __RPC_FAR
*pValue
) PURE
;
260 STDMETHOD(put_DisplayMode
)(DisplayModeConstants pValue
) PURE
;
261 STDMETHOD(get_AllowChangeDisplayMode
)(VARIANT_BOOL __RPC_FAR
*fAllow
) PURE
;
262 STDMETHOD(put_AllowChangeDisplayMode
)(VARIANT_BOOL fAllow
) PURE
;
263 STDMETHOD(get_FilterGraph
)(IUnknown __RPC_FAR
*__RPC_FAR
*ppFilterGraph
) PURE
;
264 STDMETHOD(put_FilterGraph
)(IUnknown __RPC_FAR
*ppFilterGraph
) PURE
;
265 STDMETHOD(get_FilterGraphDispatch
)(IDispatch __RPC_FAR
*__RPC_FAR
*pDispatch
) PURE
;
266 STDMETHOD(get_DisplayForeColor
)(unsigned long __RPC_FAR
*ForeColor
) PURE
;
267 STDMETHOD(put_DisplayForeColor
)(unsigned long ForeColor
) PURE
;
268 STDMETHOD(get_DisplayBackColor
)(unsigned long __RPC_FAR
*BackColor
) PURE
;
269 STDMETHOD(put_DisplayBackColor
)(unsigned long BackColor
) PURE
;
270 STDMETHOD(get_MovieWindowSize
)(WindowSizeConstants __RPC_FAR
*WindowSize
) PURE
;
271 STDMETHOD(put_MovieWindowSize
)(WindowSizeConstants WindowSize
) PURE
;
272 STDMETHOD(get_FullScreenMode
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
273 STDMETHOD(put_FullScreenMode
)(VARIANT_BOOL pEnable
) PURE
;
274 STDMETHOD(get_AutoStart
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
275 STDMETHOD(put_AutoStart
)(VARIANT_BOOL pEnable
) PURE
;
276 STDMETHOD(get_AutoRewind
)(VARIANT_BOOL __RPC_FAR
*pEnable
) PURE
;
277 STDMETHOD(put_AutoRewind
)(VARIANT_BOOL pEnable
) PURE
;
278 STDMETHOD(get_hWnd
)(long __RPC_FAR
*hWnd
) PURE
;
279 STDMETHOD(get_Appearance
)(AppearanceConstants __RPC_FAR
*pAppearance
) PURE
;
280 STDMETHOD(put_Appearance
)(AppearanceConstants pAppearance
) PURE
;
281 STDMETHOD(get_BorderStyle
)(BorderStyleConstants __RPC_FAR
*pBorderStyle
) PURE
;
282 STDMETHOD(put_BorderStyle
)(BorderStyleConstants pBorderStyle
) PURE
;
283 STDMETHOD(get_Enabled
)(VARIANT_BOOL __RPC_FAR
*pEnabled
) PURE
;
284 STDMETHOD(put_Enabled
)(VARIANT_BOOL pEnabled
) PURE
;
285 STDMETHOD(get_Info
)(long __RPC_FAR
*ppInfo
) PURE
;
289 struct IActiveMovie2
: public IActiveMovie
291 STDMETHOD(IsSoundCardEnabled
)(VARIANT_BOOL __RPC_FAR
*pbSoundCard
) PURE
;
292 STDMETHOD(get_ReadyState
)(ReadyStateConstants __RPC_FAR
*pValue
) PURE
;
295 struct IActiveMovie3
: public IActiveMovie2
297 STDMETHOD(get_MediaPlayer
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppDispatch
) PURE
;
301 //---------------------------------------------------------------------------
302 // MEDIAPLAYER COM INTERFACES (dumped from msdxm.idl from MSVC COM Browser)
303 //---------------------------------------------------------------------------
305 enum MPPlayStateConstants
316 enum MPDisplaySizeConstants
323 mpOneSixteenthScreen
= 5,
324 mpOneFourthScreen
= 6,
328 enum MPReadyStateConstants
330 mpReadyStateUninitialized
= 0,
331 mpReadyStateLoading
= 1,
332 mpReadyStateInteractive
= 3,
333 mpReadyStateComplete
= 4
336 typedef unsigned long VB_OLE_COLOR
;
338 enum MPDisplayModeConstants
358 mpShowDescription
= 5,
363 mpClipCopyright
= 10,
365 mpClipDescription
= 12,
368 mpBannerMoreInfo
= 15,
372 enum DVDMenuIDConstants
376 dvdMenu_Subpicture
= 4,
382 enum MPShowDialogConstants
384 mpShowDialogHelp
= 0,
385 mpShowDialogStatistics
= 1,
386 mpShowDialogOptions
= 2,
387 mpShowDialogContextMenu
= 3
391 struct IMediaPlayer
: public IDispatch
393 STDMETHOD(get_CurrentPosition
)(double __RPC_FAR
*pCurrentPosition
) PURE
;
394 STDMETHOD(put_CurrentPosition
)(double pCurrentPosition
) PURE
;
395 STDMETHOD(get_Duration
)(double __RPC_FAR
*pDuration
) PURE
;
396 STDMETHOD(get_ImageSourceWidth
)(long __RPC_FAR
*pWidth
) PURE
;
397 STDMETHOD(get_ImageSourceHeight
)(long __RPC_FAR
*pHeight
) PURE
;
398 STDMETHOD(get_MarkerCount
)(long __RPC_FAR
*pMarkerCount
) PURE
;
399 STDMETHOD(get_CanScan
)(VARIANT_BOOL __RPC_FAR
*pCanScan
) PURE
;
400 STDMETHOD(get_CanSeek
)(VARIANT_BOOL __RPC_FAR
*pCanSeek
) PURE
;
401 STDMETHOD(get_CanSeekToMarkers
)(VARIANT_BOOL __RPC_FAR
*pCanSeekToMarkers
) PURE
;
402 STDMETHOD(get_CurrentMarker
)(long __RPC_FAR
*pCurrentMarker
) PURE
;
403 STDMETHOD(put_CurrentMarker
)(long pCurrentMarker
) PURE
;
404 STDMETHOD(get_FileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
405 STDMETHOD(put_FileName
)(BSTR pbstrFileName
) PURE
;
406 STDMETHOD(get_SourceLink
)(BSTR __RPC_FAR
*pbstrSourceLink
) PURE
;
407 STDMETHOD(get_CreationDate
)(DATE __RPC_FAR
*pCreationDate
) PURE
;
408 STDMETHOD(get_ErrorCorrection
)(BSTR __RPC_FAR
*pbstrErrorCorrection
) PURE
;
409 STDMETHOD(get_Bandwidth
)(long __RPC_FAR
*pBandwidth
) PURE
;
410 STDMETHOD(get_SourceProtocol
)(long __RPC_FAR
*pSourceProtocol
) PURE
;
411 STDMETHOD(get_ReceivedPackets
)(long __RPC_FAR
*pReceivedPackets
) PURE
;
412 STDMETHOD(get_RecoveredPackets
)(long __RPC_FAR
*pRecoveredPackets
) PURE
;
413 STDMETHOD(get_LostPackets
)(long __RPC_FAR
*pLostPackets
) PURE
;
414 STDMETHOD(get_ReceptionQuality
)(long __RPC_FAR
*pReceptionQuality
) PURE
;
415 STDMETHOD(get_BufferingCount
)(long __RPC_FAR
*pBufferingCount
) PURE
;
416 STDMETHOD(get_IsBroadcast
)(VARIANT_BOOL __RPC_FAR
*pIsBroadcast
) PURE
;
417 STDMETHOD(get_BufferingProgress
)(long __RPC_FAR
*pBufferingProgress
) PURE
;
418 STDMETHOD(get_ChannelName
)(BSTR __RPC_FAR
*pbstrChannelName
) PURE
;
419 STDMETHOD(get_ChannelDescription
)(BSTR __RPC_FAR
*pbstrChannelDescription
) PURE
;
420 STDMETHOD(get_ChannelURL
)(BSTR __RPC_FAR
*pbstrChannelURL
) PURE
;
421 STDMETHOD(get_ContactAddress
)(BSTR __RPC_FAR
*pbstrContactAddress
) PURE
;
422 STDMETHOD(get_ContactPhone
)(BSTR __RPC_FAR
*pbstrContactPhone
) PURE
;
423 STDMETHOD(get_ContactEmail
)(BSTR __RPC_FAR
*pbstrContactEmail
) PURE
;
424 STDMETHOD(get_BufferingTime
)(double __RPC_FAR
*pBufferingTime
) PURE
;
425 STDMETHOD(put_BufferingTime
)(double pBufferingTime
) PURE
;
426 STDMETHOD(get_AutoStart
)(VARIANT_BOOL __RPC_FAR
*pAutoStart
) PURE
;
427 STDMETHOD(put_AutoStart
)(VARIANT_BOOL pAutoStart
) PURE
;
428 STDMETHOD(get_AutoRewind
)(VARIANT_BOOL __RPC_FAR
*pAutoRewind
) PURE
;
429 STDMETHOD(put_AutoRewind
)(VARIANT_BOOL pAutoRewind
) PURE
;
430 STDMETHOD(get_Rate
)(double __RPC_FAR
*pRate
) PURE
;
431 STDMETHOD(put_Rate
)(double pRate
) PURE
;
432 STDMETHOD(get_SendKeyboardEvents
)(VARIANT_BOOL __RPC_FAR
*pSendKeyboardEvents
) PURE
;
433 STDMETHOD(put_SendKeyboardEvents
)(VARIANT_BOOL pSendKeyboardEvents
) PURE
;
434 STDMETHOD(get_SendMouseClickEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseClickEvents
) PURE
;
435 STDMETHOD(put_SendMouseClickEvents
)(VARIANT_BOOL pSendMouseClickEvents
) PURE
;
436 STDMETHOD(get_SendMouseMoveEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseMoveEvents
) PURE
;
437 STDMETHOD(put_SendMouseMoveEvents
)(VARIANT_BOOL pSendMouseMoveEvents
) PURE
;
438 STDMETHOD(get_PlayCount
)(long __RPC_FAR
*pPlayCount
) PURE
;
439 STDMETHOD(put_PlayCount
)(long pPlayCount
) PURE
;
440 STDMETHOD(get_ClickToPlay
)(VARIANT_BOOL __RPC_FAR
*pClickToPlay
) PURE
;
441 STDMETHOD(put_ClickToPlay
)(VARIANT_BOOL pClickToPlay
) PURE
;
442 STDMETHOD(get_AllowScan
)(VARIANT_BOOL __RPC_FAR
*pAllowScan
) PURE
;
443 STDMETHOD(put_AllowScan
)(VARIANT_BOOL pAllowScan
) PURE
;
444 STDMETHOD(get_EnableContextMenu
)(VARIANT_BOOL __RPC_FAR
*pEnableContextMenu
) PURE
;
445 STDMETHOD(put_EnableContextMenu
)(VARIANT_BOOL pEnableContextMenu
) PURE
;
446 STDMETHOD(get_CursorType
)(long __RPC_FAR
*pCursorType
) PURE
;
447 STDMETHOD(put_CursorType
)(long pCursorType
) PURE
;
448 STDMETHOD(get_CodecCount
)(long __RPC_FAR
*pCodecCount
) PURE
;
449 STDMETHOD(get_AllowChangeDisplaySize
)(VARIANT_BOOL __RPC_FAR
*pAllowChangeDisplaySize
) PURE
;
450 STDMETHOD(put_AllowChangeDisplaySize
)( VARIANT_BOOL pAllowChangeDisplaySize
) PURE
;
451 STDMETHOD(get_IsDurationValid
)(VARIANT_BOOL __RPC_FAR
*pIsDurationValid
) PURE
;
452 STDMETHOD(get_OpenState
)(long __RPC_FAR
*pOpenState
) PURE
;
453 STDMETHOD(get_SendOpenStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendOpenStateChangeEvents
) PURE
;
454 STDMETHOD(put_SendOpenStateChangeEvents
)(VARIANT_BOOL pSendOpenStateChangeEvents
) PURE
;
455 STDMETHOD(get_SendWarningEvents
)( VARIANT_BOOL __RPC_FAR
*pSendWarningEvents
) PURE
;
456 STDMETHOD(put_SendWarningEvents
)(VARIANT_BOOL pSendWarningEvents
) PURE
;
457 STDMETHOD(get_SendErrorEvents
)(VARIANT_BOOL __RPC_FAR
*pSendErrorEvents
) PURE
;
458 STDMETHOD(put_SendErrorEvents
)(VARIANT_BOOL pSendErrorEvents
) PURE
;
459 STDMETHOD(get_PlayState
)(MPPlayStateConstants __RPC_FAR
*pPlayState
) PURE
;
460 STDMETHOD(get_SendPlayStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendPlayStateChangeEvents
) PURE
;
461 STDMETHOD(put_SendPlayStateChangeEvents
)(VARIANT_BOOL pSendPlayStateChangeEvents
) PURE
;
462 STDMETHOD(get_DisplaySize
)(MPDisplaySizeConstants __RPC_FAR
*pDisplaySize
) PURE
;
463 STDMETHOD(put_DisplaySize
)(MPDisplaySizeConstants pDisplaySize
) PURE
;
464 STDMETHOD(get_InvokeURLs
)(VARIANT_BOOL __RPC_FAR
*pInvokeURLs
) PURE
;
465 STDMETHOD(put_InvokeURLs
)(VARIANT_BOOL pInvokeURLs
) PURE
;
466 STDMETHOD(get_BaseURL
)(BSTR __RPC_FAR
*pbstrBaseURL
) PURE
;
467 STDMETHOD(put_BaseURL
)(BSTR pbstrBaseURL
) PURE
;
468 STDMETHOD(get_DefaultFrame
)(BSTR __RPC_FAR
*pbstrDefaultFrame
) PURE
;
469 STDMETHOD(put_DefaultFrame
)(BSTR pbstrDefaultFrame
) PURE
;
470 STDMETHOD(get_HasError
)(VARIANT_BOOL __RPC_FAR
*pHasError
) PURE
;
471 STDMETHOD(get_ErrorDescription
)(BSTR __RPC_FAR
*pbstrErrorDescription
) PURE
;
472 STDMETHOD(get_ErrorCode
)(long __RPC_FAR
*pErrorCode
) PURE
;
473 STDMETHOD(get_AnimationAtStart
)(VARIANT_BOOL __RPC_FAR
*pAnimationAtStart
) PURE
;
474 STDMETHOD(put_AnimationAtStart
)(VARIANT_BOOL pAnimationAtStart
) PURE
;
475 STDMETHOD(get_TransparentAtStart
)( VARIANT_BOOL __RPC_FAR
*pTransparentAtStart
) PURE
;
476 STDMETHOD(put_TransparentAtStart
)(VARIANT_BOOL pTransparentAtStart
) PURE
;
477 STDMETHOD(get_Volume
)(long __RPC_FAR
*pVolume
) PURE
;
478 STDMETHOD(put_Volume
)(long pVolume
) PURE
;
479 STDMETHOD(get_Balance
)(long __RPC_FAR
*pBalance
) PURE
;
480 STDMETHOD(put_Balance
)(long pBalance
) PURE
;
481 STDMETHOD(get_ReadyState
)(MPReadyStateConstants __RPC_FAR
*pValue
) PURE
;
482 STDMETHOD(get_SelectionStart
)(double __RPC_FAR
*pValue
) PURE
;
483 STDMETHOD(put_SelectionStart
)(double pValue
) PURE
;
484 STDMETHOD(get_SelectionEnd
)(double __RPC_FAR
*pValue
) PURE
;
485 STDMETHOD(put_SelectionEnd
)(double pValue
) PURE
;
486 STDMETHOD(get_ShowDisplay
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
487 STDMETHOD(put_ShowDisplay
)(VARIANT_BOOL Show
) PURE
;
488 STDMETHOD(get_ShowControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
489 STDMETHOD(put_ShowControls
)(VARIANT_BOOL Show
) PURE
;
490 STDMETHOD(get_ShowPositionControls
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
491 STDMETHOD(put_ShowPositionControls
)(VARIANT_BOOL Show
) PURE
;
492 STDMETHOD(get_ShowTracker
)(VARIANT_BOOL __RPC_FAR
*Show
) PURE
;
493 STDMETHOD(put_ShowTracker
)(VARIANT_BOOL Show
) PURE
;
494 STDMETHOD(get_EnablePositionControls
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
495 STDMETHOD(put_EnablePositionControls
)(VARIANT_BOOL Enable
) PURE
;
496 STDMETHOD(get_EnableTracker
)(VARIANT_BOOL __RPC_FAR
*Enable
) PURE
;
497 STDMETHOD(put_EnableTracker
)(VARIANT_BOOL Enable
) PURE
;
498 STDMETHOD(get_Enabled
)(VARIANT_BOOL __RPC_FAR
*pEnabled
) PURE
;
499 STDMETHOD(put_Enabled
)(VARIANT_BOOL pEnabled
) PURE
;
500 STDMETHOD(get_DisplayForeColor
)(VB_OLE_COLOR __RPC_FAR
*ForeColor
) PURE
;
501 STDMETHOD(put_DisplayForeColor
)(VB_OLE_COLOR ForeColor
) PURE
;
502 STDMETHOD(get_DisplayBackColor
)(VB_OLE_COLOR __RPC_FAR
*BackColor
) PURE
;
503 STDMETHOD(put_DisplayBackColor
)(VB_OLE_COLOR BackColor
) PURE
;
504 STDMETHOD(get_DisplayMode
)(MPDisplayModeConstants __RPC_FAR
*pValue
) PURE
;
505 STDMETHOD(put_DisplayMode
)(MPDisplayModeConstants pValue
) PURE
;
506 STDMETHOD(get_VideoBorder3D
)(VARIANT_BOOL __RPC_FAR
*pVideoBorderWidth
) PURE
;
507 STDMETHOD(put_VideoBorder3D
)(VARIANT_BOOL pVideoBorderWidth
) PURE
;
508 STDMETHOD(get_VideoBorderWidth
)(long __RPC_FAR
*pVideoBorderWidth
) PURE
;
509 STDMETHOD(put_VideoBorderWidth
)(long pVideoBorderWidth
) PURE
;
510 STDMETHOD(get_VideoBorderColor
)(VB_OLE_COLOR __RPC_FAR
*pVideoBorderWidth
) PURE
;
511 STDMETHOD(put_VideoBorderColor
)(VB_OLE_COLOR pVideoBorderWidth
) PURE
;
512 STDMETHOD(get_ShowGotoBar
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
513 STDMETHOD(put_ShowGotoBar
)(VARIANT_BOOL pbool
) PURE
;
514 STDMETHOD(get_ShowStatusBar
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
515 STDMETHOD(put_ShowStatusBar
)(VARIANT_BOOL pbool
) PURE
;
516 STDMETHOD(get_ShowCaptioning
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
517 STDMETHOD(put_ShowCaptioning
)(VARIANT_BOOL pbool
) PURE
;
518 STDMETHOD(get_ShowAudioControls
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
519 STDMETHOD(put_ShowAudioControls
)(VARIANT_BOOL pbool
) PURE
;
520 STDMETHOD(get_CaptioningID
)( BSTR __RPC_FAR
*pstrText
) PURE
;
521 STDMETHOD(put_CaptioningID
)(BSTR pstrText
) PURE
;
522 STDMETHOD(get_Mute
)(VARIANT_BOOL __RPC_FAR
*vbool
) PURE
;
523 STDMETHOD(put_Mute
)(VARIANT_BOOL vbool
) PURE
;
524 STDMETHOD(get_CanPreview
)(VARIANT_BOOL __RPC_FAR
*pCanPreview
) PURE
;
525 STDMETHOD(get_PreviewMode
)(VARIANT_BOOL __RPC_FAR
*pPreviewMode
) PURE
;
526 STDMETHOD(put_PreviewMode
)(VARIANT_BOOL pPreviewMode
) PURE
;
527 STDMETHOD(get_HasMultipleItems
)(VARIANT_BOOL __RPC_FAR
*pHasMuliItems
) PURE
;
528 STDMETHOD(get_Language
)(long __RPC_FAR
*pLanguage
) PURE
;
529 STDMETHOD(put_Language
)(long pLanguage
) PURE
;
530 STDMETHOD(get_AudioStream
)(long __RPC_FAR
*pStream
) PURE
;
531 STDMETHOD(put_AudioStream
)(long pStream
) PURE
;
532 STDMETHOD(get_SAMIStyle
)(BSTR __RPC_FAR
*pbstrStyle
) PURE
;
533 STDMETHOD(put_SAMIStyle
)(BSTR pbstrStyle
) PURE
;
534 STDMETHOD(get_SAMILang
)(BSTR __RPC_FAR
*pbstrLang
) PURE
;
535 STDMETHOD(put_SAMILang
)(BSTR pbstrLang
) PURE
;
536 STDMETHOD(get_SAMIFileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
537 STDMETHOD(put_SAMIFileName
)(BSTR pbstrFileName
) PURE
;
538 STDMETHOD(get_StreamCount
)( long __RPC_FAR
*pStreamCount
) PURE
;
539 STDMETHOD(get_ClientId
)(BSTR __RPC_FAR
*pbstrClientId
) PURE
;
540 STDMETHOD(get_ConnectionSpeed
)(long __RPC_FAR
*plConnectionSpeed
) PURE
;
541 STDMETHOD(get_AutoSize
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
542 STDMETHOD(put_AutoSize
)(VARIANT_BOOL pbool
) PURE
;
543 STDMETHOD(get_EnableFullScreenControls
)(VARIANT_BOOL __RPC_FAR
*pbVal
) PURE
;
544 STDMETHOD(put_EnableFullScreenControls
)(VARIANT_BOOL pbVal
) PURE
;
545 STDMETHOD(get_ActiveMovie
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
546 STDMETHOD(get_NSPlay
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
547 STDMETHOD(get_WindowlessVideo
)(VARIANT_BOOL __RPC_FAR
*pbool
) PURE
;
548 STDMETHOD(put_WindowlessVideo
)(VARIANT_BOOL pbool
) PURE
;
549 STDMETHOD(Play
)(void) PURE
;
550 STDMETHOD(Stop
)(void) PURE
;
551 STDMETHOD(Pause
)(void) PURE
;
552 STDMETHOD(GetMarkerTime
)(long MarkerNum
,
553 double __RPC_FAR
*pMarkerTime
) PURE
;
554 STDMETHOD(GetMarkerName
)(long MarkerNum
,
555 BSTR __RPC_FAR
*pbstrMarkerName
) PURE
;
556 STDMETHOD(AboutBox
)(void) PURE
;
557 STDMETHOD(GetCodecInstalled
)(long CodecNum
,
558 VARIANT_BOOL __RPC_FAR
*pCodecInstalled
) PURE
;
559 STDMETHOD(GetCodecDescription
)(long CodecNum
,
560 BSTR __RPC_FAR
*pbstrCodecDescription
) PURE
;
561 STDMETHOD(GetCodecURL
)(long CodecNum
,
562 BSTR __RPC_FAR
*pbstrCodecURL
) PURE
;
563 STDMETHOD(GetMoreInfoURL
)(MPMoreInfoType MoreInfoType
,
564 BSTR __RPC_FAR
*pbstrMoreInfoURL
) PURE
;
565 STDMETHOD(GetMediaInfoString
)(MPMediaInfoType MediaInfoType
,
566 BSTR __RPC_FAR
*pbstrMediaInfo
) PURE
;
567 STDMETHOD(Cancel
)(void) PURE
;
568 STDMETHOD(Open
)(BSTR bstrFileName
) PURE
;
569 STDMETHOD(IsSoundCardEnabled
)(VARIANT_BOOL __RPC_FAR
*pbSoundCard
) PURE
;
570 STDMETHOD(Next
)(void) PURE
;
571 STDMETHOD(Previous
)(void) PURE
;
572 STDMETHOD(StreamSelect
)(long StreamNum
) PURE
;
573 STDMETHOD(FastForward
)(void) PURE
;
574 STDMETHOD(FastReverse
)(void) PURE
;
575 STDMETHOD(GetStreamName
)(long StreamNum
,
576 BSTR __RPC_FAR
*pbstrStreamName
) PURE
;
577 STDMETHOD(GetStreamGroup
)(long StreamNum
,
578 long __RPC_FAR
*pStreamGroup
) PURE
;
579 STDMETHOD(GetStreamSelected
)(long StreamNum
, VARIANT_BOOL __RPC_FAR
*pStreamSelected
) PURE
;
582 struct IMediaPlayer2
: public IMediaPlayer
584 STDMETHOD(get_DVD
)(struct IMediaPlayerDvd __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
585 STDMETHOD(GetMediaParameter
)(long EntryNum
, BSTR bstrParameterName
, BSTR __RPC_FAR
*pbstrParameterValue
) PURE
;
586 STDMETHOD(GetMediaParameterName(long EntryNum
, long Index
, BSTR __RPC_FAR
*pbstrParameterName
) PURE
;
587 STDMETHOD(get_EntryCount
)(long __RPC_FAR
*pNumberEntries
) PURE
;
588 STDMETHOD(GetCurrentEntry
)(long __RPC_FAR
*pEntryNumber
) PURE
;
589 STDMETHOD(SetCurrentEntry
)(long EntryNumber
) PURE
;
590 STDMETHOD(ShowDialog
)(MPShowDialogConstants mpDialogIndex
) PURE
;
593 //---------------------------------------------------------------------------
594 // NETSHOW COM INTERFACES (dumped from nscompat.idl from MSVC COM Browser)
595 //---------------------------------------------------------------------------
597 struct INSOPlay
: public IDispatch
599 STDMETHOD(get_ImageSourceWidth
)(long __RPC_FAR
*pWidth
) PURE
;
600 STDMETHOD(get_ImageSourceHeight
)(long __RPC_FAR
*pHeight
) PURE
;
601 STDMETHOD(get_Duration
)(double __RPC_FAR
*pDuration
) PURE
;
602 STDMETHOD(get_Author
)(BSTR __RPC_FAR
*pbstrAuthor
) PURE
;
603 STDMETHOD(get_Copyright
)(BSTR __RPC_FAR
*pbstrCopyright
) PURE
;
604 STDMETHOD(get_Description
)(BSTR __RPC_FAR
*pbstrDescription
) PURE
;
605 STDMETHOD(get_Rating
)(BSTR __RPC_FAR
*pbstrRating
) PURE
;
606 STDMETHOD(get_Title
)(BSTR __RPC_FAR
*pbstrTitle
) PURE
;
607 STDMETHOD(get_SourceLink
)(BSTR __RPC_FAR
*pbstrSourceLink
) PURE
;
608 STDMETHOD(get_MarkerCount
)(long __RPC_FAR
*pMarkerCount
) PURE
;
609 STDMETHOD(get_CanScan
)(VARIANT_BOOL __RPC_FAR
*pCanScan
) PURE
;
610 STDMETHOD(get_CanSeek
)(VARIANT_BOOL __RPC_FAR
*pCanSeek
) PURE
;
611 STDMETHOD(get_CanSeekToMarkers
)(VARIANT_BOOL __RPC_FAR
*pCanSeekToMarkers
) PURE
;
612 STDMETHOD(get_CreationDate
)(DATE __RPC_FAR
*pCreationDate
) PURE
;
613 STDMETHOD(get_Bandwidth
)(long __RPC_FAR
*pBandwidth
) PURE
;
614 STDMETHOD(get_ErrorCorrection
)(BSTR __RPC_FAR
*pbstrErrorCorrection
) PURE
;
615 STDMETHOD(get_AutoStart
)(VARIANT_BOOL __RPC_FAR
*pAutoStart
) PURE
;
616 STDMETHOD(put_AutoStart
)(VARIANT_BOOL pAutoStart
) PURE
;
617 STDMETHOD(get_AutoRewind
)(VARIANT_BOOL __RPC_FAR
*pAutoRewind
) PURE
;
618 STDMETHOD(put_AutoRewind
)(VARIANT_BOOL pAutoRewind
) PURE
;
619 STDMETHOD(get_AllowChangeControlType
)(VARIANT_BOOL __RPC_FAR
*pAllowChangeControlType
) PURE
;
620 STDMETHOD(put_AllowChangeControlType
)(VARIANT_BOOL pAllowChangeControlType
) PURE
;
621 STDMETHOD(get_InvokeURLs
)(VARIANT_BOOL __RPC_FAR
*pInvokeURLs
) PURE
;
622 STDMETHOD(put_InvokeURLs
)(VARIANT_BOOL pInvokeURLs
) PURE
;
623 STDMETHOD(get_EnableContextMenu
)(VARIANT_BOOL __RPC_FAR
*pEnableContextMenu
) PURE
;
624 STDMETHOD(put_EnableContextMenu
)(VARIANT_BOOL pEnableContextMenu
) PURE
;
625 STDMETHOD(get_TransparentAtStart
)(VARIANT_BOOL __RPC_FAR
*pTransparentAtStart
) PURE
;
626 STDMETHOD(put_TransparentAtStart
)(VARIANT_BOOL pTransparentAtStart
) PURE
;
627 STDMETHOD(get_TransparentOnStop
)(VARIANT_BOOL __RPC_FAR
*pTransparentOnStop
) PURE
;
628 STDMETHOD(put_TransparentOnStop
)(VARIANT_BOOL pTransparentOnStop
) PURE
;
629 STDMETHOD(get_ClickToPlay
)(VARIANT_BOOL __RPC_FAR
*pClickToPlay
) PURE
;
630 STDMETHOD(put_ClickToPlay
)(VARIANT_BOOL pClickToPlay
) PURE
;
631 STDMETHOD(get_FileName
)(BSTR __RPC_FAR
*pbstrFileName
) PURE
;
632 STDMETHOD(put_FileName
)(BSTR pbstrFileName
) PURE
;
633 STDMETHOD(get_CurrentPosition
)(double __RPC_FAR
*pCurrentPosition
) PURE
;
634 STDMETHOD(put_CurrentPosition
)(double pCurrentPosition
) PURE
;
635 STDMETHOD(get_Rate
)(double __RPC_FAR
*pRate
) PURE
;
636 STDMETHOD(put_Rate
)(double pRate
) PURE
;
637 STDMETHOD(get_CurrentMarker
)(long __RPC_FAR
*pCurrentMarker
) PURE
;
638 STDMETHOD(put_CurrentMarker
)(long pCurrentMarker
) PURE
;
639 STDMETHOD(get_PlayCount
)(long __RPC_FAR
*pPlayCount
) PURE
;
640 STDMETHOD(put_PlayCount
)(long pPlayCount
) PURE
;
641 STDMETHOD(get_CurrentState
)(long __RPC_FAR
*pCurrentState
) PURE
;
642 STDMETHOD(get_DisplaySize
)(long __RPC_FAR
*pDisplaySize
) PURE
;
643 STDMETHOD(put_DisplaySize
)(long pDisplaySize
) PURE
;
644 STDMETHOD(get_MainWindow
)(long __RPC_FAR
*pMainWindow
) PURE
;
645 STDMETHOD(get_ControlType
)(long __RPC_FAR
*pControlType
) PURE
;
646 STDMETHOD(put_ControlType
)(long pControlType
) PURE
;
647 STDMETHOD(get_AllowScan
)(VARIANT_BOOL __RPC_FAR
*pAllowScan
) PURE
;
648 STDMETHOD(put_AllowScan
)(VARIANT_BOOL pAllowScan
) PURE
;
649 STDMETHOD(get_SendKeyboardEvents
)(VARIANT_BOOL __RPC_FAR
*pSendKeyboardEvents
) PURE
;
650 STDMETHOD(put_SendKeyboardEvents
)(VARIANT_BOOL pSendKeyboardEvents
) PURE
;
651 STDMETHOD(get_SendMouseClickEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseClickEvents
) PURE
;
652 STDMETHOD(put_SendMouseClickEvents
)(VARIANT_BOOL pSendMouseClickEvents
) PURE
;
653 STDMETHOD(get_SendMouseMoveEvents
)(VARIANT_BOOL __RPC_FAR
*pSendMouseMoveEvents
) PURE
;
654 STDMETHOD(put_SendMouseMoveEvents
)(VARIANT_BOOL pSendMouseMoveEvents
) PURE
;
655 STDMETHOD(get_SendStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendStateChangeEvents
) PURE
;
656 STDMETHOD(put_SendStateChangeEvents
)(VARIANT_BOOL pSendStateChangeEvents
) PURE
;
657 STDMETHOD(get_ReceivedPackets
)(long __RPC_FAR
*pReceivedPackets
) PURE
;
658 STDMETHOD(get_RecoveredPackets
)(long __RPC_FAR
*pRecoveredPackets
) PURE
;
659 STDMETHOD(get_LostPackets
)(long __RPC_FAR
*pLostPackets
) PURE
;
660 STDMETHOD(get_ReceptionQuality
)(long __RPC_FAR
*pReceptionQuality
) PURE
;
661 STDMETHOD(get_BufferingCount
)(long __RPC_FAR
*pBufferingCount
) PURE
;
662 STDMETHOD(get_CursorType
)(long __RPC_FAR
*pCursorType
) PURE
;
663 STDMETHOD(put_CursorType
)(long pCursorType
) PURE
;
664 STDMETHOD(get_AnimationAtStart
)(VARIANT_BOOL __RPC_FAR
*pAnimationAtStart
) PURE
;
665 STDMETHOD(put_AnimationAtStart
)(VARIANT_BOOL pAnimationAtStart
) PURE
;
666 STDMETHOD(get_AnimationOnStop
)(VARIANT_BOOL __RPC_FAR
*pAnimationOnStop
) PURE
;
667 STDMETHOD(put_AnimationOnStop
)(VARIANT_BOOL pAnimationOnStop
) PURE
;
668 STDMETHOD(Play
)(void) PURE
;
669 STDMETHOD(Pause
)(void) PURE
;
670 STDMETHOD(Stop
)(void) PURE
;
671 STDMETHOD(GetMarkerTime
)(long MarkerNum
, double __RPC_FAR
*pMarkerTime
) PURE
;
672 STDMETHOD(GetMarkerName
)(long MarkerNum
, BSTR __RPC_FAR
*pbstrMarkerName
) PURE
;
675 struct INSPlay
: public INSOPlay
677 STDMETHOD(get_ChannelName
)(BSTR __RPC_FAR
*pbstrChannelName
) PURE
;
678 STDMETHOD(get_ChannelDescription
)(BSTR __RPC_FAR
*pbstrChannelDescription
) PURE
;
679 STDMETHOD(get_ChannelURL
)(BSTR __RPC_FAR
*pbstrChannelURL
) PURE
;
680 STDMETHOD(get_ContactAddress
)(BSTR __RPC_FAR
*pbstrContactAddress
) PURE
;
681 STDMETHOD(get_ContactPhone
)(BSTR __RPC_FAR
*pbstrContactPhone
) PURE
;
682 STDMETHOD(get_ContactEmail
)(BSTR __RPC_FAR
*pbstrContactEmail
) PURE
;
683 STDMETHOD(get_AllowChangeDisplaySize
)(VARIANT_BOOL __RPC_FAR
*pAllowChangeDisplaySize
) PURE
;
684 STDMETHOD(put_AllowChangeDisplaySize
)(VARIANT_BOOL pAllowChangeDisplaySize
) PURE
;
685 STDMETHOD(get_CodecCount
)(long __RPC_FAR
*pCodecCount
) PURE
;
686 STDMETHOD(get_IsBroadcast
)(VARIANT_BOOL __RPC_FAR
*pIsBroadcast
) PURE
;
687 STDMETHOD(get_IsDurationValid
)(VARIANT_BOOL __RPC_FAR
*pIsDurationValid
) PURE
;
688 STDMETHOD(get_SourceProtocol
)(long __RPC_FAR
*pSourceProtocol
) PURE
;
689 STDMETHOD(get_OpenState
)(long __RPC_FAR
*pOpenState
) PURE
;
690 STDMETHOD(get_SendOpenStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendOpenStateChangeEvents
) PURE
;
691 STDMETHOD(put_SendOpenStateChangeEvents
)(VARIANT_BOOL pSendOpenStateChangeEvents
) PURE
;
692 STDMETHOD(get_SendWarningEvents
)(VARIANT_BOOL __RPC_FAR
*pSendWarningEvents
) PURE
;
693 STDMETHOD(put_SendWarningEvents
)(VARIANT_BOOL pSendWarningEvents
) PURE
;
694 STDMETHOD(get_SendErrorEvents
)(VARIANT_BOOL __RPC_FAR
*pSendErrorEvents
) PURE
;
695 STDMETHOD(put_SendErrorEvents
)(VARIANT_BOOL pSendErrorEvents
) PURE
;
696 STDMETHOD(get_HasError
)(VARIANT_BOOL __RPC_FAR
*pHasError
) PURE
;
697 STDMETHOD(get_ErrorDescription
)(BSTR __RPC_FAR
*pbstrErrorDescription
) PURE
;
698 STDMETHOD(get_ErrorCode
)(long __RPC_FAR
*pErrorCode
) PURE
;
699 STDMETHOD(get_PlayState
)(long __RPC_FAR
*pPlayState
) PURE
;
700 STDMETHOD(get_SendPlayStateChangeEvents
)(VARIANT_BOOL __RPC_FAR
*pSendPlayStateChangeEvents
) PURE
;
701 STDMETHOD(put_SendPlayStateChangeEvents
)(VARIANT_BOOL pSendPlayStateChangeEvents
) PURE
;
702 STDMETHOD(get_BufferingTime
)(double __RPC_FAR
*pBufferingTime
) PURE
;
703 STDMETHOD(put_BufferingTime
)(double pBufferingTime
) PURE
;
704 STDMETHOD(get_UseFixedUDPPort
)(VARIANT_BOOL __RPC_FAR
*pUseFixedUDPPort
) PURE
;
705 STDMETHOD(put_UseFixedUDPPort
)(VARIANT_BOOL pUseFixedUDPPort
) PURE
;
706 STDMETHOD(get_FixedUDPPort
)(long __RPC_FAR
*pFixedUDPPort
) PURE
;
707 STDMETHOD(put_FixedUDPPort
)(long pFixedUDPPort
) PURE
;
708 STDMETHOD(get_UseHTTPProxy
)(VARIANT_BOOL __RPC_FAR
*pUseHTTPProxy
) PURE
;
709 STDMETHOD(put_UseHTTPProxy
)(VARIANT_BOOL pUseHTTPProxy
) PURE
;
710 STDMETHOD(get_EnableAutoProxy
)(VARIANT_BOOL __RPC_FAR
*pEnableAutoProxy
) PURE
;
711 STDMETHOD(put_EnableAutoProxy
)(VARIANT_BOOL pEnableAutoProxy
) PURE
;
712 STDMETHOD(get_HTTPProxyHost
)(BSTR __RPC_FAR
*pbstrHTTPProxyHost
) PURE
;
713 STDMETHOD(put_HTTPProxyHost
)(BSTR pbstrHTTPProxyHost
) PURE
;
714 STDMETHOD(get_HTTPProxyPort
)(long __RPC_FAR
*pHTTPProxyPort
) PURE
;
715 STDMETHOD(put_HTTPProxyPort
)(long pHTTPProxyPort
) PURE
;
716 STDMETHOD(get_EnableMulticast
)(VARIANT_BOOL __RPC_FAR
*pEnableMulticast
) PURE
;
717 STDMETHOD(put_EnableMulticast
)(VARIANT_BOOL pEnableMulticast
) PURE
;
718 STDMETHOD(get_EnableUDP
)(VARIANT_BOOL __RPC_FAR
*pEnableUDP
) PURE
;
719 STDMETHOD(put_EnableUDP
)(VARIANT_BOOL pEnableUDP
) PURE
;
720 STDMETHOD(get_EnableTCP
)(VARIANT_BOOL __RPC_FAR
*pEnableTCP
) PURE
;
721 STDMETHOD(put_EnableTCP
)(VARIANT_BOOL pEnableTCP
) PURE
;
722 STDMETHOD(get_EnableHTTP
)(VARIANT_BOOL __RPC_FAR
*pEnableHTTP
) PURE
;
723 STDMETHOD(put_EnableHTTP
)(VARIANT_BOOL pEnableHTTP
) PURE
;
724 STDMETHOD(get_BufferingProgress
)(long __RPC_FAR
*pBufferingProgress
) PURE
;
725 STDMETHOD(get_BaseURL
)(BSTR __RPC_FAR
*pbstrBaseURL
) PURE
;
726 STDMETHOD(put_BaseURL
)(BSTR pbstrBaseURL
) PURE
;
727 STDMETHOD(get_DefaultFrame
)(BSTR __RPC_FAR
*pbstrDefaultFrame
) PURE
;
728 STDMETHOD(put_DefaultFrame
)(BSTR pbstrDefaultFrame
) PURE
;
729 STDMETHOD(AboutBox
))(void) PURE
;
730 STDMETHOD(Cancel
)(void) PURE
;
731 STDMETHOD(GetCodecInstalled
)(long CodecNum
, VARIANT_BOOL __RPC_FAR
*pCodecInstalled
) PURE
;
732 STDMETHOD(GetCodecDescription
)(long CodecNum
, BSTR __RPC_FAR
*pbstrCodecDescription
) PURE
;
733 STDMETHOD(GetCodecURL
)(long CodecNum
, BSTR __RPC_FAR
*pbstrCodecURL
) PURE
;
734 STDMETHOD(Open
)(BSTR bstrFileName
) PURE
;
738 struct INSPlay1
: public INSPlay
740 STDMETHOD(get_MediaPlayer
)(IDispatch __RPC_FAR
*__RPC_FAR
*ppdispatch
) PURE
;
743 //---------------------------------------------------------------------------
744 // IWMP (PocketPC 2000) COM INTERFACES (dumped from PlayerOCX.idl)
745 //---------------------------------------------------------------------------
747 struct IWMP
: public IDispatch
750 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_AutoSize(
751 /* [in] */ VARIANT_BOOL vbool
) = 0;
753 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_AutoSize(
754 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pbool
) = 0;
756 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_BorderStyle(
757 /* [in] */ long style
) = 0;
759 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_BorderStyle(
760 /* [retval][out] */ long __RPC_FAR
*pstyle
) = 0;
762 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_Enabled(
763 /* [in] */ VARIANT_BOOL vbool
) = 0;
765 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_Enabled(
766 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pbool
) = 0;
768 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_FileName(
769 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
771 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_FileName(
772 /* [in] */ BSTR newVal
) = 0;
774 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Volume(
775 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
777 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Volume(
778 /* [in] */ long newVal
) = 0;
780 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Mute(
781 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
783 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Mute(
784 /* [in] */ VARIANT_BOOL newVal
) = 0;
786 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AutoStart(
787 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
789 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AutoStart(
790 /* [in] */ VARIANT_BOOL newVal
) = 0;
792 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_PlayCount(
793 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
795 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_PlayCount(
796 /* [in] */ long newVal
) = 0;
798 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowStatusBar(
799 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
801 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowStatusBar(
802 /* [in] */ VARIANT_BOOL newVal
) = 0;
804 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowAudioControls(
805 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
807 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowAudioControls(
808 /* [in] */ VARIANT_BOOL newVal
) = 0;
810 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowCaptioning(
811 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
813 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowCaptioning(
814 /* [in] */ VARIANT_BOOL newVal
) = 0;
816 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowControls(
817 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
819 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowControls(
820 /* [in] */ VARIANT_BOOL newVal
) = 0;
822 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowDisplay(
823 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
825 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowDisplay(
826 /* [in] */ VARIANT_BOOL newVal
) = 0;
828 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowGotoBar(
829 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
831 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowGotoBar(
832 /* [in] */ VARIANT_BOOL newVal
) = 0;
834 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowPositionControls(
835 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
837 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowPositionControls(
838 /* [in] */ VARIANT_BOOL newVal
) = 0;
840 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ShowTracker(
841 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
843 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ShowTracker(
844 /* [in] */ VARIANT_BOOL newVal
) = 0;
846 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Startup( void ) = 0;
848 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Shutdown( void ) = 0;
850 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Bandwidth(
851 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
853 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BaseURL(
854 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
856 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_BaseURL(
857 /* [in] */ BSTR pVal
) = 0;
859 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BufferingCount(
860 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
862 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BufferingProgress(
863 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
865 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_BufferingTime(
866 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
868 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanSeek(
869 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
871 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanSeekToMarkers(
872 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
874 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ChannelDescription(
875 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
877 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ChannelName(
878 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
880 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ChannelURL(
881 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
883 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ClientID(
884 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
886 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ConnectionSpeed(
887 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
889 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ContactAddress(
890 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
892 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ContactEmail(
893 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
895 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ContactPhone(
896 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
898 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CurrentMarker(
899 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
901 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_CurrentMarker(
902 /* [in] */ long newVal
) = 0;
904 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CurrentPosition(
905 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
907 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_CurrentPosition(
908 /* [in] */ double newVal
) = 0;
910 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DefaultFrame(
911 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
913 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DefaultFrame(
914 /* [in] */ BSTR newVal
) = 0;
916 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Duration(
917 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
919 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EntryCount(
920 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
922 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ErrorCode(
923 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
925 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ErrorDescription(
926 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
928 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_HasError(
929 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
931 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_HasMultipleItems(
932 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
934 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ImageSourceHeight(
935 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
937 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ImageSourceWidth(
938 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
940 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_InvokeURLs(
941 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
943 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_InvokeURLs(
944 /* [in] */ VARIANT_BOOL newVal
) = 0;
946 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_IsBroadcast(
947 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
949 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_IsDurationValid(
950 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
952 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_LostPackets(
953 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
955 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_MarkerCount(
956 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
958 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_OpenState(
959 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
961 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_PlayState(
962 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
964 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_PreviewMode(
965 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
967 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_PreviewMode(
968 /* [in] */ VARIANT_BOOL newVal
) = 0;
970 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ReadyState(
971 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
973 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ReceivedPackets(
974 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
976 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ReceptionQuality(
977 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
979 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_RecoveredPackets(
980 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
982 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SAMIFileName(
983 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
985 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SAMIFileName(
986 /* [in] */ BSTR newVal
) = 0;
988 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SAMILang(
989 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
991 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SAMILang(
992 /* [in] */ BSTR newVal
) = 0;
994 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SAMIStyle(
995 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
997 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SAMIStyle(
998 /* [in] */ BSTR newVal
) = 0;
1000 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SelectionEnd(
1001 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
1003 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SelectionEnd(
1004 /* [in] */ double newVal
) = 0;
1006 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SelectionStart(
1007 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
1009 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SelectionStart(
1010 /* [in] */ double newVal
) = 0;
1012 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendErrorEvents(
1013 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1015 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendErrorEvents(
1016 /* [in] */ VARIANT_BOOL newVal
) = 0;
1018 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendKeyboardEvents(
1019 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1021 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendKeyboardEvents(
1022 /* [in] */ VARIANT_BOOL newVal
) = 0;
1024 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendMouseClickEvents(
1025 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1027 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendMouseClickEvents(
1028 /* [in] */ VARIANT_BOOL newVal
) = 0;
1030 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendMouseMoveEvents(
1031 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1033 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendMouseMoveEvents(
1034 /* [in] */ VARIANT_BOOL newVal
) = 0;
1036 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendOpenStateChangeEvents(
1037 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1039 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendOpenStateChangeEvents(
1040 /* [in] */ VARIANT_BOOL newVal
) = 0;
1042 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendPlayStateChangeEvents(
1043 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1045 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendPlayStateChangeEvents(
1046 /* [in] */ VARIANT_BOOL newVal
) = 0;
1048 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SendWarningEvents(
1049 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1051 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_SendWarningEvents(
1052 /* [in] */ VARIANT_BOOL newVal
) = 0;
1054 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SourceLink(
1055 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
1057 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
AboutBox( void) = 0;
1059 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Cancel( void) = 0;
1061 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCodecDescription(
1062 /* [in] */ long nCodec
,
1063 /* [retval][out] */ BSTR __RPC_FAR
*pDescription
) = 0;
1065 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCodecInstalled(
1066 /* [in] */ BSTR __RPC_FAR
*pstrCodec
,
1067 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pIsInstalled
) = 0;
1069 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCurrentEntry(
1070 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1072 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMarkerName(
1073 /* [in] */ long nMarker
,
1074 /* [retval][out] */ BSTR __RPC_FAR
*pMarkerName
) = 0;
1076 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMarkerTime(
1077 /* [in] */ long nMarker
,
1078 /* [retval][out] */ double __RPC_FAR
*pMarkerTime
) = 0;
1080 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMediaInfoString(
1081 /* [in] */ long MPMediaInfoType
,
1082 /* [retval][out] */ BSTR __RPC_FAR
*pstrMediaInfo
) = 0;
1084 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Next( void) = 0;
1086 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Open(
1089 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Pause( void) = 0;
1091 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Play( void) = 0;
1093 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Previous( void) = 0;
1095 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
Stop( void) = 0;
1097 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Rate(
1098 /* [retval][out] */ double __RPC_FAR
*pVal
) = 0;
1100 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Rate(
1101 /* [in] */ double newVal
) = 0;
1103 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplaySize(
1104 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1106 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplaySize(
1107 /* [in] */ long newVal
) = 0;
1109 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_SourceProtocol(
1110 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1112 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ErrorCorrection(
1113 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
1115 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
FinalConstruct( void) = 0;
1117 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AllowChangeDisplaySize(
1118 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1120 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AllowChangeDisplaySize(
1121 /* [in] */ VARIANT_BOOL newVal
) = 0;
1123 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AllowScan(
1124 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1126 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AllowScan(
1127 /* [in] */ VARIANT_BOOL newVal
) = 0;
1129 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AnimationAtStart(
1130 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1132 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AnimationAtStart(
1133 /* [in] */ VARIANT_BOOL newVal
) = 0;
1135 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AudioStream(
1136 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1138 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AudioStream(
1139 /* [in] */ long newVal
) = 0;
1141 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_AutoRewind(
1142 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1144 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_AutoRewind(
1145 /* [in] */ VARIANT_BOOL newVal
) = 0;
1147 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Balance(
1148 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1150 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_Balance(
1151 /* [in] */ long newVal
) = 0;
1153 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanPreview(
1154 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1156 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CanScan(
1157 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1159 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CaptioningID(
1160 /* [retval][out] */ BSTR __RPC_FAR
*pVal
) = 0;
1162 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_ClickToPlay(
1163 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1165 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_ClickToPlay(
1166 /* [in] */ VARIANT_BOOL newVal
) = 0;
1168 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CodecCount(
1169 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1171 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CreationDate(
1172 /* [retval][out] */ DATE __RPC_FAR
*pVal
) = 0;
1174 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_CursorType(
1175 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1177 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_CursorType(
1178 /* [in] */ long newVal
) = 0;
1180 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplayBackColor(
1181 /* [retval][out] */ VB_OLE_COLOR __RPC_FAR
*pVal
) = 0;
1183 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplayBackColor(
1184 /* [in] */ VB_OLE_COLOR newVal
) = 0;
1186 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplayForeColor(
1187 /* [retval][out] */ VB_OLE_COLOR __RPC_FAR
*pVal
) = 0;
1189 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplayForeColor(
1190 /* [in] */ VB_OLE_COLOR newVal
) = 0;
1192 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_DisplayMode(
1193 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1195 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_DisplayMode(
1196 /* [in] */ long newVal
) = 0;
1198 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnableContextMenu(
1199 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1201 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnableContextMenu(
1202 /* [in] */ VARIANT_BOOL newVal
) = 0;
1204 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnableFullScreenControls(
1205 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1207 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnableFullScreenControls(
1208 /* [in] */ VARIANT_BOOL newVal
) = 0;
1210 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnablePositionControls(
1211 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1213 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnablePositionControls(
1214 /* [in] */ VARIANT_BOOL newVal
) = 0;
1216 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_EnableTracker(
1217 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1219 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_EnableTracker(
1220 /* [in] */ VARIANT_BOOL newVal
) = 0;
1222 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Language(
1223 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1225 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_StreamCount(
1226 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1228 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_TransparentAtStart(
1229 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1231 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_TransparentAtStart(
1232 /* [in] */ VARIANT_BOOL newVal
) = 0;
1234 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_VideoBorder3D(
1235 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*pVal
) = 0;
1237 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_VideoBorder3D(
1238 /* [in] */ VARIANT_BOOL newVal
) = 0;
1240 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_VideoBorderColor(
1241 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1243 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_VideoBorderColor(
1244 /* [in] */ long newVal
) = 0;
1246 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_VideoBorderWidth(
1247 /* [retval][out] */ long __RPC_FAR
*pVal
) = 0;
1249 virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE
put_VideoBorderWidth(
1250 /* [in] */ long newVal
) = 0;
1252 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
FastForward( void) = 0;
1254 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
FastReverse( void) = 0;
1256 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetCodecURL(
1257 /* [retval][out] */ BSTR __RPC_FAR
*pstrCodecURL
) = 0;
1259 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMediaParameter(
1260 /* [in] */ long nParam
,
1261 BSTR szParameterName
,
1262 /* [retval][out] */ BSTR __RPC_FAR
*pstrParameterValue
) = 0;
1264 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMediaParameterName(
1265 /* [in] */ long nParam
,
1267 /* [retval][out] */ BSTR __RPC_FAR
*pstrParameterName
) = 0;
1269 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetMoreInfoURL(
1270 /* [retval][out] */ BSTR __RPC_FAR
*pstrMoreInfoURL
) = 0;
1272 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetStreamGroup(
1273 /* [retval][out] */ BSTR __RPC_FAR
*pstrStreamGroup
) = 0;
1275 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetStreamName(
1276 /* [retval][out] */ BSTR __RPC_FAR
*pstrStreamName
) = 0;
1278 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
GetStreamSelected(
1279 /* [in] */ long nStream
,
1280 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*fIsSelected
) = 0;
1282 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
IsSoundCardEnabled(
1283 /* [retval][out] */ VARIANT_BOOL __RPC_FAR
*fIsEnabled
) = 0;
1285 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
SetCurrentEntry(
1288 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
ShowDialog(
1291 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
StreamSelect(
1294 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
OnWindowMessage(
1298 LRESULT __RPC_FAR
*plResult
) = 0;
1301 //---------------------------------------------------------------------------
1302 // MISC COM INTERFACES
1303 //---------------------------------------------------------------------------
1304 typedef enum _FilterState
1312 typedef enum _PinDirection
1319 typedef struct _FilterInfo
1322 struct IFilterGraph
*pGraph
;
1326 typedef struct _PinInfo
1328 struct IBaseFilter
*pFilter
;
1336 struct IEnumFilters
;
1337 typedef struct _MediaType
1341 BOOL bFixedSizeSamples
;
1342 BOOL bTemporalCompression
;
1351 struct IFilterGraph
: public IUnknown
1353 STDMETHOD(AddFilter
)(IBaseFilter
*, LPCWSTR
) PURE
;
1354 STDMETHOD(RemoveFilter
)(IBaseFilter
*) PURE
;
1355 STDMETHOD(EnumFilters
)(IEnumFilters
**) PURE
;
1356 STDMETHOD(FindFilterByName
)(LPCWSTR
, IBaseFilter
**) PURE
;
1357 STDMETHOD(ConnectDirect
)(IPin
*, IPin
*, const AM_MEDIA_TYPE
*) PURE
;
1358 STDMETHOD(Reconnect
)(IPin
*) PURE
;
1359 STDMETHOD(Disconnect
)(IPin
*) PURE
;
1360 STDMETHOD(SetDefaultSyncSource
)() PURE
;
1363 struct IGraphBuilder
: public IFilterGraph
1365 STDMETHOD(Connect
)(IPin
*, IPin
*) PURE
;
1366 STDMETHOD(Render
)(IPin
*) PURE
;
1367 STDMETHOD(RenderFile
)(LPCWSTR
, LPCWSTR
) PURE
;
1368 STDMETHOD(AddSourceFilter
)(LPCWSTR
, LPCWSTR
, IBaseFilter
**) PURE
;
1369 STDMETHOD(SetLogFile
)(DWORD_PTR
) PURE
;
1370 STDMETHOD(Abort
)() PURE
;
1371 STDMETHOD(ShouldOperationContinue
)() PURE
;
1374 struct IReferenceClock
;
1376 #define REFERENCE_TIME LONGLONG
1377 struct IMediaFilter
: public IPersist
1379 STDMETHOD(Stop
)( void) PURE
;
1380 STDMETHOD(Pause
)( void) PURE
;
1381 STDMETHOD(Run
)(REFERENCE_TIME tStart
) PURE
;
1382 STDMETHOD(GetState
)(DWORD dwMilliSecsTimeout
,
1383 FILTER_STATE
*State
) PURE
;
1384 STDMETHOD(SetSyncSource
)(IReferenceClock
*pClock
) PURE
;
1385 STDMETHOD(GetSyncSource
)(IReferenceClock
**pClock
) PURE
;
1388 struct IBaseFilter
: public IMediaFilter
1390 STDMETHOD(EnumPins
)(IEnumPins
**ppEnum
) PURE
;
1391 STDMETHOD(FindPin
)(LPCWSTR Id
, IPin
**ppPin
) PURE
;
1392 STDMETHOD(QueryFilterInfo
)(FILTER_INFO
*pInfo
) PURE
;
1393 STDMETHOD(JoinFilterGraph
)(IFilterGraph
*pGraph
, LPCWSTR pName
) PURE
;
1394 STDMETHOD(QueryVendorInfo
)(LPWSTR
*pVendorInfo
) PURE
;
1398 //---------------------------------------------------------------------------
1400 //---------------------------------------------------------------------------
1402 typedef BOOL (WINAPI
* LPAMGETERRORTEXT
)(HRESULT
, wxChar
*, DWORD
);
1404 class WXDLLIMPEXP_MEDIA wxAMMediaBackend
: public wxMediaBackendCommonBase
1408 virtual ~wxAMMediaBackend();
1411 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
1416 const wxValidator
& validator
,
1417 const wxString
& name
);
1419 virtual bool Play();
1420 virtual bool Pause();
1421 virtual bool Stop();
1423 virtual bool Load(const wxString
& fileName
);
1424 virtual bool Load(const wxURI
& location
);
1425 virtual bool Load(const wxURI
& location
, const wxURI
& proxy
);
1427 bool DoLoad(const wxString
& location
);
1430 virtual wxMediaState
GetState();
1432 virtual bool SetPosition(wxLongLong where
);
1433 virtual wxLongLong
GetPosition();
1434 virtual wxLongLong
GetDuration();
1436 virtual void Move(int x
, int y
, int w
, int h
);
1437 wxSize
GetVideoSize() const;
1439 virtual double GetPlaybackRate();
1440 virtual bool SetPlaybackRate(double);
1442 virtual double GetVolume();
1443 virtual bool SetVolume(double);
1445 virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags
);
1448 void DoGetDownloadProgress(wxLongLong
*, wxLongLong
*);
1450 virtual wxLongLong
GetDownloadProgress()
1452 wxLongLong progress
, total
;
1453 DoGetDownloadProgress(&progress
, &total
);
1457 virtual wxLongLong
GetDownloadTotal()
1459 wxLongLong progress
, total
;
1460 DoGetDownloadProgress(&progress
, &total
);
1466 wxActiveXContainer
* m_pAX
;
1471 IWMP
* GetMP() { return m_pWMP
; }
1472 IWMP
* GetAM() { return m_pWMP
; }
1474 IActiveMovie
* m_pAM
;
1475 IMediaPlayer
* m_pMP
;
1477 IMediaPlayer
* GetMP() { return m_pMP
; }
1478 IActiveMovie
* GetAM() { return m_pAM
; }
1485 wxDynamicLibrary m_dllQuartz
;
1486 LPAMGETERRORTEXT m_lpAMGetErrorText
;
1487 wxString
GetErrorString(HRESULT hrdsv
);
1490 DECLARE_DYNAMIC_CLASS(wxAMMediaBackend
)
1493 //---------------------------------------------------------------------------
1494 // wxMCIMediaBackend
1495 //---------------------------------------------------------------------------
1497 //---------------------------------------------------------------------------
1499 //---------------------------------------------------------------------------
1501 #include <mmsystem.h>
1503 class WXDLLIMPEXP_MEDIA wxMCIMediaBackend
: public wxMediaBackendCommonBase
1506 wxMCIMediaBackend();
1507 ~wxMCIMediaBackend();
1509 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
1514 const wxValidator
& validator
,
1515 const wxString
& name
);
1517 virtual bool Play();
1518 virtual bool Pause();
1519 virtual bool Stop();
1521 virtual bool Load(const wxURI
& location
,
1523 { return wxMediaBackend::Load(location
, proxy
); }
1525 virtual bool Load(const wxString
& fileName
);
1526 virtual bool Load(const wxURI
& location
);
1528 virtual wxMediaState
GetState();
1530 virtual bool SetPosition(wxLongLong where
);
1531 virtual wxLongLong
GetPosition();
1532 virtual wxLongLong
GetDuration();
1534 virtual void Move(int x
, int y
, int w
, int h
);
1535 wxSize
GetVideoSize() const;
1537 virtual double GetPlaybackRate();
1538 virtual bool SetPlaybackRate(double dRate
);
1540 virtual double GetVolume();
1541 virtual bool SetVolume(double);
1543 static LRESULT CALLBACK
NotifyWndProc(HWND hWnd
, UINT nMsg
,
1544 WPARAM wParam
, LPARAM lParam
);
1546 LRESULT CALLBACK
OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
1547 WPARAM wParam
, LPARAM lParam
);
1549 MCIDEVICEID m_hDev
; //Our MCI Device ID/Handler
1550 HWND m_hNotifyWnd
; //Window to use for MCI events
1551 bool m_bVideo
; //Whether or not we have video
1553 DECLARE_DYNAMIC_CLASS(wxMCIMediaBackend
)
1557 //---------------------------------------------------------------------------
1560 // We don't include Quicktime headers here and define all the types
1561 // ourselves because looking for the quicktime libaries etc. would
1562 // be tricky to do and making this a dependency for the MSVC projects
1563 // would be unrealistic.
1565 // Thanks to Robert Roebling for the wxDL macro/library idea
1566 //---------------------------------------------------------------------------
1568 //---------------------------------------------------------------------------
1570 //---------------------------------------------------------------------------
1571 //#include <qtml.h> // Windoze QT include
1572 //#include <QuickTimeComponents.h> // Standard QT stuff
1573 #include "wx/dynlib.h"
1575 //---------------------------------------------------------------------------
1577 //---------------------------------------------------------------------------
1578 typedef struct MovieRecord
* Movie
;
1579 typedef wxInt16 OSErr
;
1580 typedef wxInt32 OSStatus
;
1583 typedef unsigned char Str255
[256];
1584 #define StringPtr unsigned char*
1585 #define newMovieActive 1
1586 #define newMovieAsyncOK (1 << 8)
1590 #define OSType unsigned long
1591 #define CGrafPtr struct GrafPort *
1592 #define TimeScale long
1593 #define TimeBase struct TimeBaseRecord *
1594 typedef struct ComponentInstanceRecord
* ComponentInstance
;
1595 #define kMovieLoadStatePlayable 10000
1597 #define MovieController ComponentInstance
1599 #ifndef URLDataHandlerSubType
1600 #if defined(__WATCOMC__) || defined(__MINGW32__)
1601 // use magic numbers for compilers which complain about multicharacter integers
1602 const OSType URLDataHandlerSubType
= 1970433056;
1603 const OSType VisualMediaCharacteristic
= 1702454643;
1605 const OSType URLDataHandlerSubType
= 'url ';
1606 const OSType VisualMediaCharacteristic
= 'eyes';
1614 Str255 name
; // Str63 on mac, Str255 on msw
1633 wide value
; // units
1634 TimeScale scale
; // units per second
1656 mcScaleMovieToFit
= 2,
1662 //---------------------------------------------------------------------------
1664 //---------------------------------------------------------------------------
1665 #define wxDL_METHOD_DEFINE( rettype, name, args, shortargs, defret ) \
1666 typedef rettype (* name ## Type) args ; \
1667 name ## Type pfn_ ## name; \
1669 { if (m_ok) return pfn_ ## name shortargs ; return defret; }
1671 #define wxDL_VOIDMETHOD_DEFINE( name, args, shortargs ) \
1672 typedef void (* name ## Type) args ; \
1673 name ## Type pfn_ ## name; \
1675 { if (m_ok) pfn_ ## name shortargs ; }
1677 #define wxDL_METHOD_LOAD( lib, name, success ) \
1678 pfn_ ## name = (name ## Type) lib.GetSymbol( wxT(#name), &success ); \
1679 if (!success) { wxLog::EnableLogging(bWasLoggingEnabled); return false; }
1682 class WXDLLIMPEXP_MEDIA wxQuickTimeLibrary
1685 ~wxQuickTimeLibrary()
1687 if (m_dll
.IsLoaded())
1692 bool IsOk() const {return m_ok
;}
1695 wxDynamicLibrary m_dll
;
1699 wxDL_VOIDMETHOD_DEFINE( StartMovie
, (Movie m
), (m
) );
1700 wxDL_VOIDMETHOD_DEFINE( StopMovie
, (Movie m
), (m
) );
1701 wxDL_METHOD_DEFINE( bool, IsMovieDone
, (Movie m
), (m
), false);
1702 wxDL_VOIDMETHOD_DEFINE( GoToBeginningOfMovie
, (Movie m
), (m
) );
1703 wxDL_METHOD_DEFINE( OSErr
, GetMoviesError
, (), (), -1);
1704 wxDL_METHOD_DEFINE( OSErr
, EnterMovies
, (), (), -1);
1705 wxDL_VOIDMETHOD_DEFINE( ExitMovies
, (), () );
1706 wxDL_METHOD_DEFINE( OSErr
, InitializeQTML
, (long flags
), (flags
), -1);
1707 wxDL_VOIDMETHOD_DEFINE( TerminateQTML
, (), () );
1709 wxDL_METHOD_DEFINE( OSErr
, NativePathNameToFSSpec
,
1710 (char* inName
, FSSpec
* outFile
, long flags
),
1711 (inName
, outFile
, flags
), -1);
1713 wxDL_METHOD_DEFINE( OSErr
, OpenMovieFile
,
1714 (const FSSpec
* fileSpec
, short * resRefNum
, wxInt8 permission
),
1715 (fileSpec
, resRefNum
, permission
), -1 );
1717 wxDL_METHOD_DEFINE( OSErr
, CloseMovieFile
,
1718 (short resRefNum
), (resRefNum
), -1);
1720 wxDL_METHOD_DEFINE( OSErr
, NewMovieFromFile
,
1721 (Movie
* theMovie
, short resRefNum
, short * resId
,
1722 StringPtr resName
, short newMovieFlags
,
1723 bool * dataRefWasChanged
),
1724 (theMovie
, resRefNum
, resId
, resName
, newMovieFlags
,
1725 dataRefWasChanged
), -1);
1727 wxDL_VOIDMETHOD_DEFINE( SetMovieRate
, (Movie m
, Fixed rate
), (m
, rate
) );
1728 wxDL_METHOD_DEFINE( Fixed
, GetMovieRate
, (Movie m
), (m
), 0);
1729 wxDL_VOIDMETHOD_DEFINE( MoviesTask
, (Movie m
, long maxms
), (m
, maxms
) );
1730 wxDL_VOIDMETHOD_DEFINE( BlockMove
,
1731 (const char* p1
, const char* p2
, long s
), (p1
,p2
,s
) );
1732 wxDL_METHOD_DEFINE( Handle
, NewHandleClear
, (long s
), (s
), NULL
);
1734 wxDL_METHOD_DEFINE( OSErr
, NewMovieFromDataRef
,
1735 (Movie
* m
, short flags
, short * id
,
1736 Handle dataRef
, OSType dataRefType
),
1737 (m
,flags
,id
,dataRef
,dataRefType
), -1 );
1739 wxDL_VOIDMETHOD_DEFINE( DisposeHandle
, (Handle h
), (h
) );
1740 wxDL_VOIDMETHOD_DEFINE( GetMovieNaturalBoundsRect
, (Movie m
, Rect
* r
), (m
,r
) );
1741 wxDL_METHOD_DEFINE( void*, GetMovieIndTrackType
,
1742 (Movie m
, long index
, OSType type
, long flags
),
1743 (m
,index
,type
,flags
), NULL
);
1744 wxDL_VOIDMETHOD_DEFINE( CreatePortAssociation
,
1745 (void* hWnd
, void* junk
, long morejunk
), (hWnd
, junk
, morejunk
) );
1746 wxDL_METHOD_DEFINE(void*, GetNativeWindowPort
, (void* hWnd
), (hWnd
), NULL
);
1747 wxDL_VOIDMETHOD_DEFINE(SetMovieGWorld
, (Movie m
, CGrafPtr port
, void* whatever
),
1748 (m
, port
, whatever
) );
1749 wxDL_VOIDMETHOD_DEFINE(DisposeMovie
, (Movie m
), (m
) );
1750 wxDL_VOIDMETHOD_DEFINE(SetMovieBox
, (Movie m
, Rect
* r
), (m
,r
));
1751 wxDL_VOIDMETHOD_DEFINE(SetMovieTimeScale
, (Movie m
, long s
), (m
,s
));
1752 wxDL_METHOD_DEFINE(long, GetMovieDuration
, (Movie m
), (m
), 0);
1753 wxDL_METHOD_DEFINE(TimeBase
, GetMovieTimeBase
, (Movie m
), (m
), 0);
1754 wxDL_METHOD_DEFINE(TimeScale
, GetMovieTimeScale
, (Movie m
), (m
), 0);
1755 wxDL_METHOD_DEFINE(long, GetMovieTime
, (Movie m
, void* cruft
), (m
,cruft
), 0);
1756 wxDL_VOIDMETHOD_DEFINE(SetMovieTime
, (Movie m
, TimeRecord
* tr
), (m
,tr
) );
1757 wxDL_METHOD_DEFINE(short, GetMovieVolume
, (Movie m
), (m
), 0);
1758 wxDL_VOIDMETHOD_DEFINE(SetMovieVolume
, (Movie m
, short sVolume
), (m
,sVolume
) );
1759 wxDL_VOIDMETHOD_DEFINE(SetMovieTimeValue
, (Movie m
, long s
), (m
,s
));
1760 wxDL_METHOD_DEFINE(ComponentInstance
, NewMovieController
, (Movie m
, const Rect
* mr
, long fl
), (m
,mr
,fl
), 0);
1761 wxDL_VOIDMETHOD_DEFINE(DisposeMovieController
, (ComponentInstance ci
), (ci
));
1762 wxDL_METHOD_DEFINE(int, MCSetVisible
, (ComponentInstance m
, int b
), (m
, b
), 0);
1764 wxDL_VOIDMETHOD_DEFINE(PrePrerollMovie
, (Movie m
, long t
, Fixed r
, WXFARPROC p1
, void* p2
), (m
,t
,r
,p1
,p2
) );
1765 wxDL_VOIDMETHOD_DEFINE(PrerollMovie
, (Movie m
, long t
, Fixed r
), (m
,t
,r
) );
1766 wxDL_METHOD_DEFINE(Fixed
, GetMoviePreferredRate
, (Movie m
), (m
), 0);
1767 wxDL_METHOD_DEFINE(long, GetMovieLoadState
, (Movie m
), (m
), 0);
1768 wxDL_METHOD_DEFINE(void*, NewRoutineDescriptor
, (WXFARPROC f
, int l
, void* junk
), (f
, l
, junk
), 0);
1769 wxDL_VOIDMETHOD_DEFINE(DisposeRoutineDescriptor
, (void* f
), (f
));
1770 wxDL_METHOD_DEFINE(void*, GetCurrentArchitecture
, (), (), 0);
1771 wxDL_METHOD_DEFINE(int, MCDoAction
, (ComponentInstance ci
, long f
, void* p
), (ci
,f
,p
), 0);
1772 wxDL_VOIDMETHOD_DEFINE(MCSetControllerBoundsRect
, (ComponentInstance ci
, Rect
* r
), (ci
,r
));
1773 wxDL_VOIDMETHOD_DEFINE(DestroyPortAssociation
, (CGrafPtr g
), (g
));
1774 wxDL_VOIDMETHOD_DEFINE(NativeEventToMacEvent
, (MSG
* p1
, EventRecord
* p2
), (p1
,p2
));
1775 wxDL_VOIDMETHOD_DEFINE(MCIsPlayerEvent
, (ComponentInstance ci
, EventRecord
* p2
), (ci
, p2
));
1776 wxDL_METHOD_DEFINE(int, MCSetMovie
, (ComponentInstance ci
, Movie m
, void* p1
, Point w
),
1778 wxDL_VOIDMETHOD_DEFINE(MCPositionController
,
1779 (ComponentInstance ci
, Rect
* r
, void* junk
, void* morejunk
), (ci
,r
,junk
,morejunk
));
1780 wxDL_VOIDMETHOD_DEFINE(MCSetActionFilterWithRefCon
,
1781 (ComponentInstance ci
, WXFARPROC cb
, void* ref
), (ci
,cb
,ref
));
1782 wxDL_VOIDMETHOD_DEFINE(MCGetControllerInfo
, (MovieController mc
, long* flags
), (mc
,flags
));
1783 wxDL_VOIDMETHOD_DEFINE(BeginUpdate
, (CGrafPtr port
), (port
));
1784 wxDL_VOIDMETHOD_DEFINE(UpdateMovie
, (Movie m
), (m
));
1785 wxDL_VOIDMETHOD_DEFINE(EndUpdate
, (CGrafPtr port
), (port
));
1786 wxDL_METHOD_DEFINE( OSErr
, GetMoviesStickyError
, (), (), -1);
1789 bool wxQuickTimeLibrary::Initialize()
1793 // Turn off the wxDynamicLibrary logging
1794 bool bWasLoggingEnabled
= wxLog::EnableLogging(false);
1796 if (!m_dll
.Load(wxT("qtmlClient.dll")))
1798 wxLog::EnableLogging(bWasLoggingEnabled
);
1802 wxDL_METHOD_LOAD( m_dll
, StartMovie
, m_ok
);
1803 wxDL_METHOD_LOAD( m_dll
, StopMovie
, m_ok
);
1804 wxDL_METHOD_LOAD( m_dll
, IsMovieDone
, m_ok
);
1805 wxDL_METHOD_LOAD( m_dll
, GoToBeginningOfMovie
, m_ok
);
1806 wxDL_METHOD_LOAD( m_dll
, GetMoviesError
, m_ok
);
1807 wxDL_METHOD_LOAD( m_dll
, EnterMovies
, m_ok
);
1808 wxDL_METHOD_LOAD( m_dll
, ExitMovies
, m_ok
);
1809 wxDL_METHOD_LOAD( m_dll
, InitializeQTML
, m_ok
);
1810 wxDL_METHOD_LOAD( m_dll
, TerminateQTML
, m_ok
);
1811 wxDL_METHOD_LOAD( m_dll
, NativePathNameToFSSpec
, m_ok
);
1812 wxDL_METHOD_LOAD( m_dll
, OpenMovieFile
, m_ok
);
1813 wxDL_METHOD_LOAD( m_dll
, CloseMovieFile
, m_ok
);
1814 wxDL_METHOD_LOAD( m_dll
, NewMovieFromFile
, m_ok
);
1815 wxDL_METHOD_LOAD( m_dll
, GetMovieRate
, m_ok
);
1816 wxDL_METHOD_LOAD( m_dll
, SetMovieRate
, m_ok
);
1817 wxDL_METHOD_LOAD( m_dll
, MoviesTask
, m_ok
);
1818 wxDL_METHOD_LOAD( m_dll
, BlockMove
, m_ok
);
1819 wxDL_METHOD_LOAD( m_dll
, NewHandleClear
, m_ok
);
1820 wxDL_METHOD_LOAD( m_dll
, NewMovieFromDataRef
, m_ok
);
1821 wxDL_METHOD_LOAD( m_dll
, DisposeHandle
, m_ok
);
1822 wxDL_METHOD_LOAD( m_dll
, GetMovieNaturalBoundsRect
, m_ok
);
1823 wxDL_METHOD_LOAD( m_dll
, GetMovieIndTrackType
, m_ok
);
1824 wxDL_METHOD_LOAD( m_dll
, CreatePortAssociation
, m_ok
);
1825 wxDL_METHOD_LOAD( m_dll
, DestroyPortAssociation
, m_ok
);
1826 wxDL_METHOD_LOAD( m_dll
, GetNativeWindowPort
, m_ok
);
1827 wxDL_METHOD_LOAD( m_dll
, SetMovieGWorld
, m_ok
);
1828 wxDL_METHOD_LOAD( m_dll
, DisposeMovie
, m_ok
);
1829 wxDL_METHOD_LOAD( m_dll
, SetMovieBox
, m_ok
);
1830 wxDL_METHOD_LOAD( m_dll
, SetMovieTimeScale
, m_ok
);
1831 wxDL_METHOD_LOAD( m_dll
, GetMovieDuration
, m_ok
);
1832 wxDL_METHOD_LOAD( m_dll
, GetMovieTimeBase
, m_ok
);
1833 wxDL_METHOD_LOAD( m_dll
, GetMovieTimeScale
, m_ok
);
1834 wxDL_METHOD_LOAD( m_dll
, GetMovieTime
, m_ok
);
1835 wxDL_METHOD_LOAD( m_dll
, SetMovieTime
, m_ok
);
1836 wxDL_METHOD_LOAD( m_dll
, GetMovieVolume
, m_ok
);
1837 wxDL_METHOD_LOAD( m_dll
, SetMovieVolume
, m_ok
);
1838 wxDL_METHOD_LOAD( m_dll
, SetMovieTimeValue
, m_ok
);
1839 wxDL_METHOD_LOAD( m_dll
, NewMovieController
, m_ok
);
1840 wxDL_METHOD_LOAD( m_dll
, DisposeMovieController
, m_ok
);
1841 wxDL_METHOD_LOAD( m_dll
, MCSetVisible
, m_ok
);
1842 wxDL_METHOD_LOAD( m_dll
, PrePrerollMovie
, m_ok
);
1843 wxDL_METHOD_LOAD( m_dll
, PrerollMovie
, m_ok
);
1844 wxDL_METHOD_LOAD( m_dll
, GetMoviePreferredRate
, m_ok
);
1845 wxDL_METHOD_LOAD( m_dll
, GetMovieLoadState
, m_ok
);
1846 wxDL_METHOD_LOAD( m_dll
, MCDoAction
, m_ok
);
1847 wxDL_METHOD_LOAD( m_dll
, MCSetControllerBoundsRect
, m_ok
);
1848 wxDL_METHOD_LOAD( m_dll
, NativeEventToMacEvent
, m_ok
);
1849 wxDL_METHOD_LOAD( m_dll
, MCIsPlayerEvent
, m_ok
);
1850 wxDL_METHOD_LOAD( m_dll
, MCSetMovie
, m_ok
);
1851 wxDL_METHOD_LOAD( m_dll
, MCSetActionFilterWithRefCon
, m_ok
);
1852 wxDL_METHOD_LOAD( m_dll
, MCGetControllerInfo
, m_ok
);
1853 wxDL_METHOD_LOAD( m_dll
, BeginUpdate
, m_ok
);
1854 wxDL_METHOD_LOAD( m_dll
, UpdateMovie
, m_ok
);
1855 wxDL_METHOD_LOAD( m_dll
, EndUpdate
, m_ok
);
1856 wxDL_METHOD_LOAD( m_dll
, GetMoviesStickyError
, m_ok
);
1858 wxLog::EnableLogging(bWasLoggingEnabled
);
1864 class WXDLLIMPEXP_MEDIA wxQTMediaBackend
: public wxMediaBackendCommonBase
1868 ~wxQTMediaBackend();
1870 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
1875 const wxValidator
& validator
,
1876 const wxString
& name
);
1878 virtual bool Play();
1879 virtual bool Pause();
1880 virtual bool Stop();
1882 virtual bool Load(const wxURI
& location
,
1884 { return wxMediaBackend::Load(location
, proxy
); }
1886 virtual bool Load(const wxString
& fileName
);
1887 virtual bool Load(const wxURI
& location
);
1889 virtual wxMediaState
GetState();
1891 virtual bool SetPosition(wxLongLong where
);
1892 virtual wxLongLong
GetPosition();
1893 virtual wxLongLong
GetDuration();
1895 virtual void Move(int x
, int y
, int w
, int h
);
1896 wxSize
GetVideoSize() const;
1898 virtual double GetPlaybackRate();
1899 virtual bool SetPlaybackRate(double dRate
);
1901 virtual double GetVolume();
1902 virtual bool SetVolume(double);
1907 static void PPRMProc (Movie theMovie
, OSErr theErr
, void* theRefCon
);
1909 // TODO: Last param actually long - does this work on 64bit machines?
1910 static Boolean
MCFilterProc(MovieController theController
,
1911 short action
, void *params
, LONG_PTR refCon
);
1913 static LRESULT CALLBACK
QTWndProc(HWND
, UINT
, WPARAM
, LPARAM
);
1915 virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags
);
1917 wxSize m_bestSize
; // Original movie size
1918 Movie m_movie
; // QT Movie handle/instance
1919 bool m_bVideo
; // Whether or not we have video
1920 bool m_bPlaying
; // Whether or not movie is playing
1921 wxTimer
* m_timer
; // Load or Play timer
1922 wxQuickTimeLibrary m_lib
; // DLL to load functions from
1923 ComponentInstance m_pMC
; // Movie Controller
1925 friend class wxQTMediaEvtHandler
;
1927 DECLARE_DYNAMIC_CLASS(wxQTMediaBackend
)
1930 // helper to hijack background erasing for the QT window
1931 class WXDLLIMPEXP_MEDIA wxQTMediaEvtHandler
: public wxEvtHandler
1934 wxQTMediaEvtHandler(wxQTMediaBackend
*qtb
, WXHWND hwnd
)
1939 m_qtb
->m_ctrl
->Connect(m_qtb
->m_ctrl
->GetId(),
1940 wxEVT_ERASE_BACKGROUND
,
1941 wxEraseEventHandler(wxQTMediaEvtHandler::OnEraseBackground
),
1945 void OnEraseBackground(wxEraseEvent
& event
);
1948 wxQTMediaBackend
*m_qtb
;
1951 DECLARE_NO_COPY_CLASS(wxQTMediaEvtHandler
)
1955 //===========================================================================
1957 //===========================================================================
1959 //---------------------------------------------------------------------------
1961 //---------------------------------------------------------------------------
1963 IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend
, wxMediaBackend
)
1965 //---------------------------------------------------------------------------
1966 // Usual debugging macros
1967 //---------------------------------------------------------------------------
1969 #define MAX_ERROR_TEXT_LEN 160
1971 // Get the error string for Active Movie
1972 wxString
wxAMMediaBackend::GetErrorString(HRESULT hrdsv
)
1974 wxChar szError
[MAX_ERROR_TEXT_LEN
];
1975 if ( m_lpAMGetErrorText
!= NULL
&&
1976 (*m_lpAMGetErrorText
)(hrdsv
, szError
, MAX_ERROR_TEXT_LEN
) == 0)
1978 return wxString::Format(wxT("DirectShow error \"%s\" \n")
1979 wxT("(numeric %X)\n")
1981 szError
, (int)hrdsv
);
1985 return wxString::Format(wxT("Unknown error \n")
1986 wxT("(numeric %X)\n")
1992 #define wxAMFAIL(x) wxFAIL_MSG(GetErrorString(x));
1993 #define wxVERIFY(x) wxASSERT((x))
1994 #define wxAMLOG(x) wxLogDebug(GetErrorString(x))
1996 #define wxAMVERIFY(x) (x)
1997 #define wxVERIFY(x) (x)
2002 //---------------------------------------------------------------------------
2003 // Standard macros for ease of use
2004 //---------------------------------------------------------------------------
2005 #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
2007 //---------------------------------------------------------------------------
2010 // Queries the control periodically to see if it has reached the point
2011 // in its loading cycle where we can begin playing the media - if so
2012 // then we finish up some things like getting the original size of the video
2013 // and then sending the loaded event to our handler
2014 //---------------------------------------------------------------------------
2015 class wxAMLoadTimer
: public wxTimer
2018 wxAMLoadTimer(wxAMMediaBackend
* parent
) :
2023 if (m_parent
->GetMP())
2025 MPReadyStateConstants nState
;
2027 #ifdef __WXWINCE__ //Cast to long needed for IWMP (??)
2028 m_parent
->GetMP()->get_ReadyState((long*)&nState
);
2030 m_parent
->GetMP()->get_ReadyState(&nState
);
2033 if (nState
!= mpReadyStateLoading
)
2036 m_parent
->FinishLoad();
2042 IActiveMovie2
* pAM2
= NULL
;
2043 ReadyStateConstants nState
;
2044 if (m_parent
->GetAM()->QueryInterface(IID_IActiveMovie2
, (void**)&pAM2
) == 0
2045 && pAM2
->get_ReadyState(&nState
) == 0)
2048 if (nState
!= amvLoading
)
2051 m_parent
->FinishLoad();
2061 m_parent
->FinishLoad();
2068 wxAMMediaBackend
* m_parent
; // Backend pointer
2071 //---------------------------------------------------------------------------
2074 // Sets m_hNotifyWnd to NULL to signify that we haven't loaded anything yet
2075 // Queries the control periodically to see if it has stopped -
2076 // if it has it sends the stop event
2077 //---------------------------------------------------------------------------
2078 class wxAMPlayTimer
: public wxTimer
2081 wxAMPlayTimer(wxAMMediaBackend
* parent
) :
2086 // NB: Stop events could get triggered by the interface
2087 // if ShowPlayerControls is enabled, so the "GetPosition == GetDuration"
2088 // hack is needed here to make an attempt at it not getting sent
2089 // - but its far from ideal - they can still get sent in some cases
2090 if (m_parent
->GetState() == wxMEDIASTATE_STOPPED
&&
2091 m_parent
->GetPosition() == m_parent
->GetDuration())
2093 if ( m_parent
->SendStopEvent() )
2095 // seek to beginning of movie
2096 m_parent
->wxAMMediaBackend::SetPosition(0);
2099 // send the event to our child
2100 m_parent
->QueueFinishEvent();
2106 wxAMMediaBackend
* m_parent
; //Backend pointer
2111 // The following is an alternative way - but it doesn't seem
2112 // to work with the IActiveMovie control - it probably processes
2114 //---------------------------------------------------------------------------
2117 // Query the IMediaEvent interface from the embedded WMP's
2118 // filtergraph, then process the events from it - sending
2119 // EC_COMPLETE events as stop events to the media control.
2120 //---------------------------------------------------------------------------
2121 class wxAMPlayTimer
: public wxTimer
2124 wxAMPlayTimer(wxAMMediaBackend
* pBE
) : m_pBE(pBE
), m_pME(NULL
)
2128 hr
= m_pBE
->GetAM()->get_FilterGraph(&pGB
);
2129 wxASSERT(SUCCEEDED(hr
));
2130 hr
= pGB
->QueryInterface(IID_IMediaEvent
, (void**)&m_pME
);
2131 wxASSERT(SUCCEEDED(hr
));
2137 SAFE_RELEASE(m_pME
);
2143 LONG_PTR evParam1
, evParam2
;
2145 // DirectShow keeps a list of queued events, and we need
2146 // to go through them one by one, stopping at (hopefully only one)
2147 // EC_COMPLETE message
2148 while ( m_pME
->GetEvent(&evCode
, &evParam1
, &evParam2
, 0) == 0 )
2150 // Cleanup memory that GetEvent allocated
2151 HRESULT hr
= m_pME
->FreeEventParams(evCode
, evParam1
, evParam2
);
2154 // Even though this makes a messagebox, this is Windows,
2155 // where we can do GUI stuff in separate threads :)
2156 wxFAIL_MSG(m_pBE
->GetErrorString(hr
));
2158 // If this is the end of the clip, notify handler
2159 else if (1 == evCode
) // EC_COMPLETE
2161 if ( m_pBE
->SendStopEvent() )
2164 m_pBE
->QueueFinishEvent();
2171 wxAMMediaBackend
* m_pBE
; // Backend pointer
2172 IMediaEvent
* m_pME
; // To determine when to send stop event
2176 //---------------------------------------------------------------------------
2177 // wxAMMediaBackend Constructor
2178 //---------------------------------------------------------------------------
2179 wxAMMediaBackend::wxAMMediaBackend()
2191 //---------------------------------------------------------------------------
2192 // wxAMMediaBackend Destructor
2193 //---------------------------------------------------------------------------
2194 wxAMMediaBackend::~wxAMMediaBackend()
2196 // Free memory from Load()
2201 m_pAX
->DissociateHandle();
2213 //---------------------------------------------------------------------------
2214 // wxAMMediaBackend::Clear
2216 // Free up interfaces and memory allocated by LoadXXX
2217 //---------------------------------------------------------------------------
2218 void wxAMMediaBackend::Clear()
2227 //---------------------------------------------------------------------------
2228 // wxAMMediaBackend::CreateControl
2229 //---------------------------------------------------------------------------
2230 bool wxAMMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
2235 const wxValidator
& validator
,
2236 const wxString
& name
)
2238 // First get the AMGetErrorText procedure in
2239 // debug mode for more meaningful messages
2241 if ( m_dllQuartz
.Load(_T("quartz.dll"), wxDL_VERBATIM
) )
2243 m_lpAMGetErrorText
= (LPAMGETERRORTEXT
)
2244 m_dllQuartz
.GetSymbolAorW(wxT("AMGetErrorText"));
2251 // Try progids first - *.WMP is PocketPC and Mediaplayer.1 is CE.NET
2252 // later versions support straight creation from CLSID
2253 if (CLSIDFromProgID(L
"WPCEOCX.WMP", &clsid
) != S_OK
&&
2254 CLSIDFromProgID(L
"MediaPlayer.MediaPlayer.1", &clsid
) != S_OK
)
2256 clsid
= CLSID_MediaPlayer
;
2259 // While the CLSID is the same as CLSID_MediaPlayer
2260 // CE only supports the IWMP interface
2261 if ( ::CoCreateInstance(clsid
, NULL
,
2262 CLSCTX_INPROC_SERVER
,
2263 IID_IWMP
, (void**)&m_pWMP
) != 0 )
2269 // determine which (if any) media player interface
2270 // is available - IMediaPlayer or IActiveMovie
2271 if ( ::CoCreateInstance(CLSID_MediaPlayer
, NULL
,
2272 CLSCTX_INPROC_SERVER
,
2273 IID_IMediaPlayer
, (void**)&m_pMP
) != 0 )
2275 if ( ::CoCreateInstance(CLSID_ActiveMovie
, NULL
,
2276 CLSCTX_INPROC_SERVER
,
2277 IID_IActiveMovie
, (void**)&m_pAM
) != 0 )
2282 m_pAM
->QueryInterface(IID_IMediaPlayer
, (void**)&m_pMP
);
2286 m_pMP
->QueryInterface(IID_IActiveMovie
, (void**)&m_pAM
);
2291 // By default wxWindow(s) is created with a border -
2292 // so we need to get rid of those
2294 // Since we don't have a child window like most other
2295 // backends, we don't need wxCLIP_CHILDREN
2296 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
2297 (style
& ~wxBORDER_MASK
) | wxBORDER_NONE
,
2303 // Create the ActiveX container along with the media player
2304 // interface and query them
2305 m_ctrl
= wxStaticCast(ctrl
, wxMediaCtrl
);
2306 m_pAX
= new wxActiveXContainer(ctrl
,
2310 m_pMP
? IID_IMediaPlayer
: IID_IActiveMovie
, m_pAM
2314 // Set up wx-specific stuff for the default
2315 // settings wxMediaCtrl says it will conform to (???)
2318 GetMP()->put_DisplaySize(mpFitToSize
);
2320 #ifndef __WXWINCE__ // Not in CE's IWMP
2321 // TODO: Unsure what actual effect this has
2322 GetMP()->put_WindowlessVideo(VARIANT_TRUE
);
2325 #ifndef __WXWINCE__ // Not in CE's IWMP
2327 GetAM()->put_MovieWindowSize(amvDoubleOriginalSize
);
2331 GetAM()->put_AutoStart(VARIANT_FALSE
);
2333 // by default enabled
2334 wxAMMediaBackend::ShowPlayerControls(wxMEDIACTRLPLAYERCONTROLS_NONE
);
2336 // by default with AM only 0.5
2337 wxAMMediaBackend::SetVolume(1.0);
2339 // don't erase the background of our control window
2340 // so that resizing is a bit smoother
2341 m_ctrl
->SetBackgroundStyle(wxBG_STYLE_CUSTOM
);
2347 //---------------------------------------------------------------------------
2348 // wxAMMediaBackend::Load (file version)
2349 //---------------------------------------------------------------------------
2350 bool wxAMMediaBackend::Load(const wxString
& fileName
)
2352 return DoLoad(fileName
);
2355 //---------------------------------------------------------------------------
2356 // wxAMMediaBackend::Load (URL Version)
2357 //---------------------------------------------------------------------------
2358 bool wxAMMediaBackend::Load(const wxURI
& location
)
2360 // Turn off loading from a proxy, as user may have set it previously
2361 INSPlay
* pPlay
= NULL
;
2362 GetAM()->QueryInterface(IID_INSPlay
, (void**) &pPlay
);
2365 pPlay
->put_UseHTTPProxy(VARIANT_FALSE
);
2369 return DoLoad(location
.BuildURI());
2372 //---------------------------------------------------------------------------
2373 // wxAMMediaBackend::Load (URL Version with Proxy)
2374 //---------------------------------------------------------------------------
2375 bool wxAMMediaBackend::Load(const wxURI
& location
, const wxURI
& proxy
)
2377 // Set the proxy of the NETSHOW interface
2378 INSPlay
* pPlay
= NULL
;
2379 GetAM()->QueryInterface(IID_INSPlay
, (void**) &pPlay
);
2383 pPlay
->put_UseHTTPProxy(VARIANT_TRUE
);
2384 pPlay
->put_HTTPProxyHost(wxBasicString(proxy
.GetServer()).Get());
2385 pPlay
->put_HTTPProxyPort(wxAtoi(proxy
.GetPort()));
2389 return DoLoad(location
.BuildURI());
2392 //---------------------------------------------------------------------------
2393 // wxAMMediaBackend::DoLoad
2395 // Called by all functions - this actually renders
2396 // the file and sets up the filter graph
2397 //---------------------------------------------------------------------------
2398 bool wxAMMediaBackend::DoLoad(const wxString
& location
)
2400 //Clear up previously allocated memory
2405 // Play the movie the normal way through the embedded WMP.
2406 // Supposedly, Open is better in theory because
2407 // the docs say its async and put_FileName is not -
2408 // but in practice they both appear to be async anyway
2410 hr
= GetMP()->Open( wxBasicString(location
).Get() );
2412 hr
= GetAM()->put_FileName( wxBasicString(location
).Get() );
2420 // In AM playing will FAIL if
2421 // the user plays before the media is loaded
2422 m_pTimer
= new wxAMLoadTimer(this);
2423 m_pTimer
->Start(20);
2428 //---------------------------------------------------------------------------
2429 // wxAMMediaBackend::FinishLoad
2431 // Called by our wxAMLoadTimer when the
2432 // embedded WMP tells its the media is ready to play.
2434 // Here we get the original size of the video and
2435 // send the loaded event to our watcher :).
2436 //---------------------------------------------------------------------------
2437 void wxAMMediaBackend::FinishLoad()
2439 // Get the original video size
2440 GetAM()->get_ImageSourceWidth((long*)&m_bestSize
.x
);
2441 GetAM()->get_ImageSourceHeight((long*)&m_bestSize
.y
);
2443 // Start the play timer to catch stop events
2444 // Previous load timer cleans up itself
2445 m_pTimer
= new wxAMPlayTimer(this);
2447 NotifyMovieLoaded();
2450 //---------------------------------------------------------------------------
2451 // wxAMMediaBackend::ShowPlayerControls
2452 //---------------------------------------------------------------------------
2453 bool wxAMMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags
)
2455 // Note that IMediaPlayer doesn't have a statusbar by
2456 // default but IActiveMovie does - so lets try to keep
2457 // the interface consistant
2460 GetAM()->put_Enabled(VARIANT_FALSE
);
2461 GetAM()->put_ShowControls(VARIANT_FALSE
);
2463 GetMP()->put_ShowStatusBar(VARIANT_FALSE
);
2467 GetAM()->put_Enabled(VARIANT_TRUE
);
2468 GetAM()->put_ShowControls(VARIANT_TRUE
);
2470 GetAM()->put_ShowPositionControls(
2471 (flags
& wxMEDIACTRLPLAYERCONTROLS_STEP
) ?
2472 VARIANT_TRUE
: VARIANT_FALSE
);
2476 GetMP()->put_ShowStatusBar(VARIANT_TRUE
);
2477 GetMP()->put_ShowAudioControls(
2478 (flags
& wxMEDIACTRLPLAYERCONTROLS_VOLUME
) ?
2479 VARIANT_TRUE
: VARIANT_FALSE
);
2486 //---------------------------------------------------------------------------
2487 // wxAMMediaBackend::Play
2489 // Plays the stream. If it is non-seekable, it will restart it (implicit).
2491 // Note that we use SUCCEEDED here because run/pause/stop tend to be overly
2492 // picky and return warnings on pretty much every call
2493 //---------------------------------------------------------------------------
2494 bool wxAMMediaBackend::Play()
2496 // Actually try to play the movie, even though it may not be loaded yet.
2498 HRESULT hr
= m_pWMP
->Play();
2500 HRESULT hr
= GetAM()->Run();
2504 m_pTimer
->Start(20);
2513 //---------------------------------------------------------------------------
2514 // wxAMMediaBackend::Pause
2516 // Pauses the stream.
2517 //---------------------------------------------------------------------------
2518 bool wxAMMediaBackend::Pause()
2520 HRESULT hr
= GetAM()->Pause();
2529 //---------------------------------------------------------------------------
2530 // wxAMMediaBackend::Stop
2532 // Stops the stream.
2533 //---------------------------------------------------------------------------
2534 bool wxAMMediaBackend::Stop()
2536 HRESULT hr
= GetAM()->Stop();
2539 // Seek to beginning
2540 wxAMMediaBackend::SetPosition(0);
2542 // Stop stop event timer
2552 //---------------------------------------------------------------------------
2553 // wxAMMediaBackend::SetPosition
2555 // 1) Translates the current position's time to directshow time,
2556 // which is in a scale of 1 second (in a double)
2557 // 2) Sets the play position of the IMediaSeeking interface -
2558 // passing NULL as the stop position means to keep the old
2560 //---------------------------------------------------------------------------
2561 bool wxAMMediaBackend::SetPosition(wxLongLong where
)
2563 HRESULT hr
= GetAM()->put_CurrentPosition(
2564 ((LONGLONG
)where
.GetValue()) / 1000.0 );
2574 //---------------------------------------------------------------------------
2575 // wxAMMediaBackend::GetPosition
2577 // 1) Obtains the current play and stop positions from IMediaSeeking
2578 // 2) Returns the play position translated to our time base
2579 //---------------------------------------------------------------------------
2580 wxLongLong
wxAMMediaBackend::GetPosition()
2583 HRESULT hr
= GetAM()->get_CurrentPosition(&outCur
);
2590 // h,m,s,milli - outdur is in 1 second (double)
2598 //---------------------------------------------------------------------------
2599 // wxAMMediaBackend::GetVolume
2601 // Gets the volume through the IBasicAudio interface -
2602 // value ranges from 0 (MAX volume) to -10000 (minimum volume).
2603 // -100 per decibel.
2604 //---------------------------------------------------------------------------
2605 double wxAMMediaBackend::GetVolume()
2608 HRESULT hr
= GetAM()->get_Volume(&lVolume
);
2615 return pow(10.0, lVolume
/ 2000.0);
2618 //---------------------------------------------------------------------------
2619 // wxAMMediaBackend::SetVolume
2621 // Sets the volume through the IBasicAudio interface -
2622 // value ranges from 0 (MAX volume) to -10000 (minimum volume).
2623 // -100 per decibel.
2624 //---------------------------------------------------------------------------
2625 bool wxAMMediaBackend::SetVolume(double dVolume
)
2627 // pow(10.0, -80.0) to correct 0 == -INF
2628 long lVolume
= (long)(2000.0 * log10( pow( 10.0, -80.0) + dVolume
) );
2629 HRESULT hr
= GetAM()->put_Volume( lVolume
);
2639 //---------------------------------------------------------------------------
2640 // wxAMMediaBackend::GetDuration
2642 // 1) Obtains the duration of the media from IAMMultiMediaStream
2643 // 2) Converts that value to our time base, and returns it
2645 // NB: With VBR MP3 files the default DirectShow MP3 render does not
2646 // read the Xing header correctly, resulting in skewed values for duration
2648 //---------------------------------------------------------------------------
2649 wxLongLong
wxAMMediaBackend::GetDuration()
2652 HRESULT hr
= GetAM()->get_Duration(&outDuration
);
2659 // h,m,s,milli - outdur is in 1 second (double)
2660 outDuration
*= 1000;
2662 ll
.Assign(outDuration
);
2667 //---------------------------------------------------------------------------
2668 // wxAMMediaBackend::GetState
2670 // Returns the cached state
2671 //---------------------------------------------------------------------------
2672 wxMediaState
wxAMMediaBackend::GetState()
2674 StateConstants nState
;
2676 HRESULT hr
= m_pWMP
->get_PlayState((long*)&nState
);
2678 HRESULT hr
= GetAM()->get_CurrentState(&nState
);
2683 return wxMEDIASTATE_STOPPED
;
2686 return (wxMediaState
)nState
;
2689 //---------------------------------------------------------------------------
2690 // wxAMMediaBackend::GetPlaybackRate
2692 // Pretty simple way of obtaining the playback rate from
2693 // the IMediaSeeking interface
2694 //---------------------------------------------------------------------------
2695 double wxAMMediaBackend::GetPlaybackRate()
2698 HRESULT hr
= GetAM()->get_Rate(&dRate
);
2708 //---------------------------------------------------------------------------
2709 // wxAMMediaBackend::SetPlaybackRate
2711 // Sets the playback rate of the media - DirectShow is pretty good
2712 // about this, actually
2713 //---------------------------------------------------------------------------
2714 bool wxAMMediaBackend::SetPlaybackRate(double dRate
)
2716 HRESULT hr
= GetAM()->put_Rate(dRate
);
2726 //---------------------------------------------------------------------------
2727 // wxAMMediaBackend::GetDownloadXXX
2729 // Queries for and gets the total size of the file and the current
2730 // progress in downloading that file from the IAMOpenProgress
2731 // interface from the media player interface's filter graph
2732 //---------------------------------------------------------------------------
2733 void wxAMMediaBackend::DoGetDownloadProgress(wxLongLong
* pLoadProgress
,
2734 wxLongLong
* pLoadTotal
)
2737 LONGLONG loadTotal
= 0, loadProgress
= 0;
2739 IAMOpenProgress
* pOP
;
2741 hr
= GetAM()->get_FilterGraph(&pFG
);
2744 hr
= pFG
->QueryInterface(IID_IAMOpenProgress
, (void**)&pOP
);
2747 hr
= pOP
->QueryProgress(&loadTotal
, &loadProgress
);
2756 *pLoadProgress
= loadProgress
;
2757 *pLoadTotal
= loadTotal
;
2762 // When not loading from a URL QueryProgress will return
2763 // E_NOINTERFACE or whatever
2770 //---------------------------------------------------------------------------
2771 // wxAMMediaBackend::GetVideoSize
2773 // Obtains the cached original video size
2774 //---------------------------------------------------------------------------
2775 wxSize
wxAMMediaBackend::GetVideoSize() const
2780 //---------------------------------------------------------------------------
2781 // wxAMMediaBackend::Move
2783 // We take care of this in our redrawing
2784 //---------------------------------------------------------------------------
2785 void wxAMMediaBackend::Move(int WXUNUSED(x
), int WXUNUSED(y
),
2786 int WXUNUSED(w
), int WXUNUSED(h
))
2790 //---------------------------------------------------------------------------
2791 // End of wxAMMediaBackend
2792 //---------------------------------------------------------------------------
2794 //---------------------------------------------------------------------------
2795 // wxMCIMediaBackend
2796 //---------------------------------------------------------------------------
2799 IMPLEMENT_DYNAMIC_CLASS(wxMCIMediaBackend
, wxMediaBackend
)
2801 //---------------------------------------------------------------------------
2802 // Usual debugging macros for MCI returns
2803 //---------------------------------------------------------------------------
2806 #define wxMCIVERIFY(arg) \
2809 if ( (nRet = (arg)) != 0) \
2812 mciGetErrorString(nRet, sz, 5000); \
2813 wxFAIL_MSG(wxString::Format(_T("MCI Error:%s"), sz)); \
2817 #define wxMCIVERIFY(arg) (arg);
2820 //---------------------------------------------------------------------------
2821 // Simulation for <digitalv.h>
2823 // Mingw and possibly other compilers don't have the digitalv.h header
2824 // that is needed to have some essential features of mci work with
2825 // windows - so we provide the declarations for the types we use here
2826 //---------------------------------------------------------------------------
2830 DWORD_PTR dwCallback
;
2831 #ifdef MCI_USE_OFFEXT
2842 DWORD_PTR dwCallback
;
2853 MCI_DGV_WINDOW_PARMS
;
2857 DWORD_PTR dwCallback
;
2867 DWORD_PTR dwCallback
;
2871 wxChar
* lpstrAlgorithm
;
2872 wxChar
* lpstrQuality
;
2874 MCI_DGV_SETAUDIO_PARMS
;
2876 //---------------------------------------------------------------------------
2877 // wxMCIMediaBackend Constructor
2879 // Here we don't need to do much except say we don't have any video :)
2880 //---------------------------------------------------------------------------
2881 wxMCIMediaBackend::wxMCIMediaBackend() : m_hNotifyWnd(NULL
), m_bVideo(false)
2885 //---------------------------------------------------------------------------
2886 // wxMCIMediaBackend Destructor
2888 // We close the MCI device - note that there may not be an MCI device here,
2889 // or it may fail - but we don't really care, since we're destructing
2890 //---------------------------------------------------------------------------
2891 wxMCIMediaBackend::~wxMCIMediaBackend()
2895 mciSendCommand(m_hDev
, MCI_CLOSE
, 0, 0);
2896 DestroyWindow(m_hNotifyWnd
);
2897 m_hNotifyWnd
= NULL
;
2901 //---------------------------------------------------------------------------
2902 // wxMCIMediaBackend::Create
2904 // Here we just tell wxMediaCtrl that MCI does exist (which it does, on all
2905 // msw systems, at least in some form dating back to win16 days)
2906 //---------------------------------------------------------------------------
2907 bool wxMCIMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
2912 const wxValidator
& validator
,
2913 const wxString
& name
)
2916 // By default wxWindow(s) is created with a border -
2917 // so we need to get rid of those, and create with
2918 // wxCLIP_CHILDREN, so that if the driver/backend
2919 // is a child window, it refereshes properly
2920 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
2921 (style
& ~wxBORDER_MASK
) | wxBORDER_NONE
| wxCLIP_CHILDREN
,
2925 m_ctrl
= wxStaticCast(ctrl
, wxMediaCtrl
);
2930 //---------------------------------------------------------------------------
2931 // wxMCIMediaBackend::Load (file version)
2933 // Here we have MCI load a file and device, set the time format to our
2934 // default (milliseconds), and set the video (if any) to play in the control
2935 //---------------------------------------------------------------------------
2936 bool wxMCIMediaBackend::Load(const wxString
& fileName
)
2938 // if the user already called load close the previous MCI device
2941 mciSendCommand(m_hDev
, MCI_CLOSE
, 0, 0);
2942 DestroyWindow(m_hNotifyWnd
);
2943 m_hNotifyWnd
= NULL
;
2946 // Opens a file and has MCI select a device. Normally you'd put
2947 // MCI_OPEN_TYPE in addition to MCI_OPEN_ELEMENT - however if you
2948 // omit this it tells MCI to select the device instead. This is good
2949 // because we have no reliable way of "enumerating" the devices in MCI
2950 MCI_OPEN_PARMS openParms
;
2951 openParms
.lpstrElementName
= (wxChar
*) fileName
.c_str();
2953 if (mciSendCommand(0, MCI_OPEN
, MCI_OPEN_ELEMENT
,
2954 (DWORD
)(LPVOID
)&openParms
) != 0)
2959 m_hDev
= openParms
.wDeviceID
;
2961 // set the time format for the device to milliseconds
2962 MCI_SET_PARMS setParms
;
2963 setParms
.dwCallback
= 0;
2964 setParms
.dwTimeFormat
= MCI_FORMAT_MILLISECONDS
;
2966 if (mciSendCommand(m_hDev
, MCI_SET
, MCI_SET_TIME_FORMAT
,
2967 (DWORD
)(LPVOID
)&setParms
) != 0)
2972 // tell the MCI device to display the video in our wxMediaCtrl
2973 MCI_DGV_WINDOW_PARMS windowParms
;
2974 windowParms
.hWnd
= (HWND
)m_ctrl
->GetHandle();
2976 m_bVideo
= (mciSendCommand(m_hDev
, MCI_WINDOW
,
2977 0x00010000L
, // MCI_DGV_WINDOW_HWND
2978 (DWORD
)(LPVOID
)&windowParms
) == 0);
2980 // Create a hidden window and register to handle MCI events
2981 // Note that wxCanvasClassName is already registered
2982 // and used by all wxWindows and normal wxControls
2983 m_hNotifyWnd
= ::CreateWindow(
2995 wxLogSysError( wxT("Could not create hidden needed for ")
2996 wxT("registering for MCI events!") );
3001 wxSetWindowProc(m_hNotifyWnd
, wxMCIMediaBackend::NotifyWndProc
);
3002 wxSetWindowUserData(m_hNotifyWnd
, this);
3004 NotifyMovieLoaded();
3009 //---------------------------------------------------------------------------
3010 // wxMCIMediaBackend::Load (URL version)
3012 // MCI doesn't support URLs directly (?)
3014 // TODO: Use wxURL/wxFileSystem and mmioInstallProc
3015 //---------------------------------------------------------------------------
3016 bool wxMCIMediaBackend::Load(const wxURI
& WXUNUSED(location
))
3021 //---------------------------------------------------------------------------
3022 // wxMCIMediaBackend::Play
3024 // Plays/Resumes the MCI device... a couple notes:
3025 // 1) Certain drivers will crash and burn if we don't pass them an
3026 // MCI_PLAY_PARMS, despite the documentation that says otherwise...
3027 // 2) There is a MCI_RESUME command, but MCI_PLAY does the same thing
3028 // and will resume from a stopped state also, so there's no need to
3029 // call both, for example
3030 //---------------------------------------------------------------------------
3031 bool wxMCIMediaBackend::Play()
3033 MCI_PLAY_PARMS playParms
;
3034 playParms
.dwCallback
= (DWORD
)m_hNotifyWnd
;
3036 bool bOK
= (mciSendCommand(m_hDev
, MCI_PLAY
, MCI_NOTIFY
,
3037 (DWORD
)(LPVOID
)&playParms
) == 0);
3040 m_ctrl
->Show(m_bVideo
);
3045 //---------------------------------------------------------------------------
3046 // wxMCIMediaBackend::Pause
3048 // Pauses the MCI device - nothing special
3049 //---------------------------------------------------------------------------
3050 bool wxMCIMediaBackend::Pause()
3052 return (mciSendCommand(m_hDev
, MCI_PAUSE
, MCI_WAIT
, 0) == 0);
3055 //---------------------------------------------------------------------------
3056 // wxMCIMediaBackend::Stop
3058 // Stops the MCI device & seeks to the beginning as wxMediaCtrl docs outline
3059 //---------------------------------------------------------------------------
3060 bool wxMCIMediaBackend::Stop()
3062 return (mciSendCommand(m_hDev
, MCI_STOP
, MCI_WAIT
, 0) == 0) &&
3063 (mciSendCommand(m_hDev
, MCI_SEEK
, MCI_SEEK_TO_START
, 0) == 0);
3066 //---------------------------------------------------------------------------
3067 // wxMCIMediaBackend::GetState
3069 // Here we get the state and convert it to a wxMediaState -
3070 // since we use direct comparisons with MCI_MODE_PLAY and
3071 // MCI_MODE_PAUSE, we don't care if the MCI_STATUS call
3073 //---------------------------------------------------------------------------
3074 wxMediaState
wxMCIMediaBackend::GetState()
3076 MCI_STATUS_PARMS statusParms
;
3077 statusParms
.dwItem
= MCI_STATUS_MODE
;
3079 mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3080 (DWORD
)(LPVOID
)&statusParms
);
3082 if (statusParms
.dwReturn
== MCI_MODE_PAUSE
)
3083 return wxMEDIASTATE_PAUSED
;
3084 else if (statusParms
.dwReturn
== MCI_MODE_PLAY
)
3085 return wxMEDIASTATE_PLAYING
;
3087 return wxMEDIASTATE_STOPPED
;
3090 //---------------------------------------------------------------------------
3091 // wxMCIMediaBackend::SetPosition
3093 // Here we set the position of the device in the stream.
3094 // Note that MCI actually stops the device after you seek it if the
3095 // device is playing/paused, so we need to play the file after
3096 // MCI seeks like normal APIs would
3097 //---------------------------------------------------------------------------
3098 bool wxMCIMediaBackend::SetPosition(wxLongLong where
)
3100 MCI_SEEK_PARMS seekParms
;
3101 seekParms
.dwCallback
= 0;
3103 #if wxUSE_LONGLONG_NATIVE && !wxUSE_LONGLONG_WX
3104 seekParms
.dwTo
= (DWORD
)where
.GetValue();
3105 #else // wxUSE_LONGLONG_WX
3106 // no way to return it in one piece
3107 wxASSERT( where
.GetHi() == 0 );
3108 seekParms
.dwTo
= (DWORD
)where
.GetLo();
3111 // device was playing?
3112 bool bReplay
= GetState() == wxMEDIASTATE_PLAYING
;
3114 if ( mciSendCommand(m_hDev
, MCI_SEEK
, MCI_TO
,
3115 (DWORD
)(LPVOID
)&seekParms
) != 0)
3120 // If the device was playing, resume it
3127 //---------------------------------------------------------------------------
3128 // wxMCIMediaBackend::GetPosition
3130 // Gets the position of the device in the stream using the current
3131 // time format... nothing special here...
3132 //---------------------------------------------------------------------------
3133 wxLongLong
wxMCIMediaBackend::GetPosition()
3135 MCI_STATUS_PARMS statusParms
;
3136 statusParms
.dwItem
= MCI_STATUS_POSITION
;
3138 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3139 (DWORD
)(LPSTR
)&statusParms
) != 0)
3144 return statusParms
.dwReturn
;
3147 //---------------------------------------------------------------------------
3148 // wxMCIMediaBackend::GetVolume
3150 // Gets the volume of the current media via the MCI_DGV_STATUS_VOLUME
3151 // message. Value ranges from 0 (minimum) to 1000 (maximum volume).
3152 //---------------------------------------------------------------------------
3153 double wxMCIMediaBackend::GetVolume()
3155 MCI_STATUS_PARMS statusParms
;
3156 statusParms
.dwCallback
= 0;
3157 statusParms
.dwItem
= 0x4019; // MCI_DGV_STATUS_VOLUME
3159 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3160 (DWORD
)(LPSTR
)&statusParms
) != 0)
3165 return ((double)statusParms
.dwReturn
) / 1000.0;
3168 //---------------------------------------------------------------------------
3169 // wxMCIMediaBackend::SetVolume
3171 // Sets the volume of the current media via the MCI_DGV_SETAUDIO_VOLUME
3172 // message. Value ranges from 0 (minimum) to 1000 (maximum volume).
3173 //---------------------------------------------------------------------------
3174 bool wxMCIMediaBackend::SetVolume(double dVolume
)
3176 MCI_DGV_SETAUDIO_PARMS audioParms
;
3177 audioParms
.dwCallback
= 0;
3178 audioParms
.dwItem
= 0x4002; // MCI_DGV_SETAUDIO_VOLUME
3179 audioParms
.dwValue
= (DWORD
) (dVolume
* 1000.0);
3180 audioParms
.dwOver
= 0;
3181 audioParms
.lpstrAlgorithm
= NULL
;
3182 audioParms
.lpstrQuality
= NULL
;
3184 if (mciSendCommand(m_hDev
, 0x0873, // MCI_SETAUDIO
3185 // MCI_DGV_SETAUDIO + (_ITEM | _VALUE)
3186 0x00800000L
| 0x01000000L
,
3187 (DWORD
)(LPSTR
)&audioParms
) != 0)
3195 //---------------------------------------------------------------------------
3196 // wxMCIMediaBackend::GetDuration
3198 // Gets the duration of the stream... nothing special
3199 //---------------------------------------------------------------------------
3200 wxLongLong
wxMCIMediaBackend::GetDuration()
3202 MCI_STATUS_PARMS statusParms
;
3203 statusParms
.dwItem
= MCI_STATUS_LENGTH
;
3205 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
3206 (DWORD
)(LPSTR
)&statusParms
) != 0)
3211 return statusParms
.dwReturn
;
3214 //---------------------------------------------------------------------------
3215 // wxMCIMediaBackend::Move
3217 // Moves the window to a location
3218 //---------------------------------------------------------------------------
3219 void wxMCIMediaBackend::Move(int WXUNUSED(x
), int WXUNUSED(y
), int w
, int h
)
3221 if (m_hNotifyWnd
&& m_bVideo
)
3223 MCI_DGV_RECT_PARMS putParms
; // ifdefed MCI_DGV_PUT_PARMS
3224 memset(&putParms
, 0, sizeof(MCI_DGV_RECT_PARMS
));
3225 putParms
.rc
.bottom
= h
;
3226 putParms
.rc
.right
= w
;
3228 // wxStackWalker will crash and burn here on assert
3229 // and MCI doesn't like 0 and 0 for some reason (out of range)
3230 // so just don't it in that case
3233 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_PUT
,
3234 0x00040000L
, // MCI_DGV_PUT_DESTINATION
3235 (DWORD
)(LPSTR
)&putParms
) );
3240 //---------------------------------------------------------------------------
3241 // wxMCIMediaBackend::GetVideoSize
3243 // Gets the original size of the movie for sizers
3244 //---------------------------------------------------------------------------
3245 wxSize
wxMCIMediaBackend::GetVideoSize() const
3249 MCI_DGV_RECT_PARMS whereParms
; // ifdefed MCI_DGV_WHERE_PARMS
3251 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_WHERE
,
3252 0x00020000L
, // MCI_DGV_WHERE_SOURCE
3253 (DWORD
)(LPSTR
)&whereParms
) );
3255 return wxSize(whereParms
.rc
.right
, whereParms
.rc
.bottom
);
3258 return wxSize(0, 0);
3261 //---------------------------------------------------------------------------
3262 // wxMCIMediaBackend::GetPlaybackRate
3265 //---------------------------------------------------------------------------
3266 double wxMCIMediaBackend::GetPlaybackRate()
3271 //---------------------------------------------------------------------------
3272 // wxMCIMediaBackend::SetPlaybackRate
3275 //---------------------------------------------------------------------------
3276 bool wxMCIMediaBackend::SetPlaybackRate(double WXUNUSED(dRate
))
3279 MCI_WAVE_SET_SAMPLESPERSEC
3280 MCI_DGV_SET_PARMS setParms
;
3281 setParms
.dwSpeed
= (DWORD
) (dRate
* 1000.0);
3283 return (mciSendCommand(m_hDev
, MCI_SET
,
3284 0x00020000L
, // MCI_DGV_SET_SPEED
3285 (DWORD
)(LPSTR
)&setParms
) == 0);
3291 //---------------------------------------------------------------------------
3292 // [static] wxMCIMediaBackend::MSWWindowProc
3294 // Here we process a message when MCI reaches the stopping point
3296 //---------------------------------------------------------------------------
3297 LRESULT CALLBACK
wxMCIMediaBackend::NotifyWndProc(HWND hWnd
, UINT nMsg
,
3301 wxMCIMediaBackend
* backend
=
3302 (wxMCIMediaBackend
*)wxGetWindowUserData(hWnd
);
3304 return backend
->OnNotifyWndProc(hWnd
, nMsg
, wParam
, lParam
);
3307 LRESULT CALLBACK
wxMCIMediaBackend::OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
3311 if (nMsg
== MM_MCINOTIFY
)
3313 wxASSERT(lParam
== (LPARAM
) m_hDev
);
3314 if (wParam
== MCI_NOTIFY_SUCCESSFUL
&& lParam
== (LPARAM
)m_hDev
)
3316 if ( SendStopEvent() )
3318 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_SEEK
, MCI_SEEK_TO_START
, 0) );
3323 return DefWindowProc(hWnd
, nMsg
, wParam
, lParam
);
3325 #endif // __WXWINCE__
3327 //---------------------------------------------------------------------------
3330 // TODO: Use a less kludgy way to pause/get state/set state
3331 // FIXME: Greg Hazel reports that sometimes files that cannot be played
3332 // with this backend are treated as playable anyway - not verified though.
3333 //---------------------------------------------------------------------------
3335 IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend
, wxMediaBackend
)
3337 // Time between timer calls - this is the Apple recommendation to the TCL
3339 #define MOVIE_DELAY 20
3341 #include "wx/timer.h"
3344 //---------------------------------------------------------------------------
3347 // QT, esp. QT for Windows is very picky about how you go about
3348 // async loading. If you were to go through a Windows message loop
3349 // or a MoviesTask or both and then check the movie load state
3350 // it would still return 1000 (loading)... even (pre)prerolling doesn't
3351 // help. However, making a load timer like this works
3352 //---------------------------------------------------------------------------
3353 class wxQTLoadTimer
: public wxTimer
3356 wxQTLoadTimer(Movie movie
, wxQTMediaBackend
* parent
, wxQuickTimeLibrary
* pLib
) :
3357 m_movie(movie
), m_parent(parent
), m_pLib(pLib
) {}
3361 m_pLib
->MoviesTask(m_movie
, 0);
3362 // kMovieLoadStatePlayable
3363 if (m_pLib
->GetMovieLoadState(m_movie
) >= 10000)
3365 m_parent
->FinishLoad();
3371 Movie m_movie
; //Our movie instance
3372 wxQTMediaBackend
* m_parent
; //Backend pointer
3373 wxQuickTimeLibrary
* m_pLib
; //Interfaces
3377 // --------------------------------------------------------------------------
3378 // wxQTPlayTimer - Handle Asyncronous Playing
3380 // 1) Checks to see if the movie is done, and if not continues
3381 // streaming the movie
3382 // 2) Sends the wxEVT_MEDIA_STOP event if we have reached the end of
3384 // --------------------------------------------------------------------------
3385 class wxQTPlayTimer
: public wxTimer
3388 wxQTPlayTimer(Movie movie
, wxQTMediaBackend
* parent
,
3389 wxQuickTimeLibrary
* pLib
) :
3390 m_movie(movie
), m_parent(parent
), m_pLib(pLib
) {}
3395 // OK, a little explaining - basically originally
3396 // we only called MoviesTask if the movie was actually
3397 // playing (not paused or stopped)... this was before
3398 // we realized MoviesTask actually handles repainting
3399 // of the current frame - so if you were to resize
3400 // or something it would previously not redraw that
3401 // portion of the movie.
3403 // So now we call MoviesTask always so that it repaints
3406 m_pLib
->MoviesTask(m_movie
, 0);
3409 // Handle the stop event - if the movie has reached
3410 // the end, notify our handler
3412 // m_bPlaying == !(Stopped | Paused)
3414 if (m_parent
->m_bPlaying
)
3416 if (m_pLib
->IsMovieDone(m_movie
))
3418 if ( m_parent
->SendStopEvent() )
3421 wxASSERT(m_pLib
->GetMoviesError() == noErr
);
3423 m_parent
->QueueFinishEvent();
3430 Movie m_movie
; // Our movie instance
3431 wxQTMediaBackend
* m_parent
; //Backend pointer
3432 wxQuickTimeLibrary
* m_pLib
; //Interfaces
3436 //---------------------------------------------------------------------------
3437 // wxQTMediaBackend::QTWndProc
3439 // Forwards events to the Movie Controller so that it can
3440 // redraw itself/process messages etc..
3441 //---------------------------------------------------------------------------
3442 LRESULT CALLBACK
wxQTMediaBackend::QTWndProc(HWND hWnd
, UINT nMsg
,
3443 WPARAM wParam
, LPARAM lParam
)
3445 wxQTMediaBackend
* pThis
= (wxQTMediaBackend
*)wxGetWindowUserData(hWnd
);
3450 msg
.wParam
= wParam
;
3451 msg
.lParam
= lParam
;
3455 EventRecord theEvent
;
3456 pThis
->m_lib
.NativeEventToMacEvent(&msg
, &theEvent
);
3457 pThis
->m_lib
.MCIsPlayerEvent(pThis
->m_pMC
, &theEvent
);
3459 return pThis
->m_ctrl
->MSWWindowProc(nMsg
, wParam
, lParam
);
3462 //---------------------------------------------------------------------------
3463 // wxQTMediaBackend Destructor
3465 // Sets m_timer to NULL signifying we havn't loaded anything yet
3466 //---------------------------------------------------------------------------
3467 wxQTMediaBackend::wxQTMediaBackend()
3468 : m_movie(NULL
), m_bPlaying(false), m_timer(NULL
), m_pMC(NULL
)
3472 //---------------------------------------------------------------------------
3473 // wxQTMediaBackend Destructor
3475 // 1) Cleans up the QuickTime movie instance
3476 // 2) Decrements the QuickTime reference counter - if this reaches
3477 // 0, QuickTime shuts down
3478 // 3) Decrements the QuickTime Windows Media Layer reference counter -
3479 // if this reaches 0, QuickTime shuts down the Windows Media Layer
3480 //---------------------------------------------------------------------------
3481 wxQTMediaBackend::~wxQTMediaBackend()
3490 m_lib
.DisposeMovieController(m_pMC
);
3494 // destroy wxQTMediaEvtHandler we pushed on it
3495 m_ctrl
->PopEventHandler(true);
3497 m_lib
.DestroyPortAssociation(
3498 (CGrafPtr
)m_lib
.GetNativeWindowPort(m_ctrl
->GetHWND()));
3500 //Note that ExitMovies() is not necessary, but
3501 //the docs are fuzzy on whether or not TerminateQTML is
3503 m_lib
.TerminateQTML();
3507 //---------------------------------------------------------------------------
3508 // wxQTMediaBackend::CreateControl
3510 // 1) Intializes QuickTime
3511 // 2) Creates the control window
3512 //---------------------------------------------------------------------------
3513 bool wxQTMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
3518 const wxValidator
& validator
,
3519 const wxString
& name
)
3521 if (!m_lib
.Initialize())
3524 int nError
= m_lib
.InitializeQTML(0);
3525 if (nError
!= noErr
) //-2093 no dll
3527 wxFAIL_MSG(wxString::Format(wxT("Couldn't Initialize Quicktime-%i"), nError
));
3531 m_lib
.EnterMovies();
3534 // By default wxWindow(s) is created with a border -
3535 // so we need to get rid of those
3537 // Since we don't have a child window like most other
3538 // backends, we don't need wxCLIP_CHILDREN
3539 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
3540 (style
& ~wxBORDER_MASK
) | wxBORDER_NONE
,
3546 m_ctrl
= wxStaticCast(ctrl
, wxMediaCtrl
);
3548 // Create a port association for our window so we
3549 // can use it as a WindowRef
3550 m_lib
.CreatePortAssociation(m_ctrl
->GetHWND(), NULL
, 0L);
3552 // Part of a suggestion from Greg Hazel
3553 // to repaint movie when idle
3554 m_ctrl
->PushEventHandler(new wxQTMediaEvtHandler(this, m_ctrl
->GetHWND()));
3560 //---------------------------------------------------------------------------
3561 // wxQTMediaBackend::Load (file version)
3563 // 1) Get an FSSpec from the Windows path name
3564 // 2) Open the movie
3565 // 3) Obtain the movie instance from the movie resource
3566 // 4) Close the movie resource
3567 // 5) Finish loading
3568 //---------------------------------------------------------------------------
3569 bool wxQTMediaBackend::Load(const wxString
& fileName
)
3576 short movieResFile
= 0; //= 0 because of annoying VC6 warning
3579 err
= m_lib
.NativePathNameToFSSpec(
3580 (char*) (const char*) fileName
.mb_str(),
3582 result
= (err
== noErr
);
3586 err
= m_lib
.OpenMovieFile(&sfFile
, &movieResFile
, fsRdPerm
);
3587 result
= (err
== noErr
);
3592 short movieResID
= 0;
3595 err
= m_lib
.NewMovieFromFile(
3601 NULL
); // wasChanged
3602 result
= (err
== noErr
&& m_lib
.GetMoviesStickyError() == noErr
);
3604 // check m_lib.GetMoviesStickyError() because it may not find the
3605 // proper codec and play black video and other strange effects,
3606 // not to mention mess up the dynamic backend loading scheme
3607 // of wxMediaCtrl - so it just does what the QuickTime player does
3610 m_lib
.CloseMovieFile(movieResFile
);
3618 //---------------------------------------------------------------------------
3619 // wxQTMediaBackend::PPRMProc (static)
3621 // Called when done PrePrerolling the movie.
3622 // Note that in 99% of the cases this does nothing...
3623 // Anyway we set up the loading timer here to tell us when the movie is done
3624 //---------------------------------------------------------------------------
3625 void wxQTMediaBackend::PPRMProc (Movie theMovie
,
3626 OSErr
WXUNUSED_UNLESS_DEBUG(theErr
),
3629 wxASSERT( theMovie
);
3630 wxASSERT( theRefCon
);
3631 wxASSERT( theErr
== noErr
);
3633 wxQTMediaBackend
* pBE
= (wxQTMediaBackend
*) theRefCon
;
3635 long lTime
= pBE
->m_lib
.GetMovieTime(theMovie
,NULL
);
3636 Fixed rate
= pBE
->m_lib
.GetMoviePreferredRate(theMovie
);
3637 pBE
->m_lib
.PrerollMovie(theMovie
, lTime
, rate
);
3638 pBE
->m_timer
= new wxQTLoadTimer(pBE
->m_movie
, pBE
, &pBE
->m_lib
);
3639 pBE
->m_timer
->Start(MOVIE_DELAY
);
3642 //---------------------------------------------------------------------------
3643 // wxQTMediaBackend::Load (URL Version)
3645 // 1) Build an escaped URI from location
3646 // 2) Create a handle to store the URI string
3647 // 3) Put the URI string inside the handle
3648 // 4) Make a QuickTime URL data ref from the handle with the URI in it
3649 // 5) Clean up the URI string handle
3650 // 6) Do some prerolling
3651 // 7) Finish Loading
3652 //---------------------------------------------------------------------------
3653 bool wxQTMediaBackend::Load(const wxURI
& location
)
3658 wxString theURI
= location
.BuildURI();
3660 Handle theHandle
= m_lib
.NewHandleClear(theURI
.length() + 1);
3661 wxASSERT(theHandle
);
3663 m_lib
.BlockMove(theURI
.mb_str(), *theHandle
, theURI
.length() + 1);
3665 // create the movie from the handle that refers to the URI
3666 OSErr err
= m_lib
.NewMovieFromDataRef(&m_movie
, newMovieActive
|
3668 /* | newMovieIdleImportOK */,
3670 URLDataHandlerSubType
);
3672 m_lib
.DisposeHandle(theHandle
);
3679 timeNow
= m_lib
.GetMovieTime(m_movie
, NULL
);
3680 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3682 playRate
= m_lib
.GetMoviePreferredRate(m_movie
);
3683 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3685 // Note that the callback here is optional,
3686 // but without it PrePrerollMovie can be buggy
3687 // (see Apple ml). Also, some may wonder
3688 // why we need this at all - this is because
3689 // Apple docs say QuickTime streamed movies
3690 // require it if you don't use a Movie Controller,
3691 // which we don't by default.
3693 m_lib
.PrePrerollMovie(m_movie
, timeNow
, playRate
,
3694 (WXFARPROC
)wxQTMediaBackend::PPRMProc
,
3703 //---------------------------------------------------------------------------
3704 // wxQTMediaBackend::FinishLoad
3706 // 1) Create the movie timer
3707 // 2) Get real size of movie for GetBestSize/sizers
3708 // 3) Set the movie time scale to something usable so that seeking
3709 // etc. will work correctly
3710 // 4) Set our Movie Controller to display the movie if it exists,
3711 // otherwise set the bounds of the Movie
3712 // 5) Refresh parent window
3713 //---------------------------------------------------------------------------
3714 void wxQTMediaBackend::FinishLoad()
3716 // Create the playing/streaming timer
3717 m_timer
= new wxQTPlayTimer(m_movie
, (wxQTMediaBackend
*) this, &m_lib
);
3720 m_timer
->Start(MOVIE_DELAY
, wxTIMER_CONTINUOUS
);
3722 // get the real size of the movie
3724 memset(&outRect
, 0, sizeof(Rect
)); // suppress annoying VC6 warning
3725 m_lib
.GetMovieNaturalBoundsRect (m_movie
, &outRect
);
3726 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3728 m_bestSize
.x
= outRect
.right
- outRect
.left
;
3729 m_bestSize
.y
= outRect
.bottom
- outRect
.top
;
3731 // Handle the movie GWorld
3735 thePoint
.h
= thePoint
.v
= 0;
3736 m_lib
.MCSetMovie(m_pMC
, m_movie
,
3737 m_lib
.GetNativeWindowPort(m_ctrl
->GetHandle()),
3739 m_lib
.MCSetVisible(m_pMC
, true);
3744 m_lib
.SetMovieGWorld(m_movie
,
3745 (CGrafPtr
) m_lib
.GetNativeWindowPort(m_ctrl
->GetHWND()),
3749 // Set the movie to millisecond precision
3750 m_lib
.SetMovieTimeScale(m_movie
, 1000);
3751 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3753 NotifyMovieLoaded();
3756 //---------------------------------------------------------------------------
3757 // wxQTMediaBackend::Play
3759 // 1) Start the QT movie
3760 // 2) Start the movie loading timer
3762 // NOTE: This will still return success even when
3763 // the movie is still loading, and as mentioned in wxQTLoadTimer
3764 // I don't know of a way to force this to be sync - so if its
3765 // still loading the function will return true but the movie will
3766 // still be in the stopped state
3767 //---------------------------------------------------------------------------
3768 bool wxQTMediaBackend::Play()
3770 m_lib
.StartMovie(m_movie
);
3773 return m_lib
.GetMoviesError() == noErr
;
3776 //---------------------------------------------------------------------------
3777 // wxQTMediaBackend::Pause
3779 // 1) Stop the movie
3780 // 2) Stop the movie timer
3781 //---------------------------------------------------------------------------
3782 bool wxQTMediaBackend::Pause()
3785 m_lib
.StopMovie(m_movie
);
3787 return m_lib
.GetMoviesError() == noErr
;
3790 //---------------------------------------------------------------------------
3791 // wxQTMediaBackend::Stop
3793 // 1) Stop the movie
3794 // 2) Stop the movie timer
3795 // 3) Seek to the beginning of the movie
3796 //---------------------------------------------------------------------------
3797 bool wxQTMediaBackend::Stop()
3801 m_lib
.StopMovie(m_movie
);
3802 if (m_lib
.GetMoviesError() == noErr
)
3803 m_lib
.GoToBeginningOfMovie(m_movie
);
3805 return m_lib
.GetMoviesError() == noErr
;
3808 //---------------------------------------------------------------------------
3809 // wxQTMediaBackend::GetPlaybackRate
3811 // Get the movie playback rate from ::GetMovieRate
3812 //---------------------------------------------------------------------------
3813 double wxQTMediaBackend::GetPlaybackRate()
3815 return ( ((double)m_lib
.GetMovieRate(m_movie
)) / 0x10000);
3818 //---------------------------------------------------------------------------
3819 // wxQTMediaBackend::SetPlaybackRate
3821 // Convert dRate to Fixed and Set the movie rate through SetMovieRate
3822 //---------------------------------------------------------------------------
3823 bool wxQTMediaBackend::SetPlaybackRate(double dRate
)
3825 m_lib
.SetMovieRate(m_movie
, (Fixed
) (dRate
* 0x10000));
3827 return m_lib
.GetMoviesError() == noErr
;
3830 //---------------------------------------------------------------------------
3831 // wxQTMediaBackend::SetPosition
3833 // 1) Create a time record struct (TimeRecord) with appropriate values
3834 // 2) Pass struct to SetMovieTime
3835 //---------------------------------------------------------------------------
3836 bool wxQTMediaBackend::SetPosition(wxLongLong where
)
3838 // NB: For some reason SetMovieTime does not work
3839 // correctly with the Quicktime Windows SDK (6)
3840 // From Muskelkatermann at the wxForum
3841 // http://www.solidsteel.nl/users/wxwidgets/viewtopic.php?t=2957
3842 // RN - note that I have not verified this but there
3843 // is no harm in calling SetMovieTimeValue instead
3845 TimeRecord theTimeRecord
;
3846 memset(&theTimeRecord
, 0, sizeof(TimeRecord
));
3847 theTimeRecord
.value
.lo
= where
.GetLo();
3848 theTimeRecord
.scale
= m_lib
.GetMovieTimeScale(m_movie
);
3849 theTimeRecord
.base
= m_lib
.GetMovieTimeBase(m_movie
);
3850 m_lib
.SetMovieTime(m_movie
, &theTimeRecord
);
3852 m_lib
.SetMovieTimeValue(m_movie
, where
.GetLo());
3855 return (m_lib
.GetMoviesError() == noErr
);
3858 //---------------------------------------------------------------------------
3859 // wxQTMediaBackend::GetPosition
3861 // 1) Calls GetMovieTime to get the position we are in in the movie
3862 // in milliseconds (we called
3863 //---------------------------------------------------------------------------
3864 wxLongLong
wxQTMediaBackend::GetPosition()
3866 return m_lib
.GetMovieTime(m_movie
, NULL
);
3869 //---------------------------------------------------------------------------
3870 // wxQTMediaBackend::GetVolume
3872 // Gets the volume through GetMovieVolume - which returns a 16 bit short -
3874 // +--------+--------+
3876 // +--------+--------+
3878 // (1) first 8 bits are value before decimal
3879 // (2) second 8 bits are value after decimal
3881 // Volume ranges from -1.0 (gain but no sound), 0 (no sound and no gain) to
3882 // 1 (full gain and sound)
3883 //---------------------------------------------------------------------------
3884 double wxQTMediaBackend::GetVolume()
3886 short sVolume
= m_lib
.GetMovieVolume(m_movie
);
3887 wxASSERT(m_lib
.GetMoviesError() == noErr
);
3889 if (sVolume
& (128 << 8)) //negative - no sound
3892 return sVolume
/ 256.0;
3895 //---------------------------------------------------------------------------
3896 // wxQTMediaBackend::SetVolume
3898 // Sets the volume through SetMovieVolume - which takes a 16 bit short -
3900 // +--------+--------+
3902 // +--------+--------+
3904 // (1) first 8 bits are value before decimal
3905 // (2) second 8 bits are value after decimal
3907 // Volume ranges from -1.0 (gain but no sound), 0 (no sound and no gain) to
3908 // 1 (full gain and sound)
3909 //---------------------------------------------------------------------------
3910 bool wxQTMediaBackend::SetVolume(double dVolume
)
3912 m_lib
.SetMovieVolume(m_movie
, (short) (dVolume
* 256));
3913 return m_lib
.GetMoviesError() == noErr
;
3916 //---------------------------------------------------------------------------
3917 // wxQTMediaBackend::GetDuration
3919 // Calls GetMovieDuration
3920 //---------------------------------------------------------------------------
3921 wxLongLong
wxQTMediaBackend::GetDuration()
3923 return m_lib
.GetMovieDuration(m_movie
);
3926 //---------------------------------------------------------------------------
3927 // wxQTMediaBackend::GetState
3929 // Determines the current state:
3930 // if we are at the beginning, then we are stopped
3931 //---------------------------------------------------------------------------
3932 wxMediaState
wxQTMediaBackend::GetState()
3935 return wxMEDIASTATE_PLAYING
;
3936 else if ( !m_movie
|| wxQTMediaBackend::GetPosition() == 0 )
3937 return wxMEDIASTATE_STOPPED
;
3939 return wxMEDIASTATE_PAUSED
;
3942 //---------------------------------------------------------------------------
3943 // wxQTMediaBackend::Cleanup
3945 // Diposes of the movie timer, Disassociates the Movie Controller with
3946 // movie and hides it if it exists, and stops and disposes
3948 //---------------------------------------------------------------------------
3949 void wxQTMediaBackend::Cleanup()
3959 m_lib
.StopMovie(m_movie
);
3964 thePoint
.h
= thePoint
.v
= 0;
3965 m_lib
.MCSetVisible(m_pMC
, false);
3966 m_lib
.MCSetMovie(m_pMC
, NULL
, NULL
, thePoint
);
3969 m_lib
.DisposeMovie(m_movie
);
3973 //---------------------------------------------------------------------------
3974 // wxQTMediaBackend::ShowPlayerControls
3976 // Creates a movie controller for the Movie if the user wants it
3977 //---------------------------------------------------------------------------
3978 bool wxQTMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags
)
3982 // restore old wndproc
3983 wxSetWindowProc((HWND
)m_ctrl
->GetHWND(), wxWndProc
);
3984 m_lib
.DisposeMovieController(m_pMC
);
3987 // movie controller height
3991 if (flags
&& m_movie
)
3994 wxRect wxrect
= m_ctrl
->GetClientRect();
3996 // make room for controller
3997 if (wxrect
.width
< 320)
4000 rect
.top
= (short)wxrect
.y
;
4001 rect
.left
= (short)wxrect
.x
;
4002 rect
.right
= (short)(rect
.left
+ wxrect
.width
);
4003 rect
.bottom
= (short)(rect
.top
+ wxrect
.height
);
4007 m_pMC
= m_lib
.NewMovieController(m_movie
, &rect
, mcTopLeftMovie
|
4008 // mcScaleMovieToFit |
4011 m_lib
.MCDoAction(m_pMC
, 32, (void*)true); // mcActionSetKeysEnabled
4012 m_lib
.MCSetActionFilterWithRefCon(m_pMC
,
4013 (WXFARPROC
)wxQTMediaBackend::MCFilterProc
, (void*)this);
4014 m_bestSize
.y
+= 16; // movie controller height
4016 // By default the movie controller uses its own colour palette
4017 // for the movie which can be bad on some files, so turn it off.
4018 // Also turn off its frame / border for the movie
4019 // Also take care of a couple of the interface flags here
4021 m_lib
.MCDoAction(m_pMC
, 39/*mcActionGetFlags*/, (void*)&mcFlags
);
4024 // (1<< 0) /*mcFlagSuppressMovieFrame*/ |
4025 (1<< 3) /*mcFlagsUseWindowPalette*/
4026 | ((flags
& wxMEDIACTRLPLAYERCONTROLS_STEP
)
4027 ? 0 : (1<< 1) /*mcFlagSuppressStepButtons*/)
4028 | ((flags
& wxMEDIACTRLPLAYERCONTROLS_VOLUME
)
4029 ? 0 : (1<< 2) /*mcFlagSuppressSpeakerButton*/)
4030 // | (1<< 4) /*mcFlagDontInvalidate*/ // if we take care of repainting ourselves
4033 m_lib
.MCDoAction(m_pMC
, 38/*mcActionSetFlags*/, (void*)mcFlags
);
4035 // intercept the wndproc of our control window
4036 wxSetWindowProc((HWND
)m_ctrl
->GetHWND(), wxQTMediaBackend::QTWndProc
);
4038 // set the user data of our window
4039 wxSetWindowUserData((HWND
)m_ctrl
->GetHWND(), this);
4043 NotifyMovieSizeChanged();
4045 return m_lib
.GetMoviesError() == noErr
;
4048 //---------------------------------------------------------------------------
4049 // wxQTMediaBackend::MCFilterProc (static)
4051 // Callback for when the movie controller recieves a message
4052 //---------------------------------------------------------------------------
4053 Boolean
wxQTMediaBackend::MCFilterProc(MovieController
WXUNUSED(theController
),
4055 void * WXUNUSED(params
),
4058 // NB: potential optimisation
4062 wxQTMediaBackend
* pThis
= (wxQTMediaBackend
*)refCon
;
4067 // don't process idle events
4071 // play button triggered - MC will set movie to opposite state
4072 // of current - playing ? paused : playing
4074 pThis
->m_bPlaying
= !(pThis
->m_bPlaying
);
4076 // NB: Sometimes it doesn't redraw properly -
4077 // if you click on the button but don't move the mouse
4078 // the button will not change its state until you move
4079 // mcActionDraw and Refresh/Update combo do nothing
4080 // to help this unfortunately
4090 //---------------------------------------------------------------------------
4091 // wxQTMediaBackend::GetVideoSize
4093 // Returns the actual size of the QT movie
4094 //---------------------------------------------------------------------------
4095 wxSize
wxQTMediaBackend::GetVideoSize() const
4100 //---------------------------------------------------------------------------
4101 // wxQTMediaBackend::Move
4103 // Sets the bounds of either the Movie or Movie Controller
4104 //---------------------------------------------------------------------------
4105 void wxQTMediaBackend::Move(int WXUNUSED(x
), int WXUNUSED(y
), int w
, int h
)
4109 // make room for controller
4115 Rect theRect
= {0, 0, (short)h
, (short)w
};
4116 m_lib
.MCSetControllerBoundsRect(m_pMC
, &theRect
);
4120 Rect theRect
= {0, 0, (short)h
, (short)w
};
4121 m_lib
.SetMovieBox(m_movie
, &theRect
);
4124 wxASSERT(m_lib
.GetMoviesError() == noErr
);
4128 //---------------------------------------------------------------------------
4129 // wxQTMediaBackend::OnEraseBackground
4131 // Suggestion from Greg Hazel to repaint the movie when idle
4134 // TODO: We may be repainting too much here - under what exact circumstances
4135 // do we need this? I think Move also repaints correctly for the Movie
4136 // Controller, so in that instance we don't need this either
4137 //---------------------------------------------------------------------------
4138 void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent
& evt
)
4140 wxQuickTimeLibrary
& m_pLib
= m_qtb
->m_lib
;
4144 // repaint movie controller
4145 m_pLib
.MCDoAction(m_qtb
->m_pMC
, 2 /*mcActionDraw*/,
4146 m_pLib
.GetNativeWindowPort(m_hwnd
));
4148 else if ( m_qtb
->m_movie
)
4150 // no movie controller
4151 CGrafPtr port
= (CGrafPtr
)m_pLib
.GetNativeWindowPort(m_hwnd
);
4153 m_pLib
.BeginUpdate(port
);
4154 m_pLib
.UpdateMovie(m_qtb
->m_movie
);
4155 wxASSERT(m_pLib
.GetMoviesError() == noErr
);
4156 m_pLib
.EndUpdate(port
);
4161 // let the system repaint the window
4166 //---------------------------------------------------------------------------
4168 //---------------------------------------------------------------------------
4170 //in source file that contains stuff you don't directly use
4171 #include "wx/html/forcelnk.h"
4172 FORCE_LINK_ME(basewxmediabackends
)
4174 //---------------------------------------------------------------------------
4175 // End wxMediaCtrl Compilation Guard and this file
4176 //---------------------------------------------------------------------------
4177 #endif //wxUSE_MEDIACTRL