Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1786

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qsound.cpp:97 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QSound Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QSound Class Reference</h1>

<p>The QSound class provides access to the platform audio facilities.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qsound-h.html">qsound.h</a>&gt;</tt>
<p>Inherits <a href="qobject.html">QObject</a>.
<p><a href="qsound-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QSound"><b>QSound</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;filename, QObject&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#~QSound"><b>~QSound</b></a> ()</div></li>
<li><div class=fn>int <a href="#loops"><b>loops</b></a> () const</div></li>
<li><div class=fn>int <a href="#loopsRemaining"><b>loopsRemaining</b></a> () const</div></li>
<li><div class=fn>void <a href="#setLoops"><b>setLoops</b></a> ( int&nbsp;l )</div></li>
<li><div class=fn>QString <a href="#fileName"><b>fileName</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isFinished"><b>isFinished</b></a> () const</div></li>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class=fn>void <a href="#play-2"><b>play</b></a> ()</div></li>
<li><div class=fn>void <a href="#stop"><b>stop</b></a> ()</div></li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class=fn>bool <a href="#isAvailable"><b>isAvailable</b></a> ()</div></li>
<li><div class=fn>void <a href="#play"><b>play</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;filename )</div></li>
<li><div class=fn>bool <a href="#available"><b>available</b></a> ()</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QSound class provides access to the platform audio facilities.
<p> 

<p> Qt provides the most commonly required audio operation in
GUI applications: playing a sound file asynchronously
to the user. This is most simply accomplished with a single call:
<pre>
    QSound::<a href="#play">play</a>("mysounds/bells.wav");
  </pre>
 
<p> A second API is provided in which a QSound object is created
from a sound file and is later played:
<pre>
    QSound bells("mysounds/bells.wav");

    bells.<a href="#play">play</a>();
  </pre>
 
<p> Sounds played by the second model may use more memory but play
more immediately than sounds played using the first model, depending
on the underlying platform audio facilities.
<p> On Microsoft Windows the underlying multimedia system is used; only WAVE
format sound files are supported. 
<p> On X11 the <a href="ftp://ftp.x.org/contrib/audio/nas/">Network Audio
System</a> is used if available, otherwise all operations work
silently. NAS supports WAVE and AU files.
<p> On Macintosh, in an ironic turn of events we use QT (<a
href="http://quicktime.apple.com">QuickTime</a>) for sound, this means
all QuickTime formats are supported by Qt/Mac.
<p> On Qt/Embedded, a built-in mixing sound server is used, which accesses
<tt>/dev/dsp</tt> directly. Only the WAVE format is supported.
<p> The availability of sound can be tested with <a href="#isAvailable">QSound::isAvailable</a>().
<p>See also <a href="multimedia.html">Multimedia Classes</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QSound"></a>QSound::QSound ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;filename, <a href="qobject.html">QObject</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a QSound that can quickly play the sound in a file
named <em>filename</em>.
<p> This can use more memory than the static <tt>play</tt> function.
<p> The <em>parent</em> and <em>name</em> arguments (default 0) are passed on to
the <a href="qobject.html">QObject</a> constructor.

<h3 class=fn><a name="~QSound"></a>QSound::~QSound ()
</h3>
Destroys the sound object.

<h3 class=fn>bool <a name="available"></a>QSound::available ()<tt> [static]</tt>
</h3>

<p> Returns TRUE if sound support is available; otherwise returns FALSE.

<h3 class=fn><a href="qstring.html">QString</a> <a name="fileName"></a>QSound::fileName () const
</h3>
Returns the filename associated with the sound.

<h3 class=fn>bool <a name="isAvailable"></a>QSound::isAvailable ()<tt> [static]</tt>
</h3>
Returns TRUE if sound facilities exist on the platform; otherwise
returns FALSE. An application may choose either to notify the user
if sound is crucial to the application or to operate silently
without bothering the user.
<p> If no sound is available, all QSound operations work silently
and quickly.

<h3 class=fn>bool <a name="isFinished"></a>QSound::isFinished () const
</h3>
Returns TRUE if the sound has finished playing; otherwise returns FALSE.

<h3 class=fn>int <a name="loops"></a>QSound::loops () const
</h3>
Returns the number of times the sound will play.

<h3 class=fn>int <a name="loopsRemaining"></a>QSound::loopsRemaining () const
</h3>
Returns the number of times the sound will loop. This value decreases
each time the sound loops.

<h3 class=fn>void <a name="play"></a>QSound::play ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;filename )<tt> [static]</tt>
</h3>
Plays the sound in a file called <em>filename</em>.

<p>Example: <a href="sound-example.html#x2484">sound/sound.cpp</a>.
<h3 class=fn>void <a name="play-2"></a>QSound::play ()<tt> [slot]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Starts the sound playing.  The function returns immediately.
Depending on the platform audio facilities, other sounds may
stop or may be mixed with the new sound.
<p> The sound can be played again at any time, possibly mixing or
replacing previous plays of the sound.

<h3 class=fn>void <a name="setLoops"></a>QSound::setLoops ( int&nbsp;l )
</h3>
Sets the sound to repeat <em>l</em> times when it is played.
Passing the value -1 will cause the sound to loop indefinitely.
<p>See also <a href="#loops">loops</a>().

<h3 class=fn>void <a name="stop"></a>QSound::stop ()<tt> [slot]</tt>
</h3>
Stops the sound playing.
<p> <p>See also <a href="#play">play</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>