X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63cd6e0bbe38ac176c67fca4a2c5e49b8d95d384..d0ee33f5c6908b4ac5e1364381f0ef00942e3936:/wxPython/src/media.i?ds=sidebyside diff --git a/wxPython/src/media.i b/wxPython/src/media.i index 03268b6872..d2db77b667 100644 --- a/wxPython/src/media.i +++ b/wxPython/src/media.i @@ -11,7 +11,7 @@ ///////////////////////////////////////////////////////////////////////////// %define DOCSTRING -"Classes for a medai player control" +"Classes for a media player control" %enddef %module(package="wx", docstring=DOCSTRING) media @@ -55,10 +55,6 @@ enum wxMediaState wxMEDIASTATE_PLAYING=0 }; -enum wxMediaTimeFormat -{ - wxMEDIATIMEFORMAT_TIME=0 -}; class wxMediaEvent : public wxNotifyEvent { @@ -69,7 +65,7 @@ public: class wxMediaCtrl : public wxControl { public: - wxMediaCtrl() { wxPyRaiseNotImplemented(); } + wxMediaCtrl() { wxPyRaiseNotImplemented(); } wxMediaCtrl(wxWindow* , wxWindowID , const wxString& , @@ -80,16 +76,6 @@ public: const wxValidator& , const wxString& ) { wxPyRaiseNotImplemented(); } - wxMediaCtrl(wxWindow* , - wxWindowID , - const wxURI& , - const wxPoint&, - const wxSize& , - long style, - const wxString& , - const wxValidator& , - const wxString& ) { wxPyRaiseNotImplemented(); } - bool Create(wxWindow* , wxWindowID , const wxString& , const wxPoint& , @@ -99,16 +85,6 @@ public: const wxValidator& , const wxString& ) { return false; } - bool Create(wxWindow* , - wxWindowID , - const wxURI& , - const wxPoint&, - const wxSize& , - long style, - const wxString& , - const wxValidator& , - const wxString& ) { return false; } - bool Play() { return false; } bool Pause() { return false; } bool Stop() { return false; } @@ -116,17 +92,19 @@ public: bool Load(const wxString& fileName) { return false; } bool Load(const wxURI& location) { return false; } - void Loop(bool bLoop = true) {} - bool IsLooped() { return false; } - wxMediaState GetState() { return wxMEDIASTATE_STOPPED; } - double GetPlaybackRate() { return 0.0; }; + double GetPlaybackRate() { return 0.0; } bool SetPlaybackRate(double dRate) { return false; } - bool SetPosition(wxLongLong where) { return false; } - wxLongLong GetPosition() { return 0; } - wxLongLong GetDuration() { return 0; } + wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart) + { return 0; } + + wxFileOffset Tell() { return 0; } + wxFileOffset Length() { return 0; } + + double GetVolume() { return 0.0; } + bool SetVolume(double dVolume) { return false; } }; const wxEventType wxEVT_MEDIA_FINISHED = 0; @@ -146,10 +124,6 @@ enum wxMediaState wxMEDIASTATE_PLAYING }; -enum wxMediaTimeFormat -{ - wxMEDIATIMEFORMAT_TIME -}; // MAKE_CONST_WXSTRING(MEDIABACKEND_DIRECTSHOW); @@ -189,39 +163,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyMediaCtrlNameStr); - %name(PreMediaCtrl) wxMediaCtrl(); - - %extend { - %name(MediaCtrlFromURI) - wxMediaCtrl(wxWindow* parent, - wxWindowID id=-1, - const wxString& location=wxPyEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& szBackend = wxPyEmptyString, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxPyMediaCtrlNameStr) - { - return new wxMediaCtrl(parent, id, wxURI(location), - pos, size, style, szBackend, validator, name); - } - - bool CreateFromURI(wxWindow* parent, - wxWindowID id=-1, - const wxString& location=wxPyEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& szBackend = wxPyEmptyString, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxPyMediaCtrlNameStr) - { - return self->Create(parent, id, wxURI(location), - pos, size, style, szBackend, validator, name); - } - } - + %RenameCtor(PreMediaCtrl, wxMediaCtrl()); bool Create(wxWindow* parent, wxWindowID id=-1, @@ -238,6 +180,9 @@ public: bool Pause(); bool Stop(); + double GetVolume(); //DirectShow only + bool SetVolume(double dVolume); //DirectShow only + bool Load(const wxString& fileName); %extend { bool LoadFromURI(const wxString& location) { @@ -245,17 +190,14 @@ public: } } - void Loop(bool bLoop = true); - bool IsLooped(); - wxMediaState GetState(); double GetPlaybackRate(); bool SetPlaybackRate(double dRate); - %name(SetMediaPosition) bool SetPosition(wxLongLong where); - %name(GetMediaPosition) wxLongLong GetPosition(); - %name(GetMediaDuration) wxLongLong GetDuration(); + wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart); + wxFileOffset Tell(); + wxFileOffset Length(); };