]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mediactrl.cpp
Reverted semicolons patch
[wxWidgets.git] / src / msw / mediactrl.cpp
index 7020198882e908fd610b937b990c441cb2b79e0d..7384442f50a9f68763d9a810ca6201d42088f575 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        msw/mediactrl.cpp
+// Name:        src/msw/mediactrl.cpp
 // Purpose:     Built-in Media Backends for Windows
 // Author:      Ryan Norton <wxprojects@comcast.net>
 // Modified by:
 // Pre-compiled header stuff
 //---------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "mediactrl.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -165,23 +161,23 @@ struct IMediaEvent : public IDispatch
 
 enum ReadyStateConstants
 {
-    amvUninitialized    = 0,
-    amvLoading    = 1,
+    amvUninitialized  = 0,
+    amvLoading        = 1,
     amvInteractive    = 3,
-    amvComplete    = 4
+    amvComplete       = 4
 };
 
 enum StateConstants
 {
     amvNotLoaded    = -1,
-    amvStopped    = 0,
-    amvPaused    = 1,
-    amvRunning    = 2
+    amvStopped      = 0,
+    amvPaused       = 1,
+    amvRunning      = 2
 };
 
 enum DisplayModeConstants
 {
-    amvTime    = 0,
+    amvTime      = 0,
     amvFrames    = 1
 };
 
@@ -1354,7 +1350,7 @@ public:
         m_hwnd = hwnd;
 
         m_qtb->m_ctrl->Connect(m_qtb->m_ctrl->GetId(),
-            wxEVT_ERASE_BACKGROUND, 
+            wxEVT_ERASE_BACKGROUND,
             wxEraseEventHandler(wxQTMediaEvtHandler::OnEraseBackground),
             NULL, this
                               );
@@ -1380,7 +1376,7 @@ private:
 //
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend, wxMediaBackend);
+IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend, wxMediaBackend)
 
 //---------------------------------------------------------------------------
 // Usual debugging macros
@@ -1616,7 +1612,10 @@ wxAMMediaBackend::~wxAMMediaBackend()
 
     if(m_pAX)
     {
-        m_pAX->DissociateHandle();
+        {
+            wxLogNull noLog;
+            m_pAX->DissociateHandle();
+        }
         delete m_pAX;
         m_pAM->Release();
 
@@ -1633,7 +1632,10 @@ wxAMMediaBackend::~wxAMMediaBackend()
 void wxAMMediaBackend::Clear()
 {
     if(m_pTimer)
+    {
         delete m_pTimer;
+        m_pTimer = NULL;
+    }
 }
 
 //---------------------------------------------------------------------------
@@ -1874,33 +1876,7 @@ bool wxAMMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags)
 //---------------------------------------------------------------------------
 bool wxAMMediaBackend::Play()
 {
-    // if the movie isn't done loading yet
-    // go into an sync getmessage loop until it is :)
-    if(m_pMP)
-    {
-        MPReadyStateConstants nState;
-        m_pMP->get_ReadyState(&nState);
-        while(nState == mpReadyStateLoading && wxYieldIfNeeded())
-        {
-          m_pMP->get_ReadyState(&nState);
-        }
-    }
-    else
-    {
-        IActiveMovie2* pAM2;
-        ReadyStateConstants nState;
-        if(m_pAM->QueryInterface(IID_IActiveMovie2, (void**)&pAM2) == 0 &&
-            pAM2->get_ReadyState(&nState) == 0)
-        {
-            while(nState == amvLoading && wxYieldIfNeeded())
-            {
-                pAM2->get_ReadyState(&nState);
-            }
-            pAM2->Release();
-        }
-    }
-
-    //Actually try to play the movie
+    // Actually try to play the movie, even though it may not be loaded yet.
     HRESULT hr = m_pAM->Run();
     if(SUCCEEDED(hr))
     {
@@ -2184,7 +2160,7 @@ void wxAMMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y),
 //
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-IMPLEMENT_DYNAMIC_CLASS(wxMCIMediaBackend, wxMediaBackend);
+IMPLEMENT_DYNAMIC_CLASS(wxMCIMediaBackend, wxMediaBackend)
 
 //---------------------------------------------------------------------------
 // Usual debugging macros for MCI returns
@@ -2712,7 +2688,7 @@ LRESULT CALLBACK wxMCIMediaBackend::OnNotifyWndProc(HWND hWnd, UINT nMsg,
 // with this backend are treated as playable anyway - not verifyed though.
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend, wxMediaBackend);
+IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend, wxMediaBackend)
 
 //Time between timer calls - this is the Apple recommondation to the TCL
 //team I believe
@@ -3540,12 +3516,10 @@ void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent& evt)
 //---------------------------------------------------------------------------
 
 //in source file that contains stuff you don't directly use
-#include <wx/html/forcelnk.h>
-FORCE_LINK_ME(basewxmediabackends);
+#include "wx/html/forcelnk.h"
+FORCE_LINK_ME(basewxmediabackends)
 
 //---------------------------------------------------------------------------
 //  End wxMediaCtrl Compilation Guard and this file
 //---------------------------------------------------------------------------
 #endif //wxUSE_MEDIACTRL
-
-