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 media 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
59 class wxMediaEvent : public wxNotifyEvent
62 wxMediaEvent(wxEventType, int ) { wxPyRaiseNotImplemented(); }
65 class wxMediaCtrl : public wxControl
68 wxMediaCtrl() { wxPyRaiseNotImplemented(); }
70 wxMediaCtrl(wxWindow* , wxWindowID ,
77 const wxString& ) { wxPyRaiseNotImplemented(); }
79 // wxMediaCtrl(wxWindow* ,
86 // const wxValidator& ,
87 // const wxString& ) { wxPyRaiseNotImplemented(); }
89 bool Create(wxWindow* , wxWindowID ,
96 const wxString& ) { return false; }
98 // bool Create(wxWindow* ,
105 // const wxValidator& ,
106 // const wxString& ) { return false; }
108 bool Play() { return false; }
109 bool Pause() { return false; }
110 bool Stop() { return false; }
112 bool Load(const wxString& fileName) { return false; }
113 bool Load(const wxURI& location) { return false; }
115 void Loop(bool bLoop = true) {}
116 bool IsLooped() { return false; }
118 wxMediaState GetState() { return wxMEDIASTATE_STOPPED; }
120 double GetPlaybackRate() { return 0.0; }
121 bool SetPlaybackRate(double dRate) { return false; }
123 wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart)
126 wxFileOffset Tell() { return 0; }
127 wxFileOffset Length() { return 0; }
130 const wxEventType wxEVT_MEDIA_FINISHED = 0;
131 const wxEventType wxEVT_MEDIA_STOP = 0;
138 //---------------------------------------------------------------------------
142 wxMEDIASTATE_STOPPED,
149 // MAKE_CONST_WXSTRING(MEDIABACKEND_DIRECTSHOW);
150 // MAKE_CONST_WXSTRING(MEDIABACKEND_MCI );
151 // MAKE_CONST_WXSTRING(MEDIABACKEND_QUICKTIME );
153 //---------------------------------------------------------------------------
155 class wxMediaEvent : public wxNotifyEvent
158 wxMediaEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
162 //---------------------------------------------------------------------------
164 MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
165 MAKE_CONST_WXSTRING2(MediaCtrlNameStr, wxT("mediaCtrl"));
166 MustHaveApp(wxMediaCtrl);
169 class wxMediaCtrl : public wxControl
172 %pythonAppend wxMediaCtrl "self._setOORInfo(self)"
173 %pythonAppend wxMediaCtrl() ""
176 wxMediaCtrl(wxWindow* parent,
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 %RenameCtor(PreMediaCtrl, wxMediaCtrl());
189 // %RenameCtor(MediaCtrlFromURI,
190 // wxMediaCtrl(wxWindow* parent,
192 // const wxString& location=wxPyEmptyString,
193 // const wxPoint& pos = wxDefaultPosition,
194 // const wxSize& size = wxDefaultSize,
196 // const wxString& szBackend = wxPyEmptyString,
197 // const wxValidator& validator = wxDefaultValidator,
198 // const wxString& name = wxPyMediaCtrlNameStr))
200 // return new wxMediaCtrl(parent, id, wxURI(location),
201 // pos, size, style, szBackend, validator, name);
204 // bool CreateFromURI(wxWindow* parent,
206 // const wxString& location=wxPyEmptyString,
207 // const wxPoint& pos = wxDefaultPosition,
208 // const wxSize& size = wxDefaultSize,
210 // const wxString& szBackend = wxPyEmptyString,
211 // const wxValidator& validator = wxDefaultValidator,
212 // const wxString& name = wxPyMediaCtrlNameStr)
214 // return self->Create(parent, id, wxURI(location),
215 // pos, size, style, szBackend, validator, name);
220 bool Create(wxWindow* parent,
222 const wxString& fileName = wxPyEmptyString,
223 const wxPoint& pos = wxDefaultPosition,
224 const wxSize& size = wxDefaultSize,
226 const wxString& szBackend = wxPyEmptyString,
227 const wxValidator& validator = wxDefaultValidator,
228 const wxString& name = wxPyMediaCtrlNameStr);
235 bool Load(const wxString& fileName);
237 bool LoadFromURI(const wxString& location) {
238 return self->Load(wxURI(location));
242 void Loop(bool bLoop = true);
245 wxMediaState GetState();
247 double GetPlaybackRate();
248 bool SetPlaybackRate(double dRate);
250 wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart);
252 wxFileOffset Length();
257 %constant wxEventType wxEVT_MEDIA_FINISHED;
258 %constant wxEventType wxEVT_MEDIA_STOP;
261 EVT_MEDIA_FINISHED = wx.PyEventBinder( wxEVT_MEDIA_FINISHED, 1)
262 EVT_MEDIA_STOP = wx.PyEventBinder( wxEVT_MEDIA_STOP, 1)
265 //---------------------------------------------------------------------------
270 //---------------------------------------------------------------------------