X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23324ae1c7938ba904770fc456d3c07764b9c5e9..9602ce3d8ca47689bb69d09dbdd09152f2bde8c3:/interface/mediactrl.h diff --git a/interface/mediactrl.h b/interface/mediactrl.h index 2b4f3366ea..6a1fcb3c5f 100644 --- a/interface/mediactrl.h +++ b/interface/mediactrl.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: mediactrl.h -// Purpose: documentation for wxMediaEvent class +// Purpose: interface of wxMediaEvent // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -9,35 +9,35 @@ /** @class wxMediaEvent @wxheader{mediactrl.h} - + Event wxMediaCtrl uses. - + @library{wxmedia} @category{FIXME} */ class wxMediaEvent : public wxNotifyEvent { public: - + }; + /** @class wxMediaCtrl @wxheader{mediactrl.h} - - wxMediaCtrl is a class for displaying types of + + wxMediaCtrl is a class for displaying 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 + there is a ActiveMovie/DirectShow backend, and on Macintosh there is a QuickTime backend. - + @library{wxmedia} @category{media} - - @seealso - wxMediaEvent + + @see wxMediaEvent */ class wxMediaCtrl : public wxControl { @@ -45,94 +45,80 @@ public: //@{ /** , - @b const wxPoint& - - @param pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, + wxPoint& + + @param pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, const wxString& szBackend = wxT(""), const wxValidatorvalidator = wxDefaultValidator, const 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. - - parent - parent of this control. Must not be @NULL. - - @param id - id to use for events - - @param fileName - If not empty, the path of a file to open. - - @param pos - Position to put control at. - - @param size - Size to put the control at and to stretch movie to. - - @param style - Optional styles. - - @param szBackend - Name of backend you want to use, leave blank to make - wxMediaCtrl figure it out. - - @param validator - validator to use. - - @param name - Window name. + + parent + parent of this control. Must not be @NULL. + @param id + id to use for events + @param fileName + If not empty, the path of a file to open. + @param pos + Position to put control at. + @param size + Size to put the control at and to stretch movie to. + @param style + Optional styles. + @param szBackend + Name of backend you want to use, leave blank to make + wxMediaCtrl figure it out. + @param validator + validator to use. + @param name + Window name. */ - wxMediaCtrl(); - wxMediaCtrl(wxWindow* parent, wxWindowID id); + wxMediaCtrl() const; + wxMediaCtrl(wxWindow* parent, wxWindowID id) const; //@} /** Generally, you should almost certainly leave this part up to wxMediaCtrl - but if you need a certain backend for a particular - reason, such as QuickTime for playing .mov files, all you need + reason, such as QuickTime for playing .mov files, all you need to do to choose a specific backend is to pass the - name of the backend class to + name of the backend class to Create(). - The following are valid backend identifiers - - + @b wxMEDIABACKEND_DIRECTSHOW - - - + + Use ActiveMovie/DirectShow. Uses the native ActiveMovie (I.E. DirectShow) control. Default backend on Windows and supported by nearly all Windows versions, even some Windows CE versions. May display a windows media player - logo while inactive. - + logo while inactive. + @b wxMEDIABACKEND_QUICKTIME - - + Use QuickTime. Mac Only. WARNING: May not working correctly embedded in a wxNotebook. - - + @b wxMEDIABACKEND_GSTREAMER - - + Use GStreamer. Unix Only. Requires GStreamer 0.8 along with at the very least the xvimagesink, xoverlay, and gst-play modules of gstreamer to function. You need the correct modules to play the relavant files, for example the mad module to play mp3s, etc. - + @b wxMEDIABACKEND_WMP10 - - + Uses Windows Media Player 10 (Windows only) - works on mobile machines with Windows Media Player 10 and desktop machines with either Windows Media Player 9 or 10 - + Note that other backends such as wxMEDIABACKEND_MCI can now be found at wxCode. */ @@ -140,51 +126,43 @@ public: /** , - @b const wxPoint& - - @param pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, + wxPoint& + + @param pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, const wxString& szBackend = wxT(""), const wxValidatorvalidator = wxDefaultValidator, const 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. - - parent - parent of this control. Must not be @NULL. - - @param id - id to use for events - - @param fileName - If not empty, the path of a file to open. - - @param pos - Position to put control at. - - @param size - Size to put the control at and to stretch movie to. - - @param style - Optional styles. - - @param szBackend - Name of backend you want to use, leave blank to make - wxMediaCtrl figure it out. - - @param validator - validator to use. - - @param name - Window name. + + parent + parent of this control. Must not be @NULL. + @param id + id to use for events + @param fileName + If not empty, the path of a file to open. + @param pos + Position to put control at. + @param size + Size to put the control at and to stretch movie to. + @param style + Optional styles. + @param szBackend + Name of backend you want to use, leave blank to make + wxMediaCtrl figure it out. + @param validator + validator to use. + @param name + Window name. */ - bool Create(wxWindow* parent, wxWindowID id); + bool Create(wxWindow* parent, wxWindowID id) const; /** Creating a backend for wxMediaCtrl is a rather simple process. Simply derive @@ -192,13 +170,10 @@ public: in wxMediaBackend correspond to those in wxMediaCtrl except for CreateControl which does the actual creation of the control, in cases where a custom control is not needed you may simply call wxControl::Create. - You need to make sure to use the DECLARE_CLASS and IMPLEMENT_CLASS macros. - The only real tricky part is that you need to make sure the file in compiled in, which if there are just backends in there will not happen and you may need to use a force link hack (see http://www.wxwidgets.org/wiki/index.php/RTTI). - This is a rather simple example of how to create a backend in the wxActiveXContainer documentation. */ @@ -221,21 +196,17 @@ public: /** Obtains the state the playback of the media is in - - - + @b wxMEDIASTATE_STOPPED - - + The movie has stopped. - + @b wxMEDIASTATE_PAUSED - - + The movie is paused. - + @b wxMEDIASTATE_PLAYING - - + The movie is currently playing. */ wxMediaCtrlState GetState(); @@ -274,19 +245,17 @@ public: event to its parent window, at which point the event handler can choose to veto the event, preventing the stream from actually stopping. - Example: - + When wxMediaCtrl stops, either by the EVT_MEDIA_STOP not being - vetoed, or by manually calling + vetoed, or by manually calling Stop(), where it actually stops is not at the beginning, rather, but at the beginning of the stream. That is, when it stops and play is called, playback - is gauranteed to start at the beginning of the media. This is + is gauranteed to start at the beginning of the media. This is because some streams are not seekable, and when stop is called on them they return to the beginning, thus wxMediaCtrl tries to keep consistant for all types of media. - Note that when changing the state of the media through Play() and other methods, the media may not actually be in the wxMEDIASTATE_PLAYING, for example. If you are relying on the @@ -324,21 +293,19 @@ public: /** Depending upon the backend, wxMediaCtrl can render - and display pretty much any kind of media that the native system can - + and display pretty much any kind of media that the native system can - such as an image, mpeg video, or mp3 (without license restrictions - since it relies on native system calls that may not technically have mp3 decoding available, for example, it falls outside the realm of licensing restrictions). - - For general operation, all you need to do is call + For general operation, all you need to do is call Load() to load the file you want to render, catch the EVT_MEDIA_LOADED event, - and then call Play() + and then call Play() to show the video/audio of the media in that event. - More complex operations are generally more heavily dependant on the capabilities of the backend. For example, QuickTime cannot set - the playback rate of certain streaming media - while DirectShow is + the playback rate of certain streaming media - while DirectShow is slightly more flexible in that regard. */ @@ -374,29 +341,24 @@ public: calling the function with default parameters tells wxMediaCtrl to use the default controls provided by the toolkit. The function takes a @c wxMediaCtrlPlayerControls enumeration as follows: - - + @b wxMEDIACTRLPLAYERCONTROLS_NONE - - + No controls. return wxMediaCtrl to it's default state. - + @b wxMEDIACTRLPLAYERCONTROLS_STEP - - + Step controls like fastfoward, step one frame etc. - + @b wxMEDIACTRLPLAYERCONTROLS_VOLUME - - + Volume controls like the speaker icon, volume slider, etc. - + @b wxMEDIACTRLPLAYERCONTROLS_DEFAULT - - + Default controls for the toolkit. Currently a typedef for wxMEDIACTRLPLAYERCONTROLS_STEP and wxMEDIACTRLPLAYERCONTROLS_VOLUME. - + For more see @ref overview_playercontrolswxmediactrl "Player controls". Currently only implemented on the QuickTime and DirectShow backends. The function @@ -406,8 +368,7 @@ public: /** Stops the media. - - See Operation for an overview of how + See Operation() for an overview of how stopping works. */ bool Stop(); @@ -429,7 +390,6 @@ public: In addition, the backend may modify GetBestSize() to include the size of the extra controls - so if you want the real size of the video just disable ShowPlayerControls(). - The idea with setting GetBestSize to the size of the video is that GetBestSize is a wxWindow-derived function that is called when sizers on a window recalculate. What this means is that @@ -437,3 +397,4 @@ public: original size without any extra assistance needed from the user. */ }; +