]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/mediactrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/mediactrl.h
3 // Purpose: DirectX7+ wxMediaCtrl MSW
4 // Author: Ryan Norton <wxprojects@comcast.net>
8 // Copyright: (c) Ryan Norton
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #include "wx/control.h"
26 class wxMediaCtrl
: public wxControl
29 wxMediaCtrl() : m_imp(NULL
)
32 wxMediaCtrl(wxWindow
* parent
, wxWindowID id
, const wxString
& fileName
,
33 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
34 long style
= 0, long driver
= 0, const wxString
& name
= wxPanelNameStr
) : m_imp(NULL
)
35 { Create(parent
, id
, fileName
, pos
, size
, style
, driver
, name
); }
38 wxMediaCtrl(wxWindow
* parent
, wxWindowID id
, const wxURI
& location
,
39 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
40 long style
= 0, long driver
= 0, const wxString
& name
= wxPanelNameStr
) : m_imp(NULL
)
41 { Create(parent
, id
, location
, pos
, size
, style
, driver
, name
); }
45 bool Create(wxWindow
* parent
, wxWindowID id
, const wxString
& fileName
,
46 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
47 long style
= 0, long driver
= 0, const wxString
& name
= wxPanelNameStr
);
49 bool Create(wxWindow
* parent
, wxWindowID id
, const wxURI
& location
,
50 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
51 long style
= 0, long driver
= 0, const wxString
& name
= wxPanelNameStr
);
57 bool Load(const wxString
& fileName
);
58 bool Load(const wxURI
& location
);
60 wxMediaState
GetState();
62 double GetPlaybackRate();
63 bool SetPlaybackRate(double dRate
);
65 bool SetPosition(long where
);
70 virtual void DoMoveWindow(int x
, int y
, int w
, int h
);
71 wxSize
DoGetBestSize() const;
73 //msw-specific - we need to overload the window proc
74 WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
76 class wxMediaCtrlImpl
* m_imp
;
79 DECLARE_DYNAMIC_CLASS(wxMediaCtrl
);
83 class WXDLLEXPORT wxMediaEvent
: public wxNotifyEvent
86 wxMediaEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0)
87 : wxNotifyEvent(commandType
, id
)
90 wxMediaEvent(const wxMediaEvent
&clone
)
91 : wxNotifyEvent(clone
.GetEventType(), clone
.GetId())
94 wxEvent
*Clone() { return new wxMediaEvent(*this); }
96 DECLARE_DYNAMIC_CLASS(wxMediaEvent
)
99 #define wxMEDIA_FINISHED_ID 13000
100 DECLARE_EVENT_TYPE(wxEVT_MEDIA_FINISHED
, wxMEDIA_FINISHED_ID
)
101 typedef void (wxEvtHandler::*wxMediaEventFunction
)(wxMediaEvent
&);
102 #define EVT_MEDIA_FINISHED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxMediaEventFunction) & fn, (wxObject *) NULL ),
104 #endif // wxUSE_MEDIACTRL