Massive reworking of wxMediaCtrl code - backend everything, search for backends via RTTI lookup, and more

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ryan Norton
2004-11-14 23:26:55 +00:00
parent 6f4a67aca8
commit ff4aedc554
17 changed files with 2879 additions and 1265 deletions

View File

@@ -1,120 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/moviectrl.h
// Purpose: wxMediaCtrl mac
// 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_MEDIACTRL
#include "wx/control.h"
#include "wx/uri.h"
#ifdef __WXMSW__
typedef struct MovieRecord* WXMOVIE;
#else
typedef struct MovieType** WXMOVIE;
#endif
enum wxMediaState
{
wxMEDIASTATE_STOPPED,
wxMEDIASTATE_PAUSED,
wxMEDIASTATE_PLAYING
};
class wxMediaCtrl : public wxControl
{
public:
wxMediaCtrl() : m_bLoaded(false)
{ }
wxMediaCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, long driver = 0, const wxString& name = wxPanelNameStr) : m_bLoaded(false)
{ Create(parent, id, fileName, pos, size, style, driver, name); }
wxMediaCtrl(wxWindow* parent, wxWindowID id, const wxURI& location,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, long driver = 0, const wxString& name = wxPanelNameStr) : m_bLoaded(false)
{ Create(parent, id, location, pos, size, style, driver, name); }
~wxMediaCtrl();
bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, long driver = 0, const wxString& name = wxPanelNameStr);
bool Create(wxWindow* parent, wxWindowID id, const wxURI& location,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, long driver = 0, const wxString& name = wxPanelNameStr);
bool Play();
bool Pause();
bool Stop();
bool Load(const wxString& fileName);
bool Load(const wxURI& location);
wxMediaState GetState();
double GetPlaybackRate();
bool SetPlaybackRate(double dRate);
bool SetPosition(long where);
long GetPosition();
long GetDuration();
protected:
virtual void DoMoveWindow(int x, int y, int w, int h);
bool DoCreate(wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
long style, const wxString& name);
wxSize DoGetBestSize() const;
bool InitQT();
void Cleanup();
void FinishLoad();
bool m_bLoaded;
WXMOVIE m_movie;
wxSize m_bestSize;
class _wxQTTimer* m_timer;
friend class _wxQTTimer;
DECLARE_DYNAMIC_CLASS(wxMediaCtrl);
};
//Event stuff
class WXDLLEXPORT wxMediaEvent : public wxNotifyEvent
{
public:
wxMediaEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
: wxNotifyEvent(commandType, id)
{ }
wxMediaEvent(const wxMediaEvent &clone)
: wxNotifyEvent(clone.GetEventType(), clone.GetId())
{ }
virtual wxEvent *Clone() const { return new wxMediaEvent(*this); }
DECLARE_DYNAMIC_CLASS(wxMediaEvent)
};
#define wxMEDIA_FINISHED_ID 13000
DECLARE_EVENT_TYPE(wxEVT_MEDIA_FINISHED, wxMEDIA_FINISHED_ID)
typedef void (wxEvtHandler::*wxMediaEventFunction)(wxMediaEvent&);
#define EVT_MEDIA_FINISHED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxMediaEventFunction) & fn, (wxObject *) NULL ),
#endif // wxUSE_MOVIECTRL