1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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 /////////////////////////////////////////////////////////////////////////////
12 //===========================================================================
14 //===========================================================================
16 //---------------------------------------------------------------------------
17 // Pre-compiled header stuff
18 //---------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "mediactrl.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
31 //---------------------------------------------------------------------------
33 //---------------------------------------------------------------------------
34 #include "wx/mediactrl.h"
36 //---------------------------------------------------------------------------
38 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
42 // Externals (somewhere in src/msw/app.cpp)
43 //---------------------------------------------------------------------------
44 extern "C" WXDLLIMPEXP_BASE HINSTANCE
wxGetInstance(void);
46 extern wxChar
*wxCanvasClassName
;
48 extern const wxChar
*wxCanvasClassName
;
51 //===========================================================================
52 // BACKEND DECLARATIONS
53 //===========================================================================
55 //---------------------------------------------------------------------------
59 //---------------------------------------------------------------------------
61 //---------------------------------------------------------------------------
62 // Compilation guard for DirectShow
63 //---------------------------------------------------------------------------
66 //---------------------------------------------------------------------------
67 // DirectShow includes
68 //---------------------------------------------------------------------------
71 class WXDLLIMPEXP_MEDIA wxAMMediaBackend
: public wxMediaBackend
76 virtual ~wxAMMediaBackend();
78 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
83 const wxValidator
& validator
,
84 const wxString
& name
);
90 virtual bool Load(const wxString
& fileName
);
91 virtual bool Load(const wxURI
& location
);
93 virtual wxMediaState
GetState();
95 virtual bool SetPosition(wxLongLong where
);
96 virtual wxLongLong
GetPosition();
97 virtual wxLongLong
GetDuration();
99 virtual void Move(int x
, int y
, int w
, int h
);
100 wxSize
GetVideoSize() const;
102 virtual double GetPlaybackRate();
103 virtual bool SetPlaybackRate(double);
109 static LRESULT CALLBACK
NotifyWndProc(HWND hWnd
, UINT nMsg
,
110 WPARAM wParam
, LPARAM lParam
);
112 LRESULT CALLBACK
OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
113 WPARAM wParam
, LPARAM lParam
);
117 IGraphBuilder
* m_pGB
;
118 IMediaControl
* m_pMC
;
119 IMediaEventEx
* m_pME
;
123 IMediaSeeking
* m_pMS
;
128 DECLARE_DYNAMIC_CLASS(wxAMMediaBackend
);
131 #endif //wxUSE_DIRECTSHOW
133 //---------------------------------------------------------------------------
137 //---------------------------------------------------------------------------
139 //---------------------------------------------------------------------------
141 //---------------------------------------------------------------------------
142 #include <mmsystem.h>
144 class WXDLLIMPEXP_MEDIA wxMCIMediaBackend
: public wxMediaBackend
149 ~wxMCIMediaBackend();
151 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
156 const wxValidator
& validator
,
157 const wxString
& name
);
160 virtual bool Pause();
163 virtual bool Load(const wxString
& fileName
);
164 virtual bool Load(const wxURI
& location
);
166 virtual wxMediaState
GetState();
168 virtual bool SetPosition(wxLongLong where
);
169 virtual wxLongLong
GetPosition();
170 virtual wxLongLong
GetDuration();
172 virtual void Move(int x
, int y
, int w
, int h
);
173 wxSize
GetVideoSize() const;
175 virtual double GetPlaybackRate();
176 virtual bool SetPlaybackRate(double dRate
);
178 static LRESULT CALLBACK
NotifyWndProc(HWND hWnd
, UINT nMsg
,
179 WPARAM wParam
, LPARAM lParam
);
181 LRESULT CALLBACK
OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
182 WPARAM wParam
, LPARAM lParam
);
184 MCIDEVICEID m_hDev
; //Our MCI Device ID/Handler
185 wxControl
* m_ctrl
; //Parent control
186 HWND m_hNotifyWnd
; //Window to use for MCI events
187 bool m_bVideo
; //Whether or not we have video
189 DECLARE_DYNAMIC_CLASS(wxMCIMediaBackend
);
192 //---------------------------------------------------------------------------
196 //---------------------------------------------------------------------------
198 //---------------------------------------------------------------------------
199 // QT Compilation Guard
200 //---------------------------------------------------------------------------
203 //---------------------------------------------------------------------------
205 //---------------------------------------------------------------------------
206 #include <qtml.h> //Windoze QT include
207 #include <QuickTimeComponents.h> //Standard QT stuff
209 class WXDLLIMPEXP_MEDIA wxQTMediaBackend
: public wxMediaBackend
216 virtual bool CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
221 const wxValidator
& validator
,
222 const wxString
& name
);
225 virtual bool Pause();
228 virtual bool Load(const wxString
& fileName
);
229 virtual bool Load(const wxURI
& location
);
231 virtual wxMediaState
GetState();
233 virtual bool SetPosition(wxLongLong where
);
234 virtual wxLongLong
GetPosition();
235 virtual wxLongLong
GetDuration();
237 virtual void Move(int x
, int y
, int w
, int h
);
238 wxSize
GetVideoSize() const;
240 virtual double GetPlaybackRate();
241 virtual bool SetPlaybackRate(double dRate
);
246 wxSize m_bestSize
; //Original movie size
247 struct MovieRecord
* m_movie
; //QT Movie handle/instance
248 wxControl
* m_ctrl
; //Parent control
249 bool m_bVideo
; //Whether or not we have video
250 class _wxQTTimer
* m_timer
; //Timer for streaming the movie
252 DECLARE_DYNAMIC_CLASS(wxQTMediaBackend
);
255 //---------------------------------------------------------------------------
256 // End QT Compilation Guard
257 //---------------------------------------------------------------------------
258 #endif //wxUSE_QUICKTIME
260 //===========================================================================
262 //===========================================================================
264 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
268 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
270 //---------------------------------------------------------------------------
271 // Only use if user wants it -
272 //---------------------------------------------------------------------------
275 IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend
, wxMediaBackend
);
277 // Numerical value for when the graph reaches the stop position
278 #define WM_GRAPHNOTIFY WM_USER+13
280 //---------------------------------------------------------------------------
281 // Usual debugging macros
282 //---------------------------------------------------------------------------
284 #define wxAMVERIFY(x) \
286 HRESULT hrdsv = (x); \
287 if ( FAILED(hrdsv) ) \
289 /*TCHAR szError[MAX_ERROR_TEXT_LEN];*/ \
290 /*if( AMGetErrorText(hrdsv, szError, MAX_ERROR_TEXT_LEN) == 0)*/ \
292 /*wxFAIL_MSG( wxString::Format(wxT("DirectShow error \"%s\" ")*/\
293 /*wxT("occured at line %i in ")*/ \
294 /*wxT("mediactrl.cpp"),*/ \
295 /*szError, __LINE__) );*/ \
298 wxFAIL_MSG( wxString::Format(wxT("Unknown error (%i) ") \
300 wxT(" line %i in mediactrl.cpp."), \
301 (int)hrdsv, __LINE__) ); \
304 #define wxVERIFY(x) wxASSERT((x))
306 #define wxAMVERIFY(x) (x)
307 #define wxVERIFY(x) (x)
310 //---------------------------------------------------------------------------
311 // Standard macros for ease of use
312 //---------------------------------------------------------------------------
313 #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
315 //---------------------------------------------------------------------------
316 // wxAMMediaBackend Constructor
318 // Sets m_hNotifyWnd to NULL to signify that we haven't loaded anything yet
319 //---------------------------------------------------------------------------
320 wxAMMediaBackend::wxAMMediaBackend() : m_hNotifyWnd(NULL
)
324 //---------------------------------------------------------------------------
325 // wxAMMediaBackend Destructor
327 // Cleans up everything
328 //---------------------------------------------------------------------------
329 wxAMMediaBackend::~wxAMMediaBackend()
335 //---------------------------------------------------------------------------
336 // wxAMMediaBackend::CreateControl
338 // ActiveMovie does not really have any native control to speak of,
339 // so we just create a normal control with a black background.
341 // We also check to see if ActiveMovie is installed
342 //---------------------------------------------------------------------------
343 bool wxAMMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
348 const wxValidator
& validator
,
349 const wxString
& name
)
351 //create our filter graph
352 HRESULT hr
= CoCreateInstance(CLSID_FilterGraph
, NULL
, CLSCTX_INPROC_SERVER
,
353 IID_IGraphBuilder
, (void**)&m_pGB
);
355 //directshow not installed?
359 //release the filter graph - we don't need it yet
365 // By default wxWindow(s) is created with a border -
366 // so we need to get rid of those, and create with
367 // wxCLIP_CHILDREN, so that if the driver/backend
368 // is a child window, it refereshes properly
370 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
371 (style
| wxNO_BORDER
) | wxCLIP_CHILDREN
,
376 //Set our background color to black by default
378 ctrl
->SetBackgroundColour(*wxBLACK
);
385 //---------------------------------------------------------------------------
386 // wxAMMediaBackend::Load (file version)
388 // Creates an Active Movie filter graph from a file or url
389 //---------------------------------------------------------------------------
390 bool wxAMMediaBackend::Load(const wxString
& fileName
)
395 CoCreateInstance(CLSID_FilterGraph
, NULL
, CLSCTX_INPROC_SERVER
,
396 IID_IGraphBuilder
, (void**)&m_pGB
);
398 //load the graph & render
399 if( FAILED(m_pGB
->RenderFile(fileName
.wc_str(wxConvLocal
), NULL
)) )
402 //get the interfaces, all of them
403 wxAMVERIFY( m_pGB
->QueryInterface(IID_IMediaControl
, (void**)&m_pMC
) );
404 wxAMVERIFY( m_pGB
->QueryInterface(IID_IMediaEventEx
, (void**)&m_pME
) );
405 wxAMVERIFY( m_pGB
->QueryInterface(IID_IMediaSeeking
, (void**)&m_pMS
) );
406 wxAMVERIFY( m_pGB
->QueryInterface(IID_IVideoWindow
, (void**)&m_pVW
) );
407 wxAMVERIFY( m_pGB
->QueryInterface(IID_IBasicAudio
, (void**)&m_pBA
) );
408 wxAMVERIFY( m_pGB
->QueryInterface(IID_IBasicVideo
, (void**)&m_pBV
) );
410 //We could tell if the media has audio or not by
414 //pBA->get_Volume(&lVolume) == E_NOTIMPL
419 //Obtain the _actual_ size of the movie & remember it
424 m_bestSize
.x
= m_bestSize
.y
= 0;
426 m_bVideo
= SUCCEEDED( m_pVW
->GetWindowPosition( &nX
,
428 (long*)&m_bestSize
.x
,
429 (long*)&m_bestSize
.y
) );
432 //If we have video in the media - set it up so that
433 //its a child window of the control, its visible,
434 //and that the control is the owner of the video window
438 wxAMVERIFY( m_pVW
->put_Owner((OAHWND
)m_ctrl
->GetHandle()) );
439 wxAMVERIFY( m_pVW
->put_WindowStyle(WS_CHILD
| WS_CLIPSIBLINGS
) );
440 wxAMVERIFY( m_pVW
->put_Visible(OATRUE
) ); //OATRUE == -1
444 // Create a hidden window and register to handle
445 // directshow events for this graph
446 // Note that wxCanvasClassName is already registered
447 // and used by all wxWindows and normal wxControls
449 m_hNotifyWnd
= ::CreateWindow
463 wxLogSysError( wxT("Could not create hidden needed for ")
464 wxT("registering for DirectShow events!") );
469 ::SetWindowLongPtr(m_hNotifyWnd
, GWLP_WNDPROC
,
470 (LONG_PTR
)wxAMMediaBackend::NotifyWndProc
);
472 ::SetWindowLong(m_hNotifyWnd
, GWL_USERDATA
,
475 wxAMVERIFY( m_pME
->SetNotifyWindow((OAHWND
)m_hNotifyWnd
,
476 WM_GRAPHNOTIFY
, 0) );
479 //set the time format
481 wxAMVERIFY( m_pMS
->SetTimeFormat(&TIME_FORMAT_MEDIA_TIME
) );
484 // Force the parent window of this control to recalculate
485 // the size of this if sizers are being used
486 // and render the results immediately
488 m_ctrl
->InvalidateBestSize();
489 m_ctrl
->GetParent()->Layout();
490 m_ctrl
->GetParent()->Refresh();
491 m_ctrl
->GetParent()->Update();
496 //---------------------------------------------------------------------------
497 // wxAMMediaBackend::Load (URL Version)
499 // Loads media from a URL. Interestingly enough DirectShow
500 // appears (?) to escape the URL for us, at least on normal
502 //---------------------------------------------------------------------------
503 bool wxAMMediaBackend::Load(const wxURI
& location
)
505 return Load(location
.BuildUnescapedURI());
508 //---------------------------------------------------------------------------
509 // wxAMMediaBackend::Play
511 // Plays the stream. If it is non-seekable, it will restart it.
512 //---------------------------------------------------------------------------
513 bool wxAMMediaBackend::Play()
515 return SUCCEEDED( m_pMC
->Run() );
518 //---------------------------------------------------------------------------
519 // wxAMMediaBackend::Pause
521 // Pauses the stream.
522 //---------------------------------------------------------------------------
523 bool wxAMMediaBackend::Pause()
525 return SUCCEEDED( m_pMC
->Pause() );
528 //---------------------------------------------------------------------------
529 // wxAMMediaBackend::Stop
532 //---------------------------------------------------------------------------
533 bool wxAMMediaBackend::Stop()
535 bool bOK
= SUCCEEDED( m_pMC
->Stop() );
537 //We don't care if it can't get to the beginning in directshow -
538 //it could be a non-seeking filter (wince midi) in which case playing
539 //starts all over again
544 //---------------------------------------------------------------------------
545 // wxAMMediaBackend::SetPosition
547 // 1) Translates the current position's time to directshow time,
548 // which is in a scale of 100 nanoseconds
549 // 2) Sets the play position of the IMediaSeeking interface -
550 // passing NULL as the stop position means to keep the old
552 //---------------------------------------------------------------------------
553 bool wxAMMediaBackend::SetPosition(wxLongLong where
)
555 LONGLONG pos
= ((LONGLONG
)where
.GetValue()) * 10000;
557 return SUCCEEDED( m_pMS
->SetPositions(
559 AM_SEEKING_AbsolutePositioning
,
561 AM_SEEKING_NoPositioning
565 //---------------------------------------------------------------------------
566 // wxAMMediaBackend::GetPosition
568 // 1) Obtains the current play and stop positions from IMediaSeeking
569 // 2) Returns the play position translated to our time base
570 //---------------------------------------------------------------------------
571 wxLongLong
wxAMMediaBackend::GetPosition()
573 LONGLONG outCur
, outStop
;
574 wxAMVERIFY( m_pMS
->GetPositions(&outCur
, &outStop
) );
576 //h,m,s,milli - outdur is in 100 nanos
580 //---------------------------------------------------------------------------
581 // wxAMMediaBackend::GetDuration
583 // 1) Obtains the duration of the media from the IMediaSeeking interface
584 // 2) Converts that value to our time base, and returns it
585 //---------------------------------------------------------------------------
586 wxLongLong
wxAMMediaBackend::GetDuration()
588 LONGLONG outDuration
;
589 wxAMVERIFY( m_pMS
->GetDuration(&outDuration
) );
591 //h,m,s,milli - outdur is in 100 nanos
592 return outDuration
/10000;
595 //---------------------------------------------------------------------------
596 // wxAMMediaBackend::GetState
598 // Obtains the state from the IMediaControl interface.
599 // Note that it's enumeration values for stopping/playing
600 // etc. are the same as ours, so we just do a straight cast.
601 // TODO: MS recommends against INFINITE here for
602 // IMediaControl::GetState- do it in stages
603 //---------------------------------------------------------------------------
604 wxMediaState
wxAMMediaBackend::GetState()
607 OAFilterState theState
;
608 hr
= m_pMC
->GetState(INFINITE
, &theState
);
610 wxASSERT( SUCCEEDED(hr
) );
612 //MSW state is the same as ours
614 //State_Paused = State_Stopped + 1,
615 //State_Running = State_Paused + 1
617 return (wxMediaState
) theState
;
620 //---------------------------------------------------------------------------
621 // wxAMMediaBackend::GetPlaybackRate
623 // Pretty simple way of obtaining the playback rate from
624 // the IMediaSeeking interface
625 //---------------------------------------------------------------------------
626 double wxAMMediaBackend::GetPlaybackRate()
629 wxAMVERIFY( m_pMS
->GetRate(&dRate
) );
633 //---------------------------------------------------------------------------
634 // wxAMMediaBackend::SetPlaybackRate
636 // Sets the playback rate of the media - DirectShow is pretty good
637 // about this, actually
638 //---------------------------------------------------------------------------
639 bool wxAMMediaBackend::SetPlaybackRate(double dRate
)
641 return SUCCEEDED( m_pMS
->SetRate(dRate
) );
644 //---------------------------------------------------------------------------
645 // wxAMMediaBackend::NotifyWndProc
647 // Here we check to see if DirectShow tells us we've reached the stop
648 // position in our stream - if it has, it may not actually stop
649 // the stream - which we need to do...
650 //---------------------------------------------------------------------------
651 LRESULT CALLBACK
wxAMMediaBackend::NotifyWndProc(HWND hWnd
, UINT nMsg
,
655 wxAMMediaBackend
* backend
= (wxAMMediaBackend
*)
656 ::GetWindowLong(hWnd
, GWL_USERDATA
);
658 return backend
->OnNotifyWndProc(hWnd
, nMsg
, wParam
, lParam
);
661 LRESULT CALLBACK
wxAMMediaBackend::OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
665 if (nMsg
== WM_GRAPHNOTIFY
)
672 // DirectShow keeps a list of queued events, and we need
673 // to go through them one by one, stopping at (Hopefully only one)
674 // EC_COMPLETE message
676 while(SUCCEEDED(m_pME
->GetEvent(&evCode
, (LONG_PTR
*) &evParam1
,
677 (LONG_PTR
*) &evParam2
, 0)
681 // Cleanup memory that GetEvent allocated
682 wxAMVERIFY( m_pME
->FreeEventParams(evCode
, evParam1
, evParam2
) );
684 // If this is the end of the clip, notify handler
685 if(EC_COMPLETE
== evCode
)
687 //send the event to our child
688 wxMediaEvent
theEvent(wxEVT_MEDIA_STOP
, m_ctrl
->GetId());
689 m_ctrl
->ProcessEvent(theEvent
);
691 //if the user didn't veto it, stop the stream
692 if (theEvent
.IsAllowed())
694 //Interestingly enough, DirectShow does not actually stop
695 //the filters - even when it reaches the end!
698 //send the event to our child
699 wxMediaEvent
theEvent(wxEVT_MEDIA_FINISHED
,
701 m_ctrl
->ProcessEvent(theEvent
);
706 return DefWindowProc(hWnd
, nMsg
, wParam
, lParam
);
709 //---------------------------------------------------------------------------
710 // wxAMMediaBackend::Cleanup
712 // 1) Hide/disowns the video window (MS says bad things will happen if
714 // 2) Releases all the directshow interfaces we use
715 // TODO: Maybe there's a way to redirect the IGraphBuilder each time
716 // we load, rather then creating and destroying the interfaces
718 //---------------------------------------------------------------------------
719 void wxAMMediaBackend::Cleanup()
721 // Hide then disown the window
724 m_pVW
->put_Visible(OAFALSE
); //OSFALSE == 0
725 m_pVW
->put_Owner(NULL
);
728 // Release and zero DirectShow interfaces
737 // Get rid of our hidden Window
738 DestroyWindow(m_hNotifyWnd
);
743 //---------------------------------------------------------------------------
744 // wxAMMediaBackend::GetVideoSize
746 // Obtains the cached original video size
747 //---------------------------------------------------------------------------
748 wxSize
wxAMMediaBackend::GetVideoSize() const
753 //---------------------------------------------------------------------------
754 // wxAMMediaBackend::Move
756 // Resizes the IVideoWindow to the size of the control window
757 //---------------------------------------------------------------------------
758 void wxAMMediaBackend::Move(int x
, int y
, int w
, int h
)
760 if(m_hNotifyWnd
&& m_bVideo
)
762 wxAMVERIFY( m_pVW
->SetWindowPosition(0, 0, w
, h
) );
766 //---------------------------------------------------------------------------
767 // End of wxAMMediaBackend
768 //---------------------------------------------------------------------------
769 #endif //wxUSE_DIRECTSHOW
771 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
775 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
778 IMPLEMENT_DYNAMIC_CLASS(wxMCIMediaBackend
, wxMediaBackend
);
780 //---------------------------------------------------------------------------
781 // Usual debugging macros for MCI returns
782 //---------------------------------------------------------------------------
785 #define wxMCIVERIFY(arg) \
788 if ( (nRet = (arg)) != 0) \
791 mciGetErrorString(nRet, sz, 5000); \
792 wxFAIL_MSG(wxString::Format(_T("MCI Error:%s"), sz)); \
796 #define wxMCIVERIFY(arg) (arg);
799 //---------------------------------------------------------------------------
800 // Simulation for <digitalv.h>
802 // Mingw and possibly other compilers don't have the digitalv.h header
803 // that is needed to have some essential features of mci work with
804 // windows - so we provide the declarations for the types we use here
805 //---------------------------------------------------------------------------
808 DWORD_PTR dwCallback
;
809 #ifdef MCI_USE_OFFEXT
815 } MCI_DGV_RECT_PARMS
;
818 DWORD_PTR dwCallback
;
828 } MCI_DGV_WINDOW_PARMS
;
831 DWORD_PTR dwCallback
;
838 //---------------------------------------------------------------------------
839 // wxMCIMediaBackend Constructor
841 // Here we don't need to do much except say we don't have any video :)
842 //---------------------------------------------------------------------------
843 wxMCIMediaBackend::wxMCIMediaBackend() : m_hNotifyWnd(NULL
), m_bVideo(false)
847 //---------------------------------------------------------------------------
848 // wxMCIMediaBackend Destructor
850 // We close the mci device - note that there may not be an mci device here,
851 // or it may fail - but we don't really care, since we're destructing
852 //---------------------------------------------------------------------------
853 wxMCIMediaBackend::~wxMCIMediaBackend()
857 mciSendCommand(m_hDev
, MCI_CLOSE
, 0, 0);
858 DestroyWindow(m_hNotifyWnd
);
863 //---------------------------------------------------------------------------
864 // wxMCIMediaBackend::Create
866 // Here we just tell wxMediaCtrl that mci does exist (which it does, on all
867 // msw systems, at least in some form dating back to win16 days)
868 //---------------------------------------------------------------------------
869 bool wxMCIMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
874 const wxValidator
& validator
,
875 const wxString
& name
)
879 // By default wxWindow(s) is created with a border -
880 // so we need to get rid of those, and create with
881 // wxCLIP_CHILDREN, so that if the driver/backend
882 // is a child window, it refereshes properly
884 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
885 (style
& ~wxBORDER_MASK
) | wxCLIP_CHILDREN
,
890 //Set our background color to black by default
892 ctrl
->SetBackgroundColour(*wxBLACK
);
898 //---------------------------------------------------------------------------
899 // wxMCIMediaBackend::Load (file version)
901 // Here we have MCI load a file and device, set the time format to our
902 // default (milliseconds), and set the video (if any) to play in the control
903 //---------------------------------------------------------------------------
904 bool wxMCIMediaBackend::Load(const wxString
& fileName
)
907 //if the user already called load close the previous MCI device
911 mciSendCommand(m_hDev
, MCI_CLOSE
, 0, 0);
912 DestroyWindow(m_hNotifyWnd
);
917 //Opens a file and has MCI select a device. Normally you'd put
918 //MCI_OPEN_TYPE in addition to MCI_OPEN_ELEMENT - however if you
919 //omit this it tells MCI to select the device instead. This is
920 //good because we have no reliable way of "enumerating" the devices
923 MCI_OPEN_PARMS openParms
;
924 openParms
.lpstrElementName
= (wxChar
*) fileName
.c_str();
926 if ( mciSendCommand(0, MCI_OPEN
, MCI_OPEN_ELEMENT
,
927 (DWORD
)(LPVOID
)&openParms
) != 0)
930 m_hDev
= openParms
.wDeviceID
;
933 //Now set the time format for the device to milliseconds
935 MCI_SET_PARMS setParms
;
936 setParms
.dwCallback
= 0;
937 setParms
.dwTimeFormat
= MCI_FORMAT_MILLISECONDS
;
939 if (mciSendCommand(m_hDev
, MCI_SET
, MCI_SET_TIME_FORMAT
,
940 (DWORD
)(LPVOID
)&setParms
) != 0)
944 //Now tell the MCI device to display the video in our wxMediaCtrl
946 MCI_DGV_WINDOW_PARMS windowParms
;
947 windowParms
.hWnd
= (HWND
)m_ctrl
->GetHandle();
949 m_bVideo
= (mciSendCommand(m_hDev
, MCI_WINDOW
,
950 0x00010000L
, //MCI_DGV_WINDOW_HWND
951 (DWORD
)(LPVOID
)&windowParms
) == 0);
954 // Create a hidden window and register to handle
956 // Note that wxCanvasClassName is already registered
957 // and used by all wxWindows and normal wxControls
959 m_hNotifyWnd
= ::CreateWindow
973 wxLogSysError( wxT("Could not create hidden needed for ")
974 wxT("registering for DirectShow events!") );
979 ::SetWindowLong(m_hNotifyWnd
, GWL_WNDPROC
,
980 (LONG
)wxMCIMediaBackend::NotifyWndProc
);
982 ::SetWindowLong(m_hNotifyWnd
, GWL_USERDATA
,
986 //Here, if the parent of the control has a sizer - we
987 //tell it to recalculate the size of this control since
988 //the user opened a seperate media file
990 m_ctrl
->InvalidateBestSize();
991 m_ctrl
->GetParent()->Layout();
992 m_ctrl
->GetParent()->Refresh();
993 m_ctrl
->GetParent()->Update();
998 //---------------------------------------------------------------------------
999 // wxMCIMediaBackend::Load (URL version)
1001 // MCI doesn't support URLs directly (?)
1003 // TODO: Use wxURL/wxFileSystem and mmioInstallProc
1004 //---------------------------------------------------------------------------
1005 bool wxMCIMediaBackend::Load(const wxURI
& WXUNUSED(location
))
1010 //---------------------------------------------------------------------------
1011 // wxMCIMediaBackend::Play
1013 // Plays/Resumes the MCI device... a couple notes:
1014 // 1) Certain drivers will crash and burn if we don't pass them an
1015 // MCI_PLAY_PARMS, despite the documentation that says otherwise...
1016 // 2) There is a MCI_RESUME command, but MCI_PLAY does the same thing
1017 // and will resume from a stopped state also, so there's no need to
1018 // call both, for example
1019 //---------------------------------------------------------------------------
1020 bool wxMCIMediaBackend::Play()
1022 MCI_PLAY_PARMS playParms
;
1023 playParms
.dwCallback
= (DWORD
)m_hNotifyWnd
;
1025 return ( mciSendCommand(m_hDev
, MCI_PLAY
, MCI_NOTIFY
,
1026 (DWORD
)(LPVOID
)&playParms
) == 0 );
1029 //---------------------------------------------------------------------------
1030 // wxMCIMediaBackend::Pause
1032 // Pauses the MCI device - nothing special
1033 //---------------------------------------------------------------------------
1034 bool wxMCIMediaBackend::Pause()
1036 return (mciSendCommand(m_hDev
, MCI_PAUSE
, MCI_WAIT
, 0) == 0);
1039 //---------------------------------------------------------------------------
1040 // wxMCIMediaBackend::Stop
1042 // Stops the MCI device & seeks to the beginning as wxMediaCtrl docs outline
1043 //---------------------------------------------------------------------------
1044 bool wxMCIMediaBackend::Stop()
1046 return (mciSendCommand(m_hDev
, MCI_STOP
, MCI_WAIT
, 0) == 0) &&
1047 (mciSendCommand(m_hDev
, MCI_SEEK
, MCI_SEEK_TO_START
, 0) == 0);
1050 //---------------------------------------------------------------------------
1051 // wxMCIMediaBackend::GetState
1053 // Here we get the state and convert it to a wxMediaState -
1054 // since we use direct comparisons with MCI_MODE_PLAY and
1055 // MCI_MODE_PAUSE, we don't care if the MCI_STATUS call
1057 //---------------------------------------------------------------------------
1058 wxMediaState
wxMCIMediaBackend::GetState()
1060 MCI_STATUS_PARMS statusParms
;
1061 statusParms
.dwItem
= MCI_STATUS_MODE
;
1063 mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
1064 (DWORD
)(LPVOID
)&statusParms
);
1066 if(statusParms
.dwReturn
== MCI_MODE_PAUSE
)
1067 return wxMEDIASTATE_PAUSED
;
1068 else if(statusParms
.dwReturn
== MCI_MODE_PLAY
)
1069 return wxMEDIASTATE_PLAYING
;
1071 return wxMEDIASTATE_STOPPED
;
1074 //---------------------------------------------------------------------------
1075 // wxMCIMediaBackend::SetPosition
1077 // Here we set the position of the device in the stream.
1078 // Note that MCI actually stops the device after you seek it if the
1079 // device is playing/paused, so we need to play the file after
1080 // MCI seeks like normal APIs would
1081 //---------------------------------------------------------------------------
1082 bool wxMCIMediaBackend::SetPosition(wxLongLong where
)
1084 MCI_SEEK_PARMS seekParms
;
1085 seekParms
.dwCallback
= 0;
1086 seekParms
.dwTo
= (DWORD
)where
.GetValue();
1088 //device was playing?
1089 bool bReplay
= GetState() == wxMEDIASTATE_PLAYING
;
1091 if( mciSendCommand(m_hDev
, MCI_SEEK
, MCI_TO
,
1092 (DWORD
)(LPVOID
)&seekParms
) != 0)
1095 //If the device was playing, resume it
1102 //---------------------------------------------------------------------------
1103 // wxMCIMediaBackend::GetPosition
1105 // Gets the position of the device in the stream using the current
1106 // time format... nothing special here...
1107 //---------------------------------------------------------------------------
1108 wxLongLong
wxMCIMediaBackend::GetPosition()
1110 MCI_STATUS_PARMS statusParms
;
1111 statusParms
.dwItem
= MCI_STATUS_POSITION
;
1113 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
1114 (DWORD
)(LPSTR
)&statusParms
) != 0)
1117 return statusParms
.dwReturn
;
1120 //---------------------------------------------------------------------------
1121 // wxMCIMediaBackend::GetDuration
1123 // Gets the duration of the stream... nothing special
1124 //---------------------------------------------------------------------------
1125 wxLongLong
wxMCIMediaBackend::GetDuration()
1127 MCI_STATUS_PARMS statusParms
;
1128 statusParms
.dwItem
= MCI_STATUS_LENGTH
;
1130 if (mciSendCommand(m_hDev
, MCI_STATUS
, MCI_STATUS_ITEM
,
1131 (DWORD
)(LPSTR
)&statusParms
) != 0)
1134 return statusParms
.dwReturn
;
1137 //---------------------------------------------------------------------------
1138 // wxMCIMediaBackend::Move
1140 // Moves the window to a location
1141 //---------------------------------------------------------------------------
1142 void wxMCIMediaBackend::Move(int WXUNUSED(x
), int WXUNUSED(y
),
1145 if (m_hNotifyWnd
&& m_bVideo
)
1147 MCI_DGV_RECT_PARMS putParms
; //ifdefed MCI_DGV_PUT_PARMS
1148 putParms
.rc
.top
= 0;
1149 putParms
.rc
.bottom
= 0;
1150 putParms
.rc
.right
= w
;
1151 putParms
.rc
.bottom
= h
;
1153 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_PUT
,
1154 0x00040000L
, //MCI_DGV_PUT_DESTINATION
1155 (DWORD
)(LPSTR
)&putParms
) );
1159 //---------------------------------------------------------------------------
1160 // wxMCIMediaBackend::GetVideoSize
1162 // Gets the original size of the movie for sizers
1163 //---------------------------------------------------------------------------
1164 wxSize
wxMCIMediaBackend::GetVideoSize() const
1168 MCI_DGV_RECT_PARMS whereParms
; //ifdefed MCI_DGV_WHERE_PARMS
1170 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_WHERE
,
1171 0x00020000L
, //MCI_DGV_WHERE_SOURCE
1172 (DWORD
)(LPSTR
)&whereParms
) );
1174 return wxSize(whereParms
.rc
.right
, whereParms
.rc
.bottom
);
1179 //---------------------------------------------------------------------------
1180 // wxMCIMediaBackend::GetPlaybackRate
1183 //---------------------------------------------------------------------------
1184 double wxMCIMediaBackend::GetPlaybackRate()
1189 //---------------------------------------------------------------------------
1190 // wxMCIMediaBackend::SetPlaybackRate
1193 //---------------------------------------------------------------------------
1194 bool wxMCIMediaBackend::SetPlaybackRate(double WXUNUSED(dRate
))
1197 MCI_WAVE_SET_SAMPLESPERSEC
1198 MCI_DGV_SET_PARMS setParms;
1199 setParms.dwSpeed = (DWORD) (dRate * 1000.0);
1201 return (mciSendCommand(m_hDev, MCI_SET,
1202 0x00020000L, //MCI_DGV_SET_SPEED
1203 (DWORD)(LPSTR)&setParms) == 0);
1208 //---------------------------------------------------------------------------
1209 // [static] wxMCIMediaBackend::MSWWindowProc
1211 // Here we process a message when MCI reaches the stopping point
1213 //---------------------------------------------------------------------------
1214 LRESULT CALLBACK
wxMCIMediaBackend::NotifyWndProc(HWND hWnd
, UINT nMsg
,
1218 wxMCIMediaBackend
* backend
= (wxMCIMediaBackend
*)
1219 ::GetWindowLong(hWnd
, GWL_USERDATA
);
1222 return backend
->OnNotifyWndProc(hWnd
, nMsg
, wParam
, lParam
);
1225 LRESULT CALLBACK
wxMCIMediaBackend::OnNotifyWndProc(HWND hWnd
, UINT nMsg
,
1229 if(nMsg
== MM_MCINOTIFY
)
1231 wxASSERT(lParam
== (LPARAM
) m_hDev
);
1232 if(wParam
== MCI_NOTIFY_SUCCESSFUL
&& lParam
== (LPARAM
)m_hDev
)
1234 wxMediaEvent
theEvent(wxEVT_MEDIA_STOP
, m_ctrl
->GetId());
1235 m_ctrl
->ProcessEvent(theEvent
);
1237 if(theEvent
.IsAllowed())
1239 wxMCIVERIFY( mciSendCommand(m_hDev
, MCI_SEEK
,
1240 MCI_SEEK_TO_START
, 0) );
1242 //send the event to our child
1243 wxMediaEvent
theEvent(wxEVT_MEDIA_FINISHED
,
1245 m_ctrl
->ProcessEvent(theEvent
);
1249 return DefWindowProc(hWnd
, nMsg
, wParam
, lParam
);
1251 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1255 // TODO: Use a less cludgy way to pause/get state/set state
1256 // TODO: Dynamically load from qtml.dll
1257 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1261 IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend
, wxMediaBackend
);
1263 //Time between timer calls
1264 #define MOVIE_DELAY 100
1266 #include "wx/timer.h"
1268 // --------------------------------------------------------------------------
1269 // wxQTTimer - Handle Asyncronous Playing
1270 // --------------------------------------------------------------------------
1271 class _wxQTTimer
: public wxTimer
1274 _wxQTTimer(Movie movie
, wxQTMediaBackend
* parent
) :
1275 m_movie(movie
), m_bPaused(false), m_parent(parent
)
1283 bool GetPaused() {return m_bPaused
;}
1284 void SetPaused(bool bPaused
) {m_bPaused
= bPaused
;}
1286 //-----------------------------------------------------------------------
1287 // _wxQTTimer::Notify
1289 // 1) Checks to see if the movie is done, and if not continues
1290 // streaming the movie
1291 // 2) Sends the wxEVT_MEDIA_STOP event if we have reached the end of
1293 //-----------------------------------------------------------------------
1298 if(!IsMovieDone(m_movie
))
1299 MoviesTask(m_movie
, MOVIE_DELAY
);
1302 wxMediaEvent
theEvent(wxEVT_MEDIA_STOP
,
1303 m_parent
->m_ctrl
->GetId());
1304 m_parent
->m_ctrl
->ProcessEvent(theEvent
);
1306 if(theEvent
.IsAllowed())
1310 wxASSERT(::GetMoviesError() == noErr
);
1312 //send the event to our child
1313 wxMediaEvent
theEvent(wxEVT_MEDIA_FINISHED
,
1314 m_parent
->m_ctrl
->GetId());
1315 m_parent
->m_ctrl
->ProcessEvent(theEvent
);
1322 Movie m_movie
; //Our movie instance
1323 bool m_bPaused
; //Whether we are paused or not
1324 wxQTMediaBackend
* m_parent
; //Backend pointer
1327 //---------------------------------------------------------------------------
1328 // wxQTMediaBackend Destructor
1330 // Sets m_timer to NULL signifying we havn't loaded anything yet
1331 //---------------------------------------------------------------------------
1332 wxQTMediaBackend::wxQTMediaBackend() : m_timer(NULL
)
1336 //---------------------------------------------------------------------------
1337 // wxQTMediaBackend Destructor
1339 // 1) Cleans up the QuickTime movie instance
1340 // 2) Decrements the QuickTime reference counter - if this reaches
1341 // 0, QuickTime shuts down
1342 // 3) Decrements the QuickTime Windows Media Layer reference counter -
1343 // if this reaches 0, QuickTime shuts down the Windows Media Layer
1344 //---------------------------------------------------------------------------
1345 wxQTMediaBackend::~wxQTMediaBackend()
1350 //Note that ExitMovies() is not neccessary, but
1351 //the docs are fuzzy on whether or not TerminateQTML is
1356 //---------------------------------------------------------------------------
1357 // wxQTMediaBackend::CreateControl
1359 // 1) Intializes QuickTime
1360 // 2) Creates the control window
1361 //---------------------------------------------------------------------------
1362 bool wxQTMediaBackend::CreateControl(wxControl
* ctrl
, wxWindow
* parent
,
1367 const wxValidator
& validator
,
1368 const wxString
& name
)
1371 if ((nError
= InitializeQTML(0)) != noErr
) //-2093 no dll
1373 wxFAIL_MSG(wxString::Format(wxT("Couldn't Initialize Quicktime-%i"), nError
));
1380 // By default wxWindow(s) is created with a border -
1381 // so we need to get rid of those
1383 // Since we don't have a child window like most other
1384 // backends, we don't need wxCLIP_CHILDREN
1386 if ( !ctrl
->wxControl::Create(parent
, id
, pos
, size
,
1387 (style
& ~wxBORDER_MASK
),
1392 //Set our background color to black by default
1394 ctrl
->SetBackgroundColour(*wxBLACK
);
1400 //---------------------------------------------------------------------------
1401 // wxQTMediaBackend::Load (file version)
1403 // 1) Get an FSSpec from the Windows path name
1404 // 2) Open the movie
1405 // 3) Obtain the movie instance from the movie resource
1407 //---------------------------------------------------------------------------
1408 bool wxQTMediaBackend::Load(const wxString
& fileName
)
1417 if (NativePathNameToFSSpec ((char*) (const char*) fileName
.mb_str(),
1418 &sfFile
, 0) != noErr
)
1421 if (OpenMovieFile (&sfFile
, &movieResFile
, fsRdPerm
) != noErr
)
1424 short movieResID
= 0;
1427 err
= NewMovieFromFile (
1435 CloseMovieFile (movieResFile
);
1442 return ::GetMoviesError() == noErr
;
1445 //---------------------------------------------------------------------------
1446 // wxQTMediaBackend::Move
1449 //---------------------------------------------------------------------------
1450 bool wxQTMediaBackend::Load(const wxURI
& location
)
1455 wxString theURI
= location
.BuildURI();
1459 Handle theHandle
= NewHandleClear(theURI
.length() + 1);
1460 wxASSERT(theHandle
);
1462 BlockMove(theURI
.mb_str(), *theHandle
, theURI
.length() + 1);
1464 //create the movie from the handle that refers to the URI
1465 err
= NewMovieFromDataRef(&m_movie
, newMovieActive
,
1467 URLDataHandlerSubType
);
1469 DisposeHandle(theHandle
);
1474 //preroll movie for streaming
1478 timeNow
= GetMovieTime(m_movie
, NULL
);
1479 playRate
= GetMoviePreferredRate(m_movie
);
1480 PrePrerollMovie(m_movie
, timeNow
, playRate
, NULL
, NULL
);
1481 PrerollMovie(m_movie
, timeNow
, playRate
);
1482 SetMovieRate(m_movie
, playRate
);
1486 return ::GetMoviesError() == noErr
;
1489 //---------------------------------------------------------------------------
1490 // wxQTMediaBackend::Move
1493 //---------------------------------------------------------------------------
1494 void wxQTMediaBackend::FinishLoad()
1496 m_timer
= new _wxQTTimer(m_movie
, (wxQTMediaBackend
*) this);
1499 //get the real size of the movie
1501 ::GetMovieNaturalBoundsRect (m_movie
, &outRect
);
1502 wxASSERT(::GetMoviesError() == noErr
);
1504 m_bestSize
.x
= outRect
.right
- outRect
.left
;
1505 m_bestSize
.y
= outRect
.bottom
- outRect
.top
;
1507 //reparent movie/*AudioMediaCharacteristic*/
1508 if(GetMovieIndTrackType(m_movie
, 1,
1509 VisualMediaCharacteristic
,
1510 movieTrackCharacteristic
|
1511 movieTrackEnabledOnly
) != NULL
)
1513 CreatePortAssociation(m_ctrl
->GetHWND(), NULL
, 0L);
1515 SetMovieGWorld(m_movie
,
1516 (CGrafPtr
) GetNativeWindowPort(m_ctrl
->GetHWND()),
1520 //we want millisecond precision
1521 ::SetMovieTimeScale(m_movie
, 1000);
1522 wxASSERT(::GetMoviesError() == noErr
);
1525 //Here, if the parent of the control has a sizer - we
1526 //tell it to recalculate the size of this control since
1527 //the user opened a seperate media file
1529 m_ctrl
->InvalidateBestSize();
1530 m_ctrl
->GetParent()->Layout();
1531 m_ctrl
->GetParent()->Refresh();
1532 m_ctrl
->GetParent()->Update();
1535 //---------------------------------------------------------------------------
1536 // wxQTMediaBackend::Move
1539 //---------------------------------------------------------------------------
1540 bool wxQTMediaBackend::Play()
1542 ::StartMovie(m_movie
);
1543 m_timer
->SetPaused(false);
1544 m_timer
->Start(MOVIE_DELAY
, wxTIMER_CONTINUOUS
);
1545 return ::GetMoviesError() == noErr
;
1548 //---------------------------------------------------------------------------
1549 // wxQTMediaBackend::Move
1552 //---------------------------------------------------------------------------
1553 bool wxQTMediaBackend::Pause()
1555 ::StopMovie(m_movie
);
1556 m_timer
->SetPaused(true);
1558 return ::GetMoviesError() == noErr
;
1561 //---------------------------------------------------------------------------
1562 // wxQTMediaBackend::Move
1565 //---------------------------------------------------------------------------
1566 bool wxQTMediaBackend::Stop()
1568 m_timer
->SetPaused(false);
1571 ::StopMovie(m_movie
);
1572 if(::GetMoviesError() != noErr
)
1575 ::GoToBeginningOfMovie(m_movie
);
1576 return ::GetMoviesError() == noErr
;
1579 //---------------------------------------------------------------------------
1580 // wxQTMediaBackend::Move
1583 //---------------------------------------------------------------------------
1584 double wxQTMediaBackend::GetPlaybackRate()
1586 return ( ((double)::GetMovieRate(m_movie
)) / 0x10000);
1589 //---------------------------------------------------------------------------
1590 // wxQTMediaBackend::Move
1593 //---------------------------------------------------------------------------
1594 bool wxQTMediaBackend::SetPlaybackRate(double dRate
)
1596 ::SetMovieRate(m_movie
, (Fixed
) (dRate
* 0x10000));
1597 return ::GetMoviesError() == noErr
;
1600 //---------------------------------------------------------------------------
1601 // wxQTMediaBackend::Move
1604 //---------------------------------------------------------------------------
1605 bool wxQTMediaBackend::SetPosition(wxLongLong where
)
1607 TimeRecord theTimeRecord
;
1608 memset(&theTimeRecord
, 0, sizeof(TimeRecord
));
1609 theTimeRecord
.value
.lo
= where
.GetValue();
1610 theTimeRecord
.scale
= ::GetMovieTimeScale(m_movie
);
1611 theTimeRecord
.base
= ::GetMovieTimeBase(m_movie
);
1612 ::SetMovieTime(m_movie
, &theTimeRecord
);
1614 if (::GetMoviesError() != noErr
)
1620 //---------------------------------------------------------------------------
1621 // wxQTMediaBackend::Move
1624 //---------------------------------------------------------------------------
1625 wxLongLong
wxQTMediaBackend::GetPosition()
1627 return ::GetMovieTime(m_movie
, NULL
);
1630 //---------------------------------------------------------------------------
1631 // wxQTMediaBackend::Move
1634 //---------------------------------------------------------------------------
1635 wxLongLong
wxQTMediaBackend::GetDuration()
1637 return ::GetMovieDuration(m_movie
);
1640 //---------------------------------------------------------------------------
1641 // wxQTMediaBackend::Move
1644 //---------------------------------------------------------------------------
1645 wxMediaState
wxQTMediaBackend::GetState()
1647 if ( !m_timer
|| (m_timer
->IsRunning() == false &&
1648 m_timer
->GetPaused() == false) )
1649 return wxMEDIASTATE_STOPPED
;
1651 if( m_timer
->IsRunning() == true )
1652 return wxMEDIASTATE_PLAYING
;
1654 return wxMEDIASTATE_PAUSED
;
1657 //---------------------------------------------------------------------------
1658 // wxQTMediaBackend::Move
1661 //---------------------------------------------------------------------------
1662 void wxQTMediaBackend::Cleanup()
1668 DisposeMovie(m_movie
);
1671 //---------------------------------------------------------------------------
1672 // wxQTMediaBackend::Move
1675 //---------------------------------------------------------------------------
1676 wxSize
wxQTMediaBackend::GetVideoSize() const
1681 //---------------------------------------------------------------------------
1682 // wxQTMediaBackend::Move
1685 //---------------------------------------------------------------------------
1686 void wxQTMediaBackend::Move(int x
, int y
, int w
, int h
)
1690 Rect theRect
= {0, 0, h
, w
};
1692 ::SetMovieBox(m_movie
, &theRect
);
1693 wxASSERT(::GetMoviesError() == noErr
);
1697 //---------------------------------------------------------------------------
1698 // End QT Compilation Guard
1699 //---------------------------------------------------------------------------
1700 #endif //wxUSE_QUICKTIME
1702 //in source file that contains stuff you don't directly use
1703 #include <wx/html/forcelnk.h>
1704 FORCE_LINK_ME(basewxmediabackends
);
1706 //---------------------------------------------------------------------------
1707 // End wxMediaCtrl Compilation Guard and this file
1708 //---------------------------------------------------------------------------
1709 #endif //wxUSE_MEDIACTRL