X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dcb206ade4c14afe9660d4bfcb9ae136b153ecc5..65baafba0e8cd74f2264b7e2f7625ff5bea84864:/docs/latex/wx/sound.tex diff --git a/docs/latex/wx/sound.tex b/docs/latex/wx/sound.tex index 623fae31b9..ad2def40c5 100644 --- a/docs/latex/wx/sound.tex +++ b/docs/latex/wx/sound.tex @@ -2,8 +2,8 @@ This class represents a short sound (loaded from Windows WAV file), that can be stored in memory and played. Currently this class is implemented -on Windows and Unix (and uses either -\urlref{Open Sound System}{http://www.opensound.com/oss.html} or +on Windows and Unix (and uses either +\urlref{Open Sound System}{http://www.opensound.com/oss.html} or \urlref{Simple DirectMedia Layer}{http://www.libsdl.org/}). \wxheading{Derived from} @@ -16,7 +16,8 @@ on Windows and Unix (and uses either \latexignore{\rtfignore{\wxheading{Members}}} -\membersection{wxSound::wxSound}\label{wxsoundconstr} + +\membersection{wxSound::wxSound}\label{wxsoundctor} \func{}{wxSound}{\void} @@ -24,8 +25,9 @@ Default constructor. \func{}{wxSound}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = false}} -Constructs a wave object from a file or resource. Call \helpref{wxSound::IsOk}{wxsoundisok} to -determine whether this succeeded. +Constructs a wave object from a file or, under Windows, from a Windows +resource. Call \helpref{wxSound::IsOk}{wxsoundisok} to determine whether this +succeeded. \wxheading{Parameters} @@ -33,12 +35,14 @@ determine whether this succeeded. \docparam{isResource}{\true if {\it fileName} is a resource, \false if it is a filename.} -\membersection{wxSound::\destruct{wxSound}} + +\membersection{wxSound::\destruct{wxSound}}\label{wxsounddtor} \func{}{\destruct{wxSound}}{\void} Destroys the wxSound object. + \membersection{wxSound::Create}\label{wxsoundcreate} \func{bool}{Create}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = \false}} @@ -55,18 +59,23 @@ Constructs a wave object from a file or resource. \true if the call was successful, \false otherwise. + \membersection{wxSound::IsOk}\label{wxsoundisok} \constfunc{bool}{IsOk}{\void} Returns \true if the object contains a successfully loaded file or resource, \false otherwise. + \membersection{wxSound::IsPlaying}\label{wxsoundisplaying} \constfunc{static bool}{IsPlaying}{\void} Returns \true if a sound is played at the moment. +This method is currently not implemented under Windows. + + \membersection{wxSound::Play}\label{wxsoundplay} \constfunc{bool}{Play}{\param{unsigned }{ flags = wxSOUND\_ASYNC}} @@ -74,27 +83,33 @@ Returns \true if a sound is played at the moment. \func{static bool}{Play}{\param{const wxString\& }{filename}, \param{unsigned}{ flags = wxSOUND\_ASYNC}} Plays the sound file. If another sound is playing, it will be interrupted. -Returns \true on success, \false otherwise. +Returns \true on success, \false otherwise. Note that in general it is possible +to delete the object which is being asynchronously played any time after +calling this function and the sound would continue playing, however this +currently doesn't work under Windows for sound objects loaded from memory data. The possible values for \arg{flags} are: \begin{twocollist} - \twocolitem{wxSOUND\_SYNC}{{\tt Play} will block and wait until the sound is - replayed.} - \twocolitem{wxSOUND\_ASYNC}{Sound is played asynchronously, - {\tt Play} returns immediately} - \twocolitem{wxSOUND\_ASYNC | wxSOUND\_LOOP}{Sound is played asynchronously - and loops until another sound is played, - \helpref{wxSound::Stop}{wxsoundstop} is called or the program terminates.} +\twocolitem{wxSOUND\_SYNC}{{\tt Play} will block and wait until the sound is +replayed.} +\twocolitem{wxSOUND\_ASYNC}{Sound is played asynchronously, +{\tt Play} returns immediately} +\twocolitem{wxSOUND\_ASYNC | wxSOUND\_LOOP}{Sound is played asynchronously +and loops until another sound is played, +\helpref{wxSound::Stop}{wxsoundstop} is called or the program terminates.} \end{twocollist} The static form is shorthand for this code: + \begin{verbatim} wxSound(filename).Play(flags); \end{verbatim} + \membersection{wxSound::Stop}\label{wxsoundstop} \func{static void}{Stop}{\void} If a sound is played, this function stops it. +