X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/226ec5a71a9b3f82591c0d1557ce1639a8f615d1..52069700e7f9c4cc1fc4379306e9f763c5b83073:/src/msw/mediactrl.cpp diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index 80521b517b..a6c9f7e610 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -43,9 +43,9 @@ //--------------------------------------------------------------------------- extern "C" WXDLLIMPEXP_BASE HINSTANCE wxGetInstance(void); #ifdef __WXWINCE__ -extern wxChar *wxCanvasClassName; +extern WXDLLIMPEXP_CORE wxChar *wxCanvasClassName; #else -extern const wxChar *wxCanvasClassName; +extern WXDLLIMPEXP_CORE const wxChar *wxCanvasClassName; #endif //=========================================================================== @@ -68,7 +68,7 @@ extern const wxChar *wxCanvasClassName; //--------------------------------------------------------------------------- #include -class wxAMMediaBackend : public wxMediaBackend +class WXDLLIMPEXP_MEDIA wxAMMediaBackend : public wxMediaBackend { public: wxAMMediaBackend(); @@ -141,7 +141,7 @@ public: //--------------------------------------------------------------------------- #include -class wxMCIMediaBackend : public wxMediaBackend +class WXDLLIMPEXP_MEDIA wxMCIMediaBackend : public wxMediaBackend { public: @@ -206,7 +206,7 @@ public: #include //Windoze QT include #include //Standard QT stuff -class wxQTMediaBackend : public wxMediaBackend +class WXDLLIMPEXP_MEDIA wxQTMediaBackend : public wxMediaBackend { public: @@ -336,7 +336,7 @@ wxAMMediaBackend::~wxAMMediaBackend() // wxAMMediaBackend::CreateControl // // ActiveMovie does not really have any native control to speak of, -// so we just create a normal control with a black background. +// so we just create a normal control. // // We also check to see if ActiveMovie is installed //--------------------------------------------------------------------------- @@ -368,15 +368,10 @@ bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, // is a child window, it refereshes properly // if ( !ctrl->wxControl::Create(parent, id, pos, size, - (style | wxNO_BORDER) | wxCLIP_CHILDREN, + (style & ~wxBORDER_MASK) | wxBORDER_NONE | wxCLIP_CHILDREN, validator, name) ) return false; - // - //Set our background color to black by default - // - ctrl->SetBackgroundColour(*wxBLACK); - m_ctrl = ctrl; return true; } @@ -882,15 +877,10 @@ bool wxMCIMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, // is a child window, it refereshes properly // if ( !ctrl->wxControl::Create(parent, id, pos, size, - (style & ~wxBORDER_MASK) | wxCLIP_CHILDREN, + (style & ~wxBORDER_MASK) | wxBORDER_NONE | wxCLIP_CHILDREN, validator, name) ) return false; - // - //Set our background color to black by default - // - ctrl->SetBackgroundColour(*wxBLACK); - m_ctrl = ctrl; return true; } @@ -982,6 +972,8 @@ bool wxMCIMediaBackend::Load(const wxString& fileName) ::SetWindowLong(m_hNotifyWnd, GWL_USERDATA, (LONG) this); + m_ctrl->Show(false); + // //Here, if the parent of the control has a sizer - we //tell it to recalculate the size of this control since @@ -1022,8 +1014,13 @@ bool wxMCIMediaBackend::Play() MCI_PLAY_PARMS playParms; playParms.dwCallback = (DWORD)m_hNotifyWnd; - return ( mciSendCommand(m_hDev, MCI_PLAY, MCI_NOTIFY, + bool bOK = ( mciSendCommand(m_hDev, MCI_PLAY, MCI_NOTIFY, (DWORD)(LPVOID)&playParms) == 0 ); + + if(bOK) + m_ctrl->Show(m_bVideo); + + return bOK; } //--------------------------------------------------------------------------- @@ -1083,7 +1080,13 @@ bool wxMCIMediaBackend::SetPosition(wxLongLong where) { MCI_SEEK_PARMS seekParms; seekParms.dwCallback = 0; +#if wxUSE_LONGLONG_NATIVE && !wxUSE_LONGLONG_WX seekParms.dwTo = (DWORD)where.GetValue(); +#else /* wxUSE_LONGLONG_WX */ + /* no way to return it in one piece */ + wxASSERT( where.GetHi()==0 ); + seekParms.dwTo = (DWORD)where.GetLo(); +#endif /* wxUSE_LONGLONG_* */ //device was playing? bool bReplay = GetState() == wxMEDIASTATE_PLAYING; @@ -1384,15 +1387,10 @@ bool wxQTMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, // backends, we don't need wxCLIP_CHILDREN // if ( !ctrl->wxControl::Create(parent, id, pos, size, - (style & ~wxBORDER_MASK), + (style & ~wxBORDER_MASK) | wxBORDER_NONE, validator, name) ) return false; - // - //Set our background color to black by default - // - ctrl->SetBackgroundColour(*wxBLACK); - m_ctrl = ctrl; return true; } @@ -1618,9 +1616,10 @@ bool wxQTMediaBackend::SetPosition(wxLongLong where) } //--------------------------------------------------------------------------- -// wxQTMediaBackend::Move +// wxQTMediaBackend::GetPosition // -// TODO +// 1) Calls GetMovieTime to get the position we are in in the movie +// in milliseconds (we called //--------------------------------------------------------------------------- wxLongLong wxQTMediaBackend::GetPosition() {