1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
|
<?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" />
<!-- phonon-api.qdoc -->
<title>Qt 4.8: AudioOutput Class Reference</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>Qt 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="modules.html">Modules</a></li>
<li><a href="phonon.html">Phonon</a></li>
<li>AudioOutput</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="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">AudioOutput Class Reference</h1>
<span class="small-subtitle">(Phonon::AudioOutput)<br/></span>
<!-- $$$AudioOutput-brief -->
<p>The AudioOutput class is used to send data to audio output devices. <a href="#details">More...</a></p>
<!-- @@@AudioOutput -->
<pre class="cpp"> <span class="preprocessor">#include <Phonon/AudioOutput></span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a> and <a href="phonon-medianode.html">MediaNode</a>.</p>
<p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="phonon-audiooutput-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="phonon-audiooutput.html#muted-prop">muted</a></b> : bool</li>
<li class="fn"><b><a href="phonon-audiooutput.html#name-prop">name</a></b> : QString</li>
<li class="fn"><b><a href="phonon-audiooutput.html#outputDevice-prop">outputDevice</a></b> : AudioOutputDevice</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="phonon-audiooutput.html#volume-prop">volume</a></b> : qreal</li>
<li class="fn"><b><a href="phonon-audiooutput.html#volumeDecibel-prop">volumeDecibel</a></b> : qreal</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#AudioOutputx">AudioOutput</a></b> ( Phonon::Category <i>category</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#AudioOutput-2">AudioOutput</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Phonon::Category </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#category">category</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#muted-prop">isMuted</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#name-prop">name</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> AudioOutputDevice </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#outputDevice-prop">outputDevice</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#volume-prop">volume</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#volumeDecibel-prop">volumeDecibel</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">3 public functions inherited from <a href="phonon-medianode.html#public-functions">Phonon::MediaNode</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#muted-prop">setMuted</a></b> ( bool <i>mute</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#name-prop">setName</a></b> ( const QString & <i>newName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#outputDevice-prop">setOutputDevice</a></b> ( const Phonon::AudioOutputDevice & <i>newAudioOutputDevice</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#volume-prop">setVolume</a></b> ( qreal <i>newVolume</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#volumeDecibel-prop">setVolumeDecibel</a></b> ( qreal <i>newVolumeDecibel</i> )</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#mutedChanged">mutedChanged</a></b> ( bool <i>muted</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#outputDeviceChanged">outputDeviceChanged</a></b> ( const Phonon::AudioOutputDevice & <i>newAudioOutputDevice</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="phonon-audiooutput.html#volumeChanged">volumeChanged</a></b> ( qreal <i>newVolume</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$AudioOutput-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The AudioOutput class is used to send data to audio output devices.</p>
<p>The AudioOutput class plays sound over a sound device. The audio output needs to be connected to a <a href="phonon-mediaobject.html">MediaObject</a> using <a href="phonon-path.html#createPath">createPath()</a>. To start playback, you call <a href="phonon-mediaobject.html#play">play()</a> on the media object.</p>
<pre class="cpp"> Phonon<span class="operator">::</span>MediaObject <span class="operator">*</span>mediaObject <span class="operator">=</span> <span class="keyword">new</span> Phonon<span class="operator">::</span>MediaObject(<span class="keyword">this</span>);
mediaObject<span class="operator">-</span><span class="operator">></span>setCurrentSource(Phonon<span class="operator">::</span>MediaSource(<span class="string">"/mymusic/barbiegirl.wav"</span>));
Phonon<span class="operator">::</span>AudioOutput <span class="operator">*</span>audioOutput <span class="operator">=</span>
<span class="keyword">new</span> Phonon<span class="operator">::</span>AudioOutput(Phonon<span class="operator">::</span>MusicCategory<span class="operator">,</span> <span class="keyword">this</span>);
Phonon<span class="operator">::</span>Path path <span class="operator">=</span> Phonon<span class="operator">::</span>createPath(mediaObject<span class="operator">,</span> audioOutput);</pre>
<p>The class supports changing the <a href="phonon-audiooutput.html#volume-prop">volume</a>(). It is also possible to mute the sound.</p>
<p>To find out what <a href="phonon-objectdescription.html#AudioOutputDevice-typedef">AudioOutputDevice</a>s are available for AudioOutput, you can call <a href="phonon-backendcapabilities.html#availableAudioOutputDevices">BackendCapabilities::availableAudioOutputDevices</a>(). A default device is selected by the backend, but it is possible to set the device to be used with <a href="phonon-audiooutput.html#outputDevice-prop">setOutputDevice</a>(). The <a href="phonon-audiooutput.html#outputDeviceChanged">outputDeviceChanged</a>() signal will be emitted if the device changes.</p>
<p>If an error occurs with the playback, for instance, if no valid output device is found, the media object will receive a stateChanged() signal with the <a href="phonon.html#State-enum">ErrorState</a>.</p>
<p>Note that the default values of properties are dependent on the backend.</p>
</div>
<p><b>See also </b><a href="phonon-volumeslider.html">Phonon::VolumeSlider</a>, <a href="phonon-qmusicplayer.html">Music Player Example</a>, <a href="phonon-backendcapabilities.html">BackendCapabilities</a>, and <a href="phonon-module.html">Phonon Module</a>.</p>
<!-- @@@AudioOutput -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$muted-prop$$$isMuted$$$setMutedbool$$$mutedChangedbool -->
<h3 class="fn"><a name="muted-prop"></a><span class="name">muted</span> : <span class="type">bool</span></h3>
<p>This property tells whether the output is muted.</p>
<p>Muting the output has the same effect as calling setVolume(0.0).</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isMuted</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMuted</b></span> ( bool <i>mute</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="phonon-audiooutput.html#mutedChanged">mutedChanged</a></b></span> ( bool <i>muted</i> )</td></tr>
</table>
<!-- @@@muted -->
<!-- $$$name-prop$$$name$$$setNameconstQString& -->
<h3 class="fn"><a name="name-prop"></a><span class="name">name</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This is the name that appears in Mixer applications that control the volume of this output.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>name</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setName</b></span> ( const QString & <i>newName</i> )</td></tr>
</table>
<!-- @@@name -->
<!-- $$$outputDevice-prop$$$outputDevice$$$setOutputDeviceconstPhonon::AudioOutputDevice& -->
<h3 class="fn"><a name="outputDevice-prop"></a><span class="name">outputDevice</span> : <span class="type"><a href="phonon-objectdescription.html#AudioOutputDevice-typedef">AudioOutputDevice</a></span></h3>
<p>This property holds the (hardware) destination for the output.</p>
<p>The default device is determined by the <a href="phonon.html#Category-enum">Category</a> and the global configuration for that category. Normally you don't need to override this setting - letting the user change the global configuration is the right choice. You can still override the device though, if you have good reasons to do so.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> AudioOutputDevice </td><td class="memItemRight bottomAlign"><span class="name"><b>outputDevice</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>setOutputDevice</b></span> ( const Phonon::AudioOutputDevice & <i>newAudioOutputDevice</i> )</td></tr>
</table>
<p><b>See also </b><a href="phonon-audiooutput.html#outputDeviceChanged">outputDeviceChanged</a>().</p>
<!-- @@@outputDevice -->
<!-- $$$volume-prop$$$volume$$$setVolumeqreal$$$volumeChangedqreal -->
<h3 class="fn"><a name="volume-prop"></a><span class="name">volume</span> : <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>This is the current loudness of the output.</p>
<p>(it is using Stevens' law to calculate the change in voltage internally).</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>volume</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setVolume</b></span> ( qreal <i>newVolume</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="phonon-audiooutput.html#volumeChanged">volumeChanged</a></b></span> ( qreal <i>newVolume</i> )</td></tr>
</table>
<p><b>See also </b><a href="phonon-audiooutput.html#volumeDecibel-prop">volumeDecibel</a>.</p>
<!-- @@@volume -->
<!-- $$$volumeDecibel-prop$$$volumeDecibel$$$setVolumeDecibelqreal -->
<h3 class="fn"><a name="volumeDecibel-prop"></a><span class="name">volumeDecibel</span> : <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>This is the current volume of the output in decibel.</p>
<p>0 dB means no change in volume, -6dB means an attenuation of the voltage to 50% and an attenuation of the power to 25%, -inf dB means silence.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>volumeDecibel</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setVolumeDecibel</b></span> ( qreal <i>newVolumeDecibel</i> )</td></tr>
</table>
<p><b>See also </b><a href="phonon-audiooutput.html#volume-prop">volume</a>.</p>
<!-- @@@volumeDecibel -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$AudioOutput[overload1]$$$AudioOutputPhonon::CategoryQObject* -->
<h3 class="fn"><a name="AudioOutputx"></a>AudioOutput::<span class="name">AudioOutput</span> ( <span class="type"><a href="phonon.html#Category-enum">Phonon::Category</a></span> <i>category</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Creates a new <a href="phonon-audiooutput.html">AudioOutput</a> with the given <i>parent</i> that defines output to a physical device.</p>
<p>The <i>category</i> can be used by mixer applications to group volume controls of applications into categories. That makes it easier for the user to identify the programs. The category is also used for the default output device that is configured centrally. As an example: often users want to have the audio signal of a VoIP application go to their USB headset while all other sounds should go to the internal soundcard.</p>
<p><b>See also </b><a href="phonon.html#categoryToString">Phonon::categoryToString</a>() and <a href="phonon-audiooutput.html#outputDevice-prop">outputDevice</a>.</p>
<!-- @@@AudioOutput -->
<!-- $$$AudioOutput$$$AudioOutputQObject* -->
<h3 class="fn"><a name="AudioOutput-2"></a>AudioOutput::<span class="name">AudioOutput</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Creates a new <a href="phonon-audiooutput.html">AudioOutput</a> that defines output to the system default device with the {Phonon::Category::}{<a href="phonon.html#Category-enum">NoCategory</a>} category</p>
<p><b>See also </b><a href="phonon.html#categoryToString">Phonon::categoryToString</a>() and <a href="phonon-audiooutput.html#outputDevice-prop">outputDevice</a>.</p>
<!-- @@@AudioOutput -->
<!-- $$$category[overload1]$$$category -->
<h3 class="fn"><a name="category"></a><span class="type"><a href="phonon.html#Category-enum">Phonon::Category</a></span> AudioOutput::<span class="name">category</span> () const</h3>
<p>Returns the category of this output.</p>
<p><b>See also </b><a href="phonon-audiooutput.html#AudioOutputx">Phonon::AudioOutput::AudioOutput</a>().</p>
<!-- @@@category -->
<!-- $$$mutedChanged[overload1]$$$mutedChangedbool -->
<h3 class="fn"><a name="mutedChanged"></a><span class="type">void</span> AudioOutput::<span class="name">mutedChanged</span> ( <span class="type">bool</span> <i>muted</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the muted property has changed. The <i>muted</i> value passed by the signal indicates the state of the muted property. As this property can change by IPC (DBus) calls a UI element showing the muted property should listen to this signal.</p>
<!-- @@@mutedChanged -->
<!-- $$$outputDeviceChanged[overload1]$$$outputDeviceChangedconstPhonon::AudioOutputDevice& -->
<h3 class="fn"><a name="outputDeviceChanged"></a><span class="type">void</span> AudioOutput::<span class="name">outputDeviceChanged</span> ( const <span class="type"><a href="phonon-objectdescription.html#AudioOutputDevice-typedef">Phonon::AudioOutputDevice</a></span> & <i>newAudioOutputDevice</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the (hardware) device for the output has changed. <i>newAudioOutputDevice</i> is the new device.</p>
<p>The change can happen either through setOutputDevice or if the global configuration for the used category has changed.</p>
<p><b>See also </b><a href="phonon-audiooutput.html#outputDevice-prop">outputDevice</a>.</p>
<!-- @@@outputDeviceChanged -->
<!-- $$$volumeChanged[overload1]$$$volumeChangedqreal -->
<h3 class="fn"><a name="volumeChanged"></a><span class="type">void</span> AudioOutput::<span class="name">volumeChanged</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>newVolume</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the volume has changed. As the volume can change without a call to setVolume (calls over dbus) this is important to keep a widget showing the current volume up to date.</p>
<p><i>newVolume</i> is the new volume level.</p>
<p><b>See also </b><a href="phonon-audiooutput.html#volume-prop">setVolume</a>() and <a href="phonon-audiooutput.html#volume-prop">volume</a>().</p>
<!-- @@@volumeChanged -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed 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>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|