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>
27 //----------------------------------------------------------------------
30 %pythoncode { wx = _core }
31 %pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
33 %include _media_rename.i
35 //---------------------------------------------------------------------------
37 %typemap(in) wxLongLong {
38 $1 = PyLong_AsLongLong($input);
42 %typemap(out) wxLongLong {
43 $result = PyLong_FromLongLong($1.GetValue());
46 //---------------------------------------------------------------------------
47 // Make a stubbed out class for platforms that don't have wxMediaCtrl
52 wxMEDIASTATE_STOPPED=0,
53 wxMEDIASTATE_PAUSED=0,
54 wxMEDIASTATE_PLAYING=0
57 enum wxMediaTimeFormat
59 wxMEDIATIMEFORMAT_TIME=0
62 class WXDLLIMPEXP_MEDIA wxMediaEvent : public wxNotifyEvent
65 wxMediaEvent(wxEventTypL, int ) { wxPyRaiseNotImplemented(); }
68 class wxMediaCtrl : public wxControl
71 wxMediaCtrl() { wxPyRaiseNotImplemented(); }
73 wxMediaCtrl(wxWindow* , wxWindowID ,
80 const wxString& ) { wxPyRaiseNotImplemented(); }
82 wxMediaCtrl(wxWindow* ,
90 const wxString& ) { wxPyRaiseNotImplemented(); }
92 bool Create(wxWindow* , wxWindowID ,
99 const wxString& ) { return false; }
101 bool Create(wxWindow* ,
109 const wxString& ) { return false; }
111 bool Play() { return false; }
112 bool Pause() { return false; }
113 bool Stop() { return false; }
115 bool Load(const wxString& fileName) { return false; }
116 bool Load(const wxURI& location) { return false; }
118 void Loop(bool bLoop = true) {}
119 bool IsLooped() { return false; }
121 wxMediaState GetState() { return wxMEDIASTATE_STOPPED; }
123 double GetPlaybackRate() { return 0.0; };
124 bool SetPlaybackRate(double dRate) { return false; }
126 bool SetPosition(wxLongLong where) { return false; }
127 wxLongLong GetPosition() { return 0; }
128 wxLongLong GetDuration() { return 0; }
135 //---------------------------------------------------------------------------
139 wxMEDIASTATE_STOPPED,
144 enum wxMediaTimeFormat
146 wxMEDIATIMEFORMAT_TIME
150 MAKE_CONST_WXSTRING(MEDIABACKEND_DIRECTSHOW);
151 MAKE_CONST_WXSTRING(MEDIABACKEND_MCI );
152 MAKE_CONST_WXSTRING(MEDIABACKEND_QUICKTIME );
154 //---------------------------------------------------------------------------
156 class wxMediaEvent : public wxNotifyEvent
159 wxMediaEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
163 //---------------------------------------------------------------------------
165 MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
166 MAKE_CONST_WXSTRING2(MediaCtrlNameStr, "mediaCtrl");
167 MustHaveApp(wxMediaCtrl);
170 class wxMediaCtrl : public wxControl
173 %pythonAppend wxMediaCtrl "self._setOORInfo(self)"
174 %pythonAppend wxMediaCtrl() ""
177 wxMediaCtrl(wxWindow* parent, wxWindowID id=-1,
178 const wxString& fileName = wxPyEmptyString,
179 const wxPoint& pos = wxDefaultPosition,
180 const wxSize& size = wxDefaultSize,
182 const wxString& szBackend = wxPyEmptyString,
183 const wxValidator& validator = wxDefaultValidator,
184 const wxString& name = wxPyMediaCtrlNameStr);
186 %name(PreMediaCtrl) wxMediaCtrl();
189 %name(MediaCtrlFromURI)
190 wxMediaCtrl(wxWindow* parent, wxWindowID id=-1,
191 const wxString& location=wxPyEmptyString,
192 const wxPoint& pos = wxDefaultPosition,
193 const wxSize& size = wxDefaultSize,
195 const wxString& szBackend = wxPyEmptyString,
196 const wxValidator& validator = wxDefaultValidator,
197 const wxString& name = wxPyMediaCtrlNameStr)
199 return new wxMediaCtrl(parent, id, wxURI(location),
200 pos, size, style, szBackend, validator, name);
203 bool CreateFromURI(wxWindow* parent, wxWindowID id=-1,
204 const wxString& location=wxPyEmptyString,
205 const wxPoint& pos = wxDefaultPosition,
206 const wxSize& size = wxDefaultSize,
208 const wxString& szBackend = wxPyEmptyString,
209 const wxValidator& validator = wxDefaultValidator,
210 const wxString& name = wxPyMediaCtrlNameStr)
212 return self->Create(parent, id, wxURI(location),
213 pos, size, style, szBackend, validator, name);
218 bool Create(wxWindow* parent, wxWindowID id=-1,
219 const wxString& fileName = wxPyEmptyString,
220 const wxPoint& pos = wxDefaultPosition,
221 const wxSize& size = wxDefaultSize,
223 const wxString& szBackend = wxPyEmptyString,
224 const wxValidator& validator = wxDefaultValidator,
225 const wxString& name = wxPyMediaCtrlNameStr);
232 bool Load(const wxString& fileName);
234 bool LoadFromURI(const wxString& location) {
235 return self->Load(wxURI(location));
239 void Loop(bool bLoop = true);
242 wxMediaState GetState();
244 double GetPlaybackRate();
245 bool SetPlaybackRate(double dRate);
247 bool SetPosition(wxLongLong where);
248 wxLongLong GetPosition();
249 wxLongLong GetDuration();
254 %constant wxEventType wxEVT_MEDIA_FINISHED;
255 %constant wxEventType wxEVT_MEDIA_STOP;
258 EVT_MEDIA_FINISHED = wx.PyEventBinder( wxEVT_MEDIA_FINISHED, 1)
259 EVT_MEDIA_STOP = wx.PyEventBinder( wxEVT_MEDIA_STOP, 1)
262 //---------------------------------------------------------------------------
267 //---------------------------------------------------------------------------