Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 50facae208d4a6f280e44a513b104320 > files > 1446

qt-mobility-doc-1.2.0-13.mga5.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsoundeffect.cpp -->
  <title>Qt Mobility 1.2: QML SoundEffect Element</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>QtMobility Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="http://qt.nokia.com/doc/4.7/qdeclarativeelements.html">QML Elements</a></li>
<li>QML SoundEffect Element</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signal-handlers">Signal Handlers</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QML SoundEffect Element</h1>
<span class="subtitle"></span>
<!-- $$$SoundEffect-brief -->
<p>The SoundEffect element provides a way to play sound effects in QML. <a href="#details">More...</a></p>
<!-- @@@SoundEffect -->
<p>This element was introduced in Qt Mobility 1.0.</p>
<ul>
<li><a href="qml-soundeffect-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-soundeffect.html#loops-prop">loops</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-soundeffect.html#muted-prop">muted</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-soundeffect.html#playing-prop">playing</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-soundeffect.html#source-prop">source</a></b></b> : url</li>
<li class="fn"><b><b><a href="qml-soundeffect.html#status-prop">status</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-soundeffect.html#volume-prop">volume</a></b></b> : qreal</li>
</ul>
<a name="signal-handlers"></a>
<h2>Signal Handlers</h2>
<ul>
<li class="fn"><b><b><a href="qml-soundeffect.html#loopsChanged-signal">loopsChanged</a></b></b></li>
<li class="fn"><b><b><a href="qml-soundeffect.html#mutedChanged-signal">mutedChanged</a></b></b></li>
<li class="fn"><b><b><a href="qml-soundeffect.html#playingChanged-signal">playingChanged</a></b></b></li>
<li class="fn"><b><b><a href="qml-soundeffect.html#sourceChanged-signal">sourceChanged</a></b></b></li>
<li class="fn"><b><b><a href="qml-soundeffect.html#statusChanged-signal">statusChanged</a></b></b></li>
<li class="fn"><b><b><a href="qml-soundeffect.html#volumeChanged-signal">volumeChanged</a></b></b></li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-soundeffect.html#play-method">play</a></b></b></li>
<li class="fn"><b><b><a href="qml-soundeffect.html#stop-method">stop</a></b></b></li>
</ul>
<!-- $$$SoundEffect-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>This element is part of the <b><a href="qtmultimediakit.html">QtMultimediaKit</a> 1.1</b> module.</p>
<p>The following example plays a WAV file on mouse click.</p>
<pre class="qml"> import Qt 4.7
 import QtMultimediaKit 1.1

 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {
     <span class="name">text</span>: <span class="string">&quot;Click Me!&quot;</span>;
     <span class="name">font</span>.pointSize: <span class="number">24</span>;
     <span class="name">width</span>: <span class="number">150</span>; <span class="name">height</span>: <span class="number">50</span>;

     <span class="type">SoundEffect</span> {
         <span class="name">id</span>: <span class="name">playSound</span>
         <span class="name">source</span>: <span class="string">&quot;soundeffect.wav&quot;</span>
     }
     <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-mousearea.html">MouseArea</a></span> {
         <span class="name">id</span>: <span class="name">playArea</span>
         <span class="name">anchors</span>.fill: <span class="name">parent</span>
         <span class="name">onPressed</span>: { <span class="name">playSound</span>.<span class="name">play</span>() }
     }
 }</pre>
<!-- @@@SoundEffect -->
<h2>Property Documentation</h2>
<!-- $$$loops -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="loops-prop"></a><span class="name">loops</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property provides a way to control the number of times to repeat the sound on each <a href="qml-soundeffect.html#play-method">play()</a>.</p>
<p>Set to -1 (infinite) to enable infinite loop.</p>
<p>This property group was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@loops -->
<br/>
<!-- $$$muted -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="muted-prop"></a><span class="name">muted</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property provides a way to control muting.</p>
<p>This property group was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@muted -->
<br/>
<!-- $$$playing -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="playing-prop"></a><span class="qmlreadonly">read-only</span><span class="name">playing</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property indicates if the soundeffect is playing or not.</p>
<p>This property group was introduced in Qt Mobility 1.1.</p>
</div></div><!-- @@@playing -->
<br/>
<!-- $$$source -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="source-prop"></a><span class="name">source</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-url.html">url</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property provides a way to control the sound to play.</p>
<p>This property group was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@source -->
<br/>
<!-- $$$status -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="status-prop"></a><span class="qmlreadonly">read-only</span><span class="name">status</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property indicates the following status of the soundeffect.</p>
<p>Null: no source has been set or is null. Loading: the soundeffect is trying to load the source. Ready: the source is loaded and ready for play. Error: some error happened during operation, such as failure of loading the source.</p>
<p>This property group was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@status -->
<br/>
<!-- $$$volume -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="volume-prop"></a><span class="name">volume</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the volume of the playback, from 0.0 (silent) to 1.0 (maximum volume). Note: Currently this has no effect on Mac OS X and Symbian.</p>
<p>This property group was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@volume -->
<br/>
<h2>Signal Handler Documentation</h2>
<!-- $$$loopsChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="loopsChanged-signal"></a>SoundEffect::<span class="name">loopsChanged</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the number of loops has changed.</p>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@loopsChanged -->
<br/>
<!-- $$$mutedChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="mutedChanged-signal"></a>SoundEffect::<span class="name">mutedChanged</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the mute state has changed.</p>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@mutedChanged -->
<br/>
<!-- $$$playingChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="playingChanged-signal"></a>SoundEffect::<span class="name">playingChanged</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the playing property has changed.</p>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@playingChanged -->
<br/>
<!-- $$$sourceChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="sourceChanged-signal"></a>SoundEffect::<span class="name">sourceChanged</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the source has changed.</p>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@sourceChanged -->
<br/>
<!-- $$$statusChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="statusChanged-signal"></a>SoundEffect::<span class="name">statusChanged</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the status property has changed.</p>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@statusChanged -->
<br/>
<!-- $$$volumeChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="volumeChanged-signal"></a>SoundEffect::<span class="name">volumeChanged</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the volume has changed.</p>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@volumeChanged -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$play -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="play-method"></a>SoundEffect::<span class="name">play</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Start playback of the sound effect, looping the effect for the number of times as specificed in the loops property.</p>
<p>This is the default method for <a href="qml-soundeffect.html">SoundEffect</a>.</p>
<pre class="qml"> <span class="type"><a href="qml-soundeffect.html">SoundEffect</a></span> {
     <span class="name">id</span>: <span class="name">playSound</span>
     <span class="name">source</span>: <span class="string">&quot;soundeffect.wav&quot;</span>
 }
 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-mousearea.html">MouseArea</a></span> {
     <span class="name">id</span>: <span class="name">playArea</span>
     <span class="name">anchors</span>.fill: <span class="name">parent</span>
     <span class="name">onPressed</span>: { <span class="name">playSound</span>.<span class="name">play</span>() }
 }</pre>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@play -->
<br/>
<!-- $$$stop -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="stop-method"></a>SoundEffect::<span class="name">stop</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Stop current playback. Note that if the backend is PulseAudio, due to the limitation of the underlying API, tis stop will only prevent next looping but will not be able to stop current playback immediately.</p>
<p>This documentation was introduced in Qt Mobility 1.0.</p>
</div></div><!-- @@@stop -->
<br/>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
  <p>
     <acronym title="Copyright">&copy;</acronym> 2008-2011 Nokia Corporation and/or its
     subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
     in Finland and/or other countries worldwide.</p>
  <p>
     All other trademarks are property of their respective owners. <a title="Privacy Policy"
     href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
  <br />
  <p>
    Licensees holding valid Qt Commercial licenses may use this document in accordance with the    Qt Commercial License Agreement provided with the Software or, alternatively, in accordance    with the terms contained in a written agreement between you and Nokia.</p>
  <p>
    Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
    Free Documentation License version 1.3</a>
    as published by the Free Software Foundation.</p>
</div>
</body>
</html>