]> git.saurik.com Git - wxWidgets.git/commitdiff
documented new API
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 2 Feb 2004 14:35:56 +0000 (14:35 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 2 Feb 2004 14:35:56 +0000 (14:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/sound.tex

index 4d6ee2e4980d530b58e16ad2d990caad92268151..623fae31b93ea354682032c84260c79c31d90dab 100644 (file)
@@ -1,8 +1,10 @@
 \section{\class{wxSound}}\label{wxsound}
 
 \section{\class{wxSound}}\label{wxsound}
 
-This class represents a short wave file, in Windows WAV format, that
+This class represents a short sound (loaded from Windows WAV file), that
 can be stored in memory and played. Currently this class is implemented
 can be stored in memory and played. Currently this class is implemented
-on Windows and Linux only.
+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}
 
 
 \wxheading{Derived from}
 
@@ -10,7 +12,7 @@ on Windows and Linux only.
 
 \wxheading{Include files}
 
 
 \wxheading{Include files}
 
-<wx/wave.h>
+<wx/sound.h>
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
@@ -29,7 +31,7 @@ determine whether this succeeded.
 
 \docparam{fileName}{The filename or Windows resource.}
 
 
 \docparam{fileName}{The filename or Windows resource.}
 
-\docparam{isResource}{true if {\it fileName} is a resource, false if it is a filename.}
+\docparam{isResource}{\true if {\it fileName} is a resource, \false if it is a filename.}
 
 \membersection{wxSound::\destruct{wxSound}}
 
 
 \membersection{wxSound::\destruct{wxSound}}
 
@@ -39,7 +41,7 @@ Destroys the wxSound object.
 
 \membersection{wxSound::Create}\label{wxsoundcreate}
 
 
 \membersection{wxSound::Create}\label{wxsoundcreate}
 
-\func{bool}{Create}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = false}}
+\func{bool}{Create}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = \false}}
 
 Constructs a wave object from a file or resource.
 
 
 Constructs a wave object from a file or resource.
 
@@ -47,22 +49,52 @@ Constructs a wave object from a file or resource.
 
 \docparam{fileName}{The filename or Windows resource.}
 
 
 \docparam{fileName}{The filename or Windows resource.}
 
-\docparam{isResource}{true if {\it fileName} is a resource, false if it is a filename.}
+\docparam{isResource}{\true if {\it fileName} is a resource, \false if it is a filename.}
 
 \wxheading{Return value}
 
 
 \wxheading{Return value}
 
-true if the call was successful, false otherwise.
+\true if the call was successful, \false otherwise.
 
 \membersection{wxSound::IsOk}\label{wxsoundisok}
 
 \constfunc{bool}{IsOk}{\void}
 
 
 \membersection{wxSound::IsOk}\label{wxsoundisok}
 
 \constfunc{bool}{IsOk}{\void}
 
-Returns true if the object contains a successfully loaded file or resource, false otherwise.
+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.
 
 \membersection{wxSound::Play}\label{wxsoundplay}
 
 
 \membersection{wxSound::Play}\label{wxsoundplay}
 
-\constfunc{bool}{Play}{\param{bool}{ async = true}, \param{bool}{ looped = false}}
+\constfunc{bool}{Play}{\param{unsigned }{ flags = wxSOUND\_ASYNC}}
+
+\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.
+
+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.}
+\end{twocollist}
+
+The static form is shorthand for this code:
+\begin{verbatim}
+wxSound(filename).Play(flags);
+\end{verbatim}
 
 
-Plays the wave file synchronously or asynchronously, looped or single-shot.
+\membersection{wxSound::Stop}\label{wxsoundstop}
 
 
+\func{static void}{Stop}{\void}
 
 
+If a sound is played, this function stops it.