1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for the wxMediaCtrl
7 // Created: 23-Nov-2004
9 // Copyright: (c) 2004 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
14 "Classes for a medai player control"
17 %module(package="wx", docstring=DOCSTRING) media
21 #include "wx/wxPython/wxPython.h"
22 #include "wx/wxPython/pyclasses.h"
24 #include <wx/mediactrl.h>
28 //----------------------------------------------------------------------
31 %pythoncode { wx = _core }
32 %pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
34 %include _media_rename.i
36 //---------------------------------------------------------------------------
38 %typemap(in) wxLongLong {
39 $1 = PyLong_AsLongLong($input);
43 %typemap(out) wxLongLong {
44 $result = PyLong_FromLongLong($1.GetValue());
47 //---------------------------------------------------------------------------
48 // Make a stubbed out class for platforms that don't have wxMediaCtrl
53 wxMEDIASTATE_STOPPED=0,
54 wxMEDIASTATE_PAUSED=0,
55 wxMEDIASTATE_PLAYING=0
58 enum wxMediaTimeFormat
60 wxMEDIATIMEFORMAT_TIME=0
63 class wxMediaEvent : public wxNotifyEvent
66 wxMediaEvent(wxEventType, int ) { wxPyRaiseNotImplemented(); }
69 class wxMediaCtrl : public wxControl
72 wxMediaCtrl() { wxPyRaiseNotImplemented(); }
74 wxMediaCtrl(wxWindow* , wxWindowID ,
81 const wxString& ) { wxPyRaiseNotImplemented(); }
83 wxMediaCtrl(wxWindow* ,
91 const wxString& ) { wxPyRaiseNotImplemented(); }
93 bool Create(wxWindow* , wxWindowID ,
100 const wxString& ) { return false; }
102 bool Create(wxWindow* ,
110 const wxString& ) { return false; }
112 bool Play() { return false; }
113 bool Pause() { return false; }
114 bool Stop() { return false; }
116 bool Load(const wxString& fileName) { return false; }
117 bool Load(const wxURI& location) { return false; }
119 void Loop(bool bLoop = true) {}
120 bool IsLooped() { return false; }
122 wxMediaState GetState() { return wxMEDIASTATE_STOPPED; }
124 double GetPlaybackRate() { return 0.0; };
125 bool SetPlaybackRate(double dRate) { return false; }
127 bool SetPosition(wxLongLong where) { return false; }
128 wxLongLong GetPosition() { return 0; }
129 wxLongLong GetDuration() { return 0; }
132 const wxEventType wxEVT_MEDIA_FINISHED = 0;
133 const wxEventType wxEVT_MEDIA_STOP = 0;
140 //---------------------------------------------------------------------------
144 wxMEDIASTATE_STOPPED,
149 enum wxMediaTimeFormat
151 wxMEDIATIMEFORMAT_TIME
155 // MAKE_CONST_WXSTRING(MEDIABACKEND_DIRECTSHOW);
156 // MAKE_CONST_WXSTRING(MEDIABACKEND_MCI );
157 // MAKE_CONST_WXSTRING(MEDIABACKEND_QUICKTIME );
159 //---------------------------------------------------------------------------
161 class wxMediaEvent : public wxNotifyEvent
164 wxMediaEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
168 //---------------------------------------------------------------------------
170 MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
171 MAKE_CONST_WXSTRING2(MediaCtrlNameStr, wxT("mediaCtrl"));
172 MustHaveApp(wxMediaCtrl);
175 class wxMediaCtrl : public wxControl
178 %pythonAppend wxMediaCtrl "self._setOORInfo(self)"
179 %pythonAppend wxMediaCtrl() ""
182 wxMediaCtrl(wxWindow* parent,
184 const wxString& fileName = wxPyEmptyString,
185 const wxPoint& pos = wxDefaultPosition,
186 const wxSize& size = wxDefaultSize,
188 const wxString& szBackend = wxPyEmptyString,
189 const wxValidator& validator = wxDefaultValidator,
190 const wxString& name = wxPyMediaCtrlNameStr);
192 %name(PreMediaCtrl) wxMediaCtrl();
195 %name(MediaCtrlFromURI)
196 wxMediaCtrl(wxWindow* parent,
198 const wxString& location=wxPyEmptyString,
199 const wxPoint& pos = wxDefaultPosition,
200 const wxSize& size = wxDefaultSize,
202 const wxString& szBackend = wxPyEmptyString,
203 const wxValidator& validator = wxDefaultValidator,
204 const wxString& name = wxPyMediaCtrlNameStr)
206 return new wxMediaCtrl(parent, id, wxURI(location),
207 pos, size, style, szBackend, validator, name);
210 bool CreateFromURI(wxWindow* parent,
212 const wxString& location=wxPyEmptyString,
213 const wxPoint& pos = wxDefaultPosition,
214 const wxSize& size = wxDefaultSize,
216 const wxString& szBackend = wxPyEmptyString,
217 const wxValidator& validator = wxDefaultValidator,
218 const wxString& name = wxPyMediaCtrlNameStr)
220 return self->Create(parent, id, wxURI(location),
221 pos, size, style, szBackend, validator, name);
226 bool Create(wxWindow* parent,
228 const wxString& fileName = wxPyEmptyString,
229 const wxPoint& pos = wxDefaultPosition,
230 const wxSize& size = wxDefaultSize,
232 const wxString& szBackend = wxPyEmptyString,
233 const wxValidator& validator = wxDefaultValidator,
234 const wxString& name = wxPyMediaCtrlNameStr);
241 bool Load(const wxString& fileName);
243 bool LoadFromURI(const wxString& location) {
244 return self->Load(wxURI(location));
248 void Loop(bool bLoop = true);
251 wxMediaState GetState();
253 double GetPlaybackRate();
254 bool SetPlaybackRate(double dRate);
256 %name(SetMediaPosition) bool SetPosition(wxLongLong where);
257 %name(GetMediaPosition) wxLongLong GetPosition();
258 %name(GetMediaDuration) wxLongLong GetDuration();
263 %constant wxEventType wxEVT_MEDIA_FINISHED;
264 %constant wxEventType wxEVT_MEDIA_STOP;
267 EVT_MEDIA_FINISHED = wx.PyEventBinder( wxEVT_MEDIA_FINISHED, 1)
268 EVT_MEDIA_STOP = wx.PyEventBinder( wxEVT_MEDIA_STOP, 1)
271 //---------------------------------------------------------------------------
276 //---------------------------------------------------------------------------