From be96ed8c5dd17ece6effc679a48078270b577a92 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 27 Jan 2006 23:32:12 +0000 Subject: [PATCH] Further steps towards media control support in WinCE (Ryan Norton) - not yet working git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/wince/chkconf.h | 4 --- include/wx/msw/wince/setup.h | 2 +- src/msw/mediactrl.cpp | 56 +++++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/include/wx/msw/wince/chkconf.h b/include/wx/msw/wince/chkconf.h index e49897df72..dc3aebb872 100644 --- a/include/wx/msw/wince/chkconf.h +++ b/include/wx/msw/wince/chkconf.h @@ -40,10 +40,6 @@ #undef wxUSE_ON_FATAL_EXCEPTION #define wxUSE_ON_FATAL_EXCEPTION 0 -// media stuff not supported under CE -#undef wxUSE_MEDIACTRL -#define wxUSE_MEDIACTRL 0 - #undef wxUSE_WXHTML_HELP #define wxUSE_WXHTML_HELP 0 diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index e198051435..0a2f18b8bf 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -470,7 +470,7 @@ // Default is 1. // // Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 +#define wxUSE_MEDIACTRL 0 // Use GStreamer for Unix (req a lot of dependancies) // diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index eaf5fdeda3..bc3d8cd3f0 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -1661,25 +1661,45 @@ bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, } #endif - // determine which (if any) media player interface - // is available - IMediaPlayer or IActiveMovie - if ( ::CoCreateInstance(CLSID_MediaPlayer, NULL, - CLSCTX_INPROC_SERVER, - IID_IMediaPlayer, (void**)&m_pMP) != 0 ) - { - if ( ::CoCreateInstance(CLSID_ActiveMovie, NULL, - CLSCTX_INPROC_SERVER, - IID_IActiveMovie, (void**)&m_pAM) != 0 ) - { - return false; - } +#ifdef __WXWINCE__ + CLSID clsid; + if (CLSIDFromProgID(wxT("WPCEOCX.WMP"), &clsid) != S_OK && + CLSIDFromProgID(wxT("MediaPlayer.MediaPlayer.1"), &clsid) != S_OK) + return false; - m_pAM->QueryInterface(IID_IMediaPlayer, (void**)&m_pMP); - } - else - { - m_pMP->QueryInterface(IID_IActiveMovie, (void**)&m_pAM); - } + // determine which (if any) media player interface + // is available - IMediaPlayer or IActiveMovie + if ( ::CoCreateInstance(clsid, NULL, + CLSCTX_INPROC_SERVER, + IID_IMediaPlayer, (void**)&m_pMP) != 0 ) + { + return false; + } + else + { + m_pMP->QueryInterface(IID_IActiveMovie, (void**)&m_pAM); + } +#else + // determine which (if any) media player interface + // is available - IMediaPlayer or IActiveMovie + if ( ::CoCreateInstance(CLSID_MediaPlayer, NULL, + CLSCTX_INPROC_SERVER, + IID_IMediaPlayer, (void**)&m_pMP) != 0 ) + { + if ( ::CoCreateInstance(CLSID_ActiveMovie, NULL, + CLSCTX_INPROC_SERVER, + IID_IActiveMovie, (void**)&m_pAM) != 0 ) + { + return false; + } + + m_pAM->QueryInterface(IID_IMediaPlayer, (void**)&m_pMP); + } + else + { + m_pMP->QueryInterface(IID_IActiveMovie, (void**)&m_pAM); + } +#endif // Create window // By default wxWindow(s) is created with a border - -- 2.47.2