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
58 enum wxMediaCtrlPlayerControls
60 wxMEDIACTRLPLAYERCONTROLS_NONE,
61 wxMEDIACTRLPLAYERCONTROLS_STEP,
62 wxMEDIACTRLPLAYERCONTROLS_VOLUME,
63 wxMEDIACTRLPLAYERCONTROLS_DEFAULT
67 class wxMediaEvent : public wxNotifyEvent
70 wxMediaEvent(wxEventType, int ) { wxPyRaiseNotImplemented(); }
73 class wxMediaCtrl : public wxControl
76 wxMediaCtrl() { wxPyRaiseNotImplemented(); }
78 wxMediaCtrl(wxWindow* , wxWindowID ,
85 const wxString& ) { wxPyRaiseNotImplemented(); }
87 bool Create(wxWindow* , wxWindowID ,
94 const wxString& ) { return false; }
96 bool Play() { return false; }
97 bool Pause() { return false; }
98 bool Stop() { return false; }
100 wxMediaState GetState() { return wxMEDIASTATE_STOPPED; }
102 double GetPlaybackRate() { return 0.0; }
103 bool SetPlaybackRate(double dRate) { return false; }
105 wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart)
108 wxFileOffset Tell() { return 0; }
109 wxFileOffset Length() { return 0; }
111 double GetVolume() { return 0.0; }
112 bool SetVolume(double dVolume) { return false; }
114 bool ShowPlayerControls(
115 wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT)
118 bool Load(const wxString& fileName) { return false; }
119 bool LoadURI(const wxString& fileName) { return false; }
120 bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy) { return false; }
123 const wxEventType wxEVT_MEDIA_FINISHED = 0;
124 const wxEventType wxEVT_MEDIA_STOP = 0;
131 //---------------------------------------------------------------------------
135 wxMEDIASTATE_STOPPED,
142 // MAKE_CONST_WXSTRING(MEDIABACKEND_DIRECTSHOW);
143 // MAKE_CONST_WXSTRING(MEDIABACKEND_MCI );
144 // MAKE_CONST_WXSTRING(MEDIABACKEND_QUICKTIME );
146 //---------------------------------------------------------------------------
148 class wxMediaEvent : public wxNotifyEvent
151 wxMediaEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
155 //---------------------------------------------------------------------------
157 MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
158 MAKE_CONST_WXSTRING2(MediaCtrlNameStr, wxT("mediaCtrl"));
159 MustHaveApp(wxMediaCtrl);
162 class wxMediaCtrl : public wxControl
165 %pythonAppend wxMediaCtrl "self._setOORInfo(self)"
166 %pythonAppend wxMediaCtrl() ""
169 wxMediaCtrl(wxWindow* parent,
171 const wxString& fileName = wxPyEmptyString,
172 const wxPoint& pos = wxDefaultPosition,
173 const wxSize& size = wxDefaultSize,
175 const wxString& szBackend = wxPyEmptyString,
176 const wxValidator& validator = wxDefaultValidator,
177 const wxString& name = wxPyMediaCtrlNameStr);
179 %RenameCtor(PreMediaCtrl, wxMediaCtrl());
181 bool Create(wxWindow* parent,
183 const wxString& fileName = wxPyEmptyString,
184 const wxPoint& pos = wxDefaultPosition,
185 const wxSize& size = wxDefaultSize,
187 const wxString& szBackend = wxPyEmptyString,
188 const wxValidator& validator = wxDefaultValidator,
189 const wxString& name = wxPyMediaCtrlNameStr);
196 wxMediaState GetState();
198 double GetPlaybackRate();
199 bool SetPlaybackRate(double dRate);
201 wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart);
203 wxFileOffset Length();
206 bool SetVolume(double dVolume);
208 bool ShowPlayerControls(
209 wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT);
211 bool Load(const wxString& fileName);
212 bool LoadURI(const wxString& fileName);
213 bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy);
214 %pythoncode { LoadFromURI = LoadURI }
219 %constant wxEventType wxEVT_MEDIA_FINISHED;
220 %constant wxEventType wxEVT_MEDIA_STOP;
223 EVT_MEDIA_FINISHED = wx.PyEventBinder( wxEVT_MEDIA_FINISHED, 1)
224 EVT_MEDIA_STOP = wx.PyEventBinder( wxEVT_MEDIA_STOP, 1)
227 //---------------------------------------------------------------------------
232 //---------------------------------------------------------------------------