X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d2d4dde456e17c1357b8b4cadded3202b0e6d7a..bc50a2ae95f2ab36b16ceedc7902a9cbfb2f70ea:/wxPython/src/media.i diff --git a/wxPython/src/media.i b/wxPython/src/media.i index bb79be117f..da189f9336 100644 --- a/wxPython/src/media.i +++ b/wxPython/src/media.i @@ -55,6 +55,21 @@ enum wxMediaState wxMEDIASTATE_PLAYING=0 }; +enum wxMediaCtrlPlayerControls +{ + wxMEDIACTRLPLAYERCONTROLS_NONE, + wxMEDIACTRLPLAYERCONTROLS_STEP, + wxMEDIACTRLPLAYERCONTROLS_VOLUME, + wxMEDIACTRLPLAYERCONTROLS_DEFAULT +}; + +static wxString wxMEDIABACKEND_DIRECTSHOW(wxEmptyString); +static wxString wxMEDIABACKEND_MCI (wxEmptyString); +static wxString wxMEDIABACKEND_QUICKTIME (wxEmptyString); +static wxString wxMEDIABACKEND_GSTREAMER (wxEmptyString); +static wxString wxMEDIABACKEND_REALPLAYER(wxEmptyString); +static wxString wxMEDIABACKEND_WMP10 (wxEmptyString); + class wxMediaEvent : public wxNotifyEvent { @@ -65,7 +80,7 @@ public: class wxMediaCtrl : public wxControl { public: - wxMediaCtrl() { wxPyRaiseNotImplemented(); } + wxMediaCtrl() { wxPyRaiseNotImplemented(); } wxMediaCtrl(wxWindow* , wxWindowID , const wxString& , @@ -89,9 +104,6 @@ public: bool Pause() { return false; } bool Stop() { return false; } - bool Load(const wxString& fileName) { return false; } - bool Load(const wxURI& location) { return false; } - wxMediaState GetState() { return wxMEDIASTATE_STOPPED; } double GetPlaybackRate() { return 0.0; } @@ -102,10 +114,29 @@ public: wxFileOffset Tell() { return 0; } wxFileOffset Length() { return 0; } + + double GetVolume() { return 0.0; } + bool SetVolume(double dVolume) { return false; } + + bool ShowPlayerControls( + wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT) + { return false; } + + bool Load(const wxString& fileName) { return false; } + bool LoadURI(const wxString& fileName) { return false; } + bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy) { return false; } + + wxFileOffset GetDownloadProgress() { return 0; } + wxFileOffset GetDownloadTotal() { return 0; } + }; const wxEventType wxEVT_MEDIA_FINISHED = 0; const wxEventType wxEVT_MEDIA_STOP = 0; +const wxEventType wxEVT_MEDIA_LOADED = 0; +const wxEventType wxEVT_MEDIA_STATECHANGED = 0; +const wxEventType wxEVT_MEDIA_PLAY = 0; +const wxEventType wxEVT_MEDIA_PAUSE = 0; #endif %} @@ -122,10 +153,21 @@ enum wxMediaState }; +enum wxMediaCtrlPlayerControls +{ + wxMEDIACTRLPLAYERCONTROLS_NONE, + wxMEDIACTRLPLAYERCONTROLS_STEP, + wxMEDIACTRLPLAYERCONTROLS_VOLUME, + wxMEDIACTRLPLAYERCONTROLS_DEFAULT +}; + -// MAKE_CONST_WXSTRING(MEDIABACKEND_DIRECTSHOW); -// MAKE_CONST_WXSTRING(MEDIABACKEND_MCI ); -// MAKE_CONST_WXSTRING(MEDIABACKEND_QUICKTIME ); +MAKE_CONST_WXSTRING(MEDIABACKEND_DIRECTSHOW); +MAKE_CONST_WXSTRING(MEDIABACKEND_MCI ); +MAKE_CONST_WXSTRING(MEDIABACKEND_QUICKTIME ); +MAKE_CONST_WXSTRING(MEDIABACKEND_GSTREAMER ); +MAKE_CONST_WXSTRING(MEDIABACKEND_REALPLAYER); +MAKE_CONST_WXSTRING(MEDIABACKEND_WMP10); //--------------------------------------------------------------------------- @@ -177,13 +219,6 @@ public: bool Pause(); bool Stop(); - bool Load(const wxString& fileName); - %extend { - bool LoadFromURI(const wxString& location) { - return self->Load(wxURI(location)); - } - } - wxMediaState GetState(); double GetPlaybackRate(); @@ -192,16 +227,40 @@ public: wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart); wxFileOffset Tell(); wxFileOffset Length(); + + double GetVolume(); + bool SetVolume(double dVolume); + + bool ShowPlayerControls( + wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT); + + bool Load(const wxString& fileName); + bool LoadURI(const wxString& fileName); + bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy); + %pythoncode { LoadFromURI = LoadURI } + + wxFileOffset GetDownloadProgress(); // DirectShow only + wxFileOffset GetDownloadTotal(); // DirectShow only + }; %constant wxEventType wxEVT_MEDIA_FINISHED; %constant wxEventType wxEVT_MEDIA_STOP; +%constant wxEventType wxEVT_MEDIA_LOADED; +%constant wxEventType wxEVT_MEDIA_STATECHANGED; +%constant wxEventType wxEVT_MEDIA_PLAY; +%constant wxEventType wxEVT_MEDIA_PAUSE; + %pythoncode { -EVT_MEDIA_FINISHED = wx.PyEventBinder( wxEVT_MEDIA_FINISHED, 1) -EVT_MEDIA_STOP = wx.PyEventBinder( wxEVT_MEDIA_STOP, 1) +EVT_MEDIA_FINISHED = wx.PyEventBinder( wxEVT_MEDIA_FINISHED, 1) +EVT_MEDIA_STOP = wx.PyEventBinder( wxEVT_MEDIA_STOP, 1) +EVT_MEDIA_LOADED = wx.PyEventBinder( wxEVT_MEDIA_LOADED, 1) +EVT_MEDIA_STATECHANGED = wx.PyEventBinder( wxEVT_MEDIA_STATECHANGED, 1) +EVT_MEDIA_PLAY = wx.PyEventBinder( wxEVT_MEDIA_PLAY, 1) +EVT_MEDIA_PAUSE = wx.PyEventBinder( wxEVT_MEDIA_PAUSE, 1) } //---------------------------------------------------------------------------