minor changes as per RN comments - add some comments and reorder a switch stmt.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1470,14 +1470,14 @@ public:
|
|||||||
#ifdef __WXWINCE__
|
#ifdef __WXWINCE__
|
||||||
IWMP* m_pWMP;
|
IWMP* m_pWMP;
|
||||||
|
|
||||||
IWMP* GetMP() {return m_pWMP;}
|
IWMP* GetMP() { return m_pWMP; }
|
||||||
IWMP* GetAM() {return m_pWMP;}
|
IWMP* GetAM() { return m_pWMP; }
|
||||||
#else
|
#else
|
||||||
IActiveMovie* m_pAM;
|
IActiveMovie* m_pAM;
|
||||||
IMediaPlayer* m_pMP;
|
IMediaPlayer* m_pMP;
|
||||||
|
|
||||||
IMediaPlayer* GetMP() {return m_pMP;}
|
IMediaPlayer* GetMP() { return m_pMP; }
|
||||||
IActiveMovie* GetAM() {return m_pAM;}
|
IActiveMovie* GetAM() { return m_pAM; }
|
||||||
#endif
|
#endif
|
||||||
wxTimer* m_pTimer;
|
wxTimer* m_pTimer;
|
||||||
wxSize m_bestSize;
|
wxSize m_bestSize;
|
||||||
@@ -1912,7 +1912,7 @@ public:
|
|||||||
static void PPRMProc (Movie theMovie, OSErr theErr, void* theRefCon);
|
static void PPRMProc (Movie theMovie, OSErr theErr, void* theRefCon);
|
||||||
|
|
||||||
// TODO: Last param actually long - does this work on 64bit machines?
|
// TODO: Last param actually long - does this work on 64bit machines?
|
||||||
static Boolean MCFilterProc (MovieController theController,
|
static Boolean MCFilterProc(MovieController theController,
|
||||||
short action, void *params, LONG_PTR refCon);
|
short action, void *params, LONG_PTR refCon);
|
||||||
|
|
||||||
static LRESULT CALLBACK QTWndProc(HWND, UINT, WPARAM, LPARAM);
|
static LRESULT CALLBACK QTWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
@@ -2086,10 +2086,9 @@ public:
|
|||||||
void Notify()
|
void Notify()
|
||||||
{
|
{
|
||||||
// NB: Stop events could get triggered by the interface
|
// NB: Stop events could get triggered by the interface
|
||||||
// if ShowPlayerControls is enabled,
|
// if ShowPlayerControls is enabled, so the "GetPosition == GetDuration"
|
||||||
// so we need this hack here to make an attempt
|
// hack is needed here to make an attempt at it not getting sent
|
||||||
// at it not getting sent - but its far from ideal -
|
// - but its far from ideal - they can still get sent in some cases
|
||||||
// they can still get sent in some cases
|
|
||||||
if (m_parent->GetState() == wxMEDIASTATE_STOPPED &&
|
if (m_parent->GetState() == wxMEDIASTATE_STOPPED &&
|
||||||
m_parent->GetPosition() == m_parent->GetDuration())
|
m_parent->GetPosition() == m_parent->GetDuration())
|
||||||
{
|
{
|
||||||
@@ -2319,12 +2318,12 @@ bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
|
|||||||
{
|
{
|
||||||
GetMP()->put_DisplaySize(mpFitToSize);
|
GetMP()->put_DisplaySize(mpFitToSize);
|
||||||
|
|
||||||
#ifndef __WXWINCE__ //Not in CE's IWMP
|
#ifndef __WXWINCE__ // Not in CE's IWMP
|
||||||
// TODO: Unsure what actual effect this has
|
// TODO: Unsure what actual effect this has
|
||||||
GetMP()->put_WindowlessVideo(VARIANT_TRUE);
|
GetMP()->put_WindowlessVideo(VARIANT_TRUE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef __WXWINCE__ //Not in CE's IWMP
|
#ifndef __WXWINCE__ // Not in CE's IWMP
|
||||||
else
|
else
|
||||||
GetAM()->put_MovieWindowSize(amvDoubleOriginalSize);
|
GetAM()->put_MovieWindowSize(amvDoubleOriginalSize);
|
||||||
#endif
|
#endif
|
||||||
@@ -2438,7 +2437,7 @@ bool wxAMMediaBackend::DoLoad(const wxString& location)
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void wxAMMediaBackend::FinishLoad()
|
void wxAMMediaBackend::FinishLoad()
|
||||||
{
|
{
|
||||||
//Get the original video size
|
// Get the original video size
|
||||||
GetAM()->get_ImageSourceWidth((long*)&m_bestSize.x);
|
GetAM()->get_ImageSourceWidth((long*)&m_bestSize.x);
|
||||||
GetAM()->get_ImageSourceHeight((long*)&m_bestSize.y);
|
GetAM()->get_ImageSourceHeight((long*)&m_bestSize.y);
|
||||||
|
|
||||||
@@ -2563,8 +2562,7 @@ bool wxAMMediaBackend::Stop()
|
|||||||
bool wxAMMediaBackend::SetPosition(wxLongLong where)
|
bool wxAMMediaBackend::SetPosition(wxLongLong where)
|
||||||
{
|
{
|
||||||
HRESULT hr = GetAM()->put_CurrentPosition(
|
HRESULT hr = GetAM()->put_CurrentPosition(
|
||||||
((LONGLONG)where.GetValue()) / 1000.0
|
((LONGLONG)where.GetValue()) / 1000.0 );
|
||||||
);
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
wxAMLOG(hr);
|
wxAMLOG(hr);
|
||||||
@@ -4014,14 +4012,14 @@ bool wxQTMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags)
|
|||||||
// mcScaleMovieToFit |
|
// mcScaleMovieToFit |
|
||||||
// mcWithBadge |
|
// mcWithBadge |
|
||||||
mcWithFrame);
|
mcWithFrame);
|
||||||
m_lib.MCDoAction(m_pMC, 32, (void*)true); //mcActionSetKeysEnabled
|
m_lib.MCDoAction(m_pMC, 32, (void*)true); // mcActionSetKeysEnabled
|
||||||
m_lib.MCSetActionFilterWithRefCon(m_pMC,
|
m_lib.MCSetActionFilterWithRefCon(m_pMC,
|
||||||
(WXFARPROC)wxQTMediaBackend::MCFilterProc, (void*)this);
|
(WXFARPROC)wxQTMediaBackend::MCFilterProc, (void*)this);
|
||||||
m_bestSize.y += 16; // movie controller height
|
m_bestSize.y += 16; // movie controller height
|
||||||
|
|
||||||
// By default the movie controller uses its own colour palette
|
// By default the movie controller uses its own colour palette
|
||||||
// for the movie which can be bad on some files, so turn it off.
|
// for the movie which can be bad on some files, so turn it off.
|
||||||
// Also turn off its frame/border for the movie
|
// Also turn off its frame / border for the movie
|
||||||
// Also take care of a couple of the interface flags here
|
// Also take care of a couple of the interface flags here
|
||||||
long mcFlags = 0;
|
long mcFlags = 0;
|
||||||
m_lib.MCDoAction(m_pMC, 39/*mcActionGetFlags*/, (void*)&mcFlags);
|
m_lib.MCDoAction(m_pMC, 39/*mcActionGetFlags*/, (void*)&mcFlags);
|
||||||
@@ -4061,10 +4059,18 @@ Boolean wxQTMediaBackend::MCFilterProc(MovieController WXUNUSED(theController),
|
|||||||
void * WXUNUSED(params),
|
void * WXUNUSED(params),
|
||||||
LONG_PTR refCon)
|
LONG_PTR refCon)
|
||||||
{
|
{
|
||||||
|
// NB: potential optimisation
|
||||||
|
// if (action == 1)
|
||||||
|
// return 0;
|
||||||
|
|
||||||
wxQTMediaBackend* pThis = (wxQTMediaBackend*)refCon;
|
wxQTMediaBackend* pThis = (wxQTMediaBackend*)refCon;
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
case 1:
|
||||||
|
// don't process idle events
|
||||||
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
// play button triggered - MC will set movie to opposite state
|
// play button triggered - MC will set movie to opposite state
|
||||||
// of current - playing ? paused : playing
|
// of current - playing ? paused : playing
|
||||||
@@ -4078,10 +4084,6 @@ Boolean wxQTMediaBackend::MCFilterProc(MovieController WXUNUSED(theController),
|
|||||||
// to help this unfortunately
|
// to help this unfortunately
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
|
||||||
// don't process idle events
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user