wxMovieCtrl - for playing movies - mac carbon QT 3 MSW-compatable implementation and MSW DirectX7 directshow implementation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30332 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ryan Norton
2004-11-07 08:27:51 +00:00
parent 9b621a7f7a
commit 4ad7af2b83
5 changed files with 759 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/moviectrl.h
// Purpose: DirectX7+ wxMovieCtrl MSW
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// Created: 11/07/04
// RCS-ID: $Id$
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/defs.h"
#if wxUSE_MOVIECTRL
#include "wx/datetime.h"
enum wxMovieCtrlState
{
wxMOVIECTRL_STOPPED,
wxMOVIECTRL_PAUSED,
wxMOVIECTRL_PLAYING
};
class wxMovieCtrl : public wxControl
{
public:
wxMovieCtrl()
{ }
wxMovieCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName, const wxString& label = wxT(""),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxPanelNameStr)
{ Create(parent, id, fileName, label, pos, size, style, name); }
~wxMovieCtrl();
bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName, const wxString& label = wxT(""),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxPanelNameStr);
bool Play();
bool Pause();
bool Stop();
wxMovieCtrlState GetState();
#if wxUSE_DATETIME
bool Seek(const wxTimeSpan& where);
#endif
virtual void SetLabel(const wxString& label);
protected:
void OnSize(wxSizeEvent& evt);
wxSize DoGetBestSize() const;
bool InitQT();
struct MovieRecord* m_movie;
wxSize m_bestSize;
class _wxQTTimer* m_timer;
DECLARE_DYNAMIC_CLASS(wxMovieCtrl);
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_MOVIECTRL

16
include/wx/moviectrl.h Normal file
View File

@@ -0,0 +1,16 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/moviectrl.h
// Purpose: wxMovieCtrl class
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// Created: 11/07/04
// RCS-ID: $Id$
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if defined(__WXMSW__)
#include "wx/msw/moviectrl.h"
#elif defined(__WXMAC__)
#include "wx/mac/carbon/moviectrl.h"
#endif

View File

@@ -0,0 +1,77 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/moviectrl.h
// Purpose: DirectX7+ wxMovieCtrl MSW
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// Created: 11/07/04
// RCS-ID: $Id$
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/defs.h"
#if wxUSE_MOVIECTRL
#include "wx/datetime.h"
enum wxMovieCtrlState
{
wxMOVIECTRL_STOPPED,
wxMOVIECTRL_PAUSED,
wxMOVIECTRL_PLAYING
};
class wxMovieCtrl : public wxControl
{
public:
wxMovieCtrl()
{ }
wxMovieCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName, const wxString& label = wxT(""),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxPanelNameStr)
{ Create(parent, id, fileName, label, pos, size, style, name); }
~wxMovieCtrl();
bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName, const wxString& label = wxT(""),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxPanelNameStr);
bool Play();
bool Pause();
bool Stop();
wxMovieCtrlState GetState();
#if wxUSE_DATETIME
bool Seek(const wxTimeSpan& where);
#endif
virtual void SetLabel(const wxString& label);
protected:
void OnSize(wxSizeEvent& evt);
wxSize DoGetBestSize() const;
// void OnActivate(wxActivateEvent& evt);
//msw-specific - we need to overload the window proc
// WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
void* m_pGB;
void* m_pMC;
void* m_pME;
void* m_pVW;
void* m_pBA;
void* m_pBV;
void* m_pMS;
wxSize m_bestSize;
DECLARE_DYNAMIC_CLASS(wxMovieCtrl);
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_MOVIECTRL