.\" This is a wxWidgets manpage page generated from the XML docs .TH wxMediaCtrl 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxMediaCtrl \- .SH DESCRIPTION wxMediaCtrl is a class that allows a way to convieniently display types of media, such as videos, audio files, natively through native codecs. wxMediaCtrl uses native backends to render media, for example on Windows there is a ActiveMovie/DirectShow backend, and on Macintosh there is a QuickTime backend. .SH "PARENTS" wxControl .SH "INCLUDE FILES" wx/mediactrl.h .SH MEMBERS .SS wxMediaCtrl () Default constructor - you must call Create before calling any other methods of wxMediaCtrl. .SS wxMediaCtrl (wxWindow* parentconst wxString& fileName = wxT("")wxWindowID idconst wxPoint& pos = wxDefaultPositionconst wxSize& size = wxDefaultSizelong style = 0const wxString& szBackend = wxT("")const wxValidator& validator = wxDefaultValidatorconst wxString& name = wxPanelNameStr) Constructor that calls Create . You may prefer to call Create directly to check to see if wxMediaCtrl is available on the system. .SS bool Create (wxWindow* parentconst wxString& fileName = wxT("")wxWindowID idconst wxPoint& pos = wxDefaultPositionconst wxSize& size = wxDefaultSizelong style = 0const wxString& szBackend = wxT("")const wxValidator& validator = wxDefaultValidatorconst wxString& name = wxPanelNameStr) Creates this control. Returns false if it can't load the movie located at fileName or it cannot load one of its native backends. If you specify a file to open via fileName and you don't specify a backend to use, wxMediaCtrl tries each of its backends until one that can render the path referred to by fileName can be found. .SS wxFileOffset GetDuration () Obtains the length - the total amount of time the movie has in milliseconds. .SS wxFileOffset GetPosition () Obtains the current position in time within the movie in milliseconds. .SS wxMediaCtrlState GetState () Obtains the state the playback of the movie is in - wxMEDIASTATE_STOPPED The movie has stopped. wxMEDIASTATE_PAUSED The movie is paused. wxMEDIASTATE_PLAYING The movie is currently playing. .SS bool Load (const wxString& fileName) Loads the file that fileName refers to. Returns false if loading fails. .SS bool Load (const wxURI& location) Loads the url that location refers to. Returns false if loading fails. .SS bool Pause () Pauses playback of the movie. .SS bool Play () Resumes playback of the movie. .SS wxFileOffset Seek (wxFileOffset wherewxSeekMode mode) Seeks to a position within the movie. .SS bool Stop () Stops the media. See Operation for an overview of how stopping works. .SS bool SetVolume (double dVolume) Sets the volume of the media from a 0.0 to 1.0 range. .SS double GetVolume () Gets the volume of the media from a 0.0 to 1.0 range. .SS double GetPlaybackrate () Gets the playback rate of the media; for example 2.0 is double speed. Not implemented on MCI or GStreamer. .SS bool SetPlaybackrate (double dVolume) Sets the rate that the media plays; for example 0.5 is half speed. .SS bool ShowPlayerControls (wxMediaCtrlPlayerControls flags) Normally, when you use wxMediaCtrl it is just a window for the video to play in. However, platforms generally have their own media player interface, like quicktime has a bar below the video with a slider etc.. If you want that native interface instead of making your own use this function. There are several options for the flags parameter, however you can look at the mediactrl header for these. The two general flags are wxMEDIACTRLPLAYERCONTROLS_NONE which turns off the native interface, and wxMEDIACTRLPLAYERCONTROLS_DEFAULT which lets wxMediaCtrl decide what native controls on the interface. .SH "SEE ALSO" wxControl .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.