X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d7d3b1f9faf5116b2f1d5a95493054e88039775..950905affdfa9041316f82308e1a11e82c783070:/src/msw/mediactrl.cpp diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index 379cd88acd..1578d45777 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -27,27 +27,21 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -//--------------------------------------------------------------------------- -// MediaCtrl include -//--------------------------------------------------------------------------- +#if wxUSE_MEDIACTRL + #include "wx/mediactrl.h" -//--------------------------------------------------------------------------- -// Compilation guard -//--------------------------------------------------------------------------- -#if wxUSE_MEDIACTRL +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/dcclient.h" + #include "wx/timer.h" + #include "wx/math.h" // log10 & pow +#endif -//--------------------------------------------------------------------------- -// WX Includes -//--------------------------------------------------------------------------- -#include "wx/log.h" // wxLogDebug -#include "wx/math.h" // log10 & pow #include "wx/msw/private.h" // user info and wndproc setting/getting -#include "wx/dcclient.h" -#include "wx/timer.h" #include "wx/dynlib.h" //--------------------------------------------------------------------------- @@ -63,6 +57,15 @@ extern WXDLLIMPEXP_CORE const wxChar *wxCanvasClassName; LRESULT WXDLLIMPEXP_CORE APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +//--------------------------------------------------------------------------- +// Killed MSVC warnings +//--------------------------------------------------------------------------- +//disable "cast truncates constant value" for VARIANT_BOOL values +//passed as parameters in VC5 and up +#ifdef _MSC_VER +#pragma warning (disable:4310) +#endif + //=========================================================================== // BACKEND DECLARATIONS //=========================================================================== @@ -1504,7 +1507,7 @@ class WXDLLIMPEXP_MEDIA wxMCIMediaBackend : public wxMediaBackendCommonBase { public: wxMCIMediaBackend(); - ~wxMCIMediaBackend(); + virtual ~wxMCIMediaBackend(); virtual bool CreateControl(wxControl* ctrl, wxWindow* parent, wxWindowID id, @@ -1676,7 +1679,7 @@ enum #define wxDL_METHOD_LOAD( lib, name, success ) \ pfn_ ## name = (name ## Type) lib.GetSymbol( wxT(#name), &success ); \ - if (!success) { wxLog::EnableLogging(bWasLoggingEnabled); return false; } + if (!success) return false class WXDLLIMPEXP_MEDIA wxQuickTimeLibrary @@ -1790,12 +1793,12 @@ bool wxQuickTimeLibrary::Initialize() { m_ok = false; - // Turn off the wxDynamicLibrary logging - bool bWasLoggingEnabled = wxLog::EnableLogging(false); + // Turn off the wxDynamicLibrary logging as we're prepared to handle the + // errors + wxLogNull nolog; if (!m_dll.Load(wxT("qtmlClient.dll"))) { - wxLog::EnableLogging(bWasLoggingEnabled); return false; } @@ -1855,7 +1858,6 @@ bool wxQuickTimeLibrary::Initialize() wxDL_METHOD_LOAD( m_dll, EndUpdate, m_ok ); wxDL_METHOD_LOAD( m_dll, GetMoviesStickyError, m_ok ); - wxLog::EnableLogging(bWasLoggingEnabled); m_ok = true; return true; @@ -1865,7 +1867,7 @@ class WXDLLIMPEXP_MEDIA wxQTMediaBackend : public wxMediaBackendCommonBase { public: wxQTMediaBackend(); - ~wxQTMediaBackend(); + virtual ~wxQTMediaBackend(); virtual bool CreateControl(wxControl* ctrl, wxWindow* parent, wxWindowID id, @@ -1977,14 +1979,14 @@ wxString wxAMMediaBackend::GetErrorString(HRESULT hrdsv) { return wxString::Format(wxT("DirectShow error \"%s\" \n") wxT("(numeric %X)\n") - wxT("occured"), + wxT("occurred"), szError, (int)hrdsv); } else { return wxString::Format(wxT("Unknown error \n") wxT("(numeric %X)\n") - wxT("occured"), + wxT("occurred"), (int)hrdsv); } } @@ -1993,7 +1995,6 @@ wxString wxAMMediaBackend::GetErrorString(HRESULT hrdsv) #define wxVERIFY(x) wxASSERT((x)) #define wxAMLOG(x) wxLogDebug(GetErrorString(x)) #else -#define wxAMVERIFY(x) (x) #define wxVERIFY(x) (x) #define wxAMLOG(x) #define wxAMFAIL(x) @@ -2132,7 +2133,7 @@ public: pGB->Release(); } - ~wxAMPlayTimer() + virtual ~wxAMPlayTimer() { SAFE_RELEASE(m_pME); } @@ -3338,9 +3339,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend, wxMediaBackend) // team I believe #define MOVIE_DELAY 20 -#include "wx/timer.h" - - //--------------------------------------------------------------------------- // wxQTLoadTimer // @@ -4171,7 +4169,4 @@ void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent& evt) #include "wx/html/forcelnk.h" FORCE_LINK_ME(basewxmediabackends) -//--------------------------------------------------------------------------- -// End wxMediaCtrl Compilation Guard and this file -//--------------------------------------------------------------------------- #endif //wxUSE_MEDIACTRL