Files
qt4-x11/doc/html/phonon-objectdescription.html
2025-08-24 20:55:26 +08:00

335 lines
24 KiB
HTML

<?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: ObjectDescription Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script src="scripts/jquery.js" type="text/javascript"></script>
<script src="scripts/functions.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="style/superfish.css" />
<link rel="stylesheet" type="text/css" href="style/narrow.css" />
<!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<div class="header" id="qtdocheader">
<div class="content">
<div id="nav-logo">
<a href="index.html">Home</a></div>
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
<div id="narrowsearch"></div>
<div id="nav-topright">
<ul>
<li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
<li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
<li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
DOC</a></li>
<li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
</ul>
</div>
<div id="shortCut">
<ul>
<li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
<li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li>
</ul>
</div>
<ul class="sf-menu" id="narrowmenu">
<li><a href="#">API Lookup</a>
<ul>
<li><a href="classes.html">Class index</a></li>
<li><a href="functions.html">Function index</a></li>
<li><a href="modules.html">Modules</a></li>
<li><a href="namespaces.html">Namespaces</a></li>
<li><a href="qtglobal.html">Global Declarations</a></li>
<li><a href="qdeclarativeelements.html">QML elements</a></li>
</ul>
</li>
<li><a href="#">Qt Topics</a>
<ul>
<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
<li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
<li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
<li><a href="supported-platforms.html">Supported Platforms</a></li>
<li><a href="technology-apis.html">Qt and Key Technologies</a></li>
<li><a href="best-practices.html">How-To's and Best Practices</a></li>
</ul>
</li>
<li><a href="#">Examples</a>
<ul>
<li><a href="all-examples.html">Examples</a></li>
<li><a href="tutorials.html">Tutorials</a></li>
<li><a href="demos.html">Demos</a></li>
<li><a href="qdeclarativeexamples.html">QML Examples</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="wrapper">
<div class="hd">
<span></span>
</div>
<div class="bd group">
<div class="sidebar">
<div class="searchlabel">
Search index:</div>
<div class="search" id="sidebarsearch">
<form id="qtdocsearch" action="" onsubmit="return false;">
<fieldset>
<input type="text" name="searchstring" id="pageType" value="" />
<div id="resultdialog">
<a href="#" id="resultclose">Close</a>
<p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p>
<p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p>
<ul id="resultlist" class="all">
</ul>
</div>
</fieldset>
</form>
</div>
<div class="box first bottombar" id="lookup">
<h2 title="API Lookup"><span></span>
API Lookup</h2>
<div id="list001" class="list">
<ul id="ul001" >
<li class="defaultLink"><a href="classes.html">Class index</a></li>
<li class="defaultLink"><a href="functions.html">Function index</a></li>
<li class="defaultLink"><a href="modules.html">Modules</a></li>
<li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
<li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
<li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
</ul>
</div>
</div>
<div class="box bottombar" id="topics">
<h2 title="Qt Topics"><span></span>
Qt Topics</h2>
<div id="list002" class="list">
<ul id="ul002" >
<li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
<li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
<li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
<li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>
<li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
<li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
</ul>
</div>
</div>
<div class="box" id="examples">
<h2 title="Examples"><span></span>
Examples</h2>
<div id="list003" class="list">
<ul id="ul003">
<li class="defaultLink"><a href="all-examples.html">Examples</a></li>
<li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
<li class="defaultLink"><a href="demos.html">Demos</a></li>
<li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
</ul>
</div>
</div>
</div>
<div class="wrap">
<div class="toolbar">
<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>ObjectDescription</li>
</ul>
</div>
<div class="toolbuttons toolblock">
<ul>
<li id="smallA" class="t_button">A</li>
<li id="medA" class="t_button active">A</li>
<li id="bigA" class="t_button">A</li>
<li id="print" class="t_button"><a href="javascript:this.print();">
<span>Print</span></a></li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">ObjectDescription Class Reference</h1>
<span class="small-subtitle">(Phonon::ObjectDescription)<br/></span>
<!-- $$$ObjectDescription-brief -->
<p>The ObjectDescription class provides information about Phonon objects. <a href="#details">More...</a></p>
<!-- @@@ObjectDescription -->
<pre class="cpp"> <span class="preprocessor">#include &lt;Phonon/ObjectDescription&gt;</span></pre><p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="phonon-objectdescription-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#description">description</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#index">index</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#name">name</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#property">property</a></b> ( const char * <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QByteArray&gt; </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#propertyNames">propertyNames</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#operator-not-eq">operator!=</a></b> ( const ObjectDescription &amp; <i>otherDescription</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#operator-eq-eq">operator==</a></b> ( const ObjectDescription &amp; <i>otherDescription</i> ) const</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#AudioOutputDevice-typedef">AudioOutputDevice</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#EffectDescription-typedef">EffectDescription</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="phonon-objectdescription.html#ObjectDescriptionType-enum">ObjectDescriptionType</a></b> { AudioOutputDeviceType, EffectType }</td></tr>
</table>
<a name="details"></a>
<!-- $$$ObjectDescription-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The ObjectDescription class provides information about Phonon objects.</p>
<p>Phonon currently uses this class to describe audio effects and audio output devices - using the typedefs <a href="phonon-objectdescription.html#AudioOutputDevice-typedef">AudioOutputDevice</a> and <a href="phonon-objectdescription.html#EffectDescription-typedef">EffectDescription</a>. The type of an ObjectDescription is also described through the <a href="phonon-objectdescription.html#ObjectDescriptionType-enum">ObjectDescriptionType</a> enum. Objects of the same <a href="phonon-objectdescription.html#ObjectDescriptionType-enum">type</a> are uniquely identified by an <a href="phonon-objectdescription.html#index">index</a>().</p>
<p>The class gives a <a href="phonon-objectdescription.html#description">description</a>() and a <a href="phonon-objectdescription.html#name">name</a>() of the object, both of which are strings appropriate for end users of a Phonon application. You can also check whether the device or effect described is <a href="phonon-objectdescription.html#isValid">valid</a>. This does not guarantee that the device or effect functions as expected, but that the ObjectDescription describes an existing device or effect.</p>
<p>Audio output devices and effect descriptions are used to select the audio output device to be used for playback and to create effects; we show examples of this in the snippet below. The available descriptions can be fetched with <a href="phonon-backendcapabilities.html#availableAudioOutputDevices">availableAudioOutputDevices()</a> and <a href="phonon-backendcapabilities.html#availableAudioEffects">availableAudioEffects()</a> static functions in the <a href="phonon-backendcapabilities.html">Phonon::BackendCapabilities</a> namespace</p>
<pre class="cpp"> <span class="type"><a href="qlist.html">QList</a></span><span class="operator">&lt;</span>Phonon<span class="operator">::</span>EffectDescription<span class="operator">&gt;</span> effectDescriptions <span class="operator">=</span>
Phonon<span class="operator">::</span>BackendCapabilities<span class="operator">::</span>availableAudioEffects();
<span class="type"><a href="qlist.html">QList</a></span><span class="operator">&lt;</span>Phonon<span class="operator">::</span>AudioOutputDevice<span class="operator">&gt;</span> audioOutputDevices <span class="operator">=</span>
Phonon<span class="operator">::</span>BackendCapabilities<span class="operator">::</span>availableAudioOutputDevices();
foreach (Phonon<span class="operator">::</span>EffectDescription effectDescription<span class="operator">,</span> effectDescriptions) {
Phonon<span class="operator">::</span>Effect <span class="operator">*</span>effect <span class="operator">=</span> <span class="keyword">new</span> Phonon<span class="operator">::</span>Effect(effectDescription);
<span class="comment">// ... Do something with the effect, like insert it into a media graph</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;
audioOutput<span class="operator">-</span><span class="operator">&gt;</span>setOutputDevice(audioOutputDevices<span class="operator">[</span><span class="number">0</span><span class="operator">]</span>);</pre>
<p>Other types of ObjectDescriptions might be possible in the future, e.g&#x2e;, descriptions of audio capture devices, such as microphones.</p>
</div>
<p><b>See also </b><a href="phonon-objectdescription.html#AudioOutputDevice-typedef">Phonon::AudioOutputDevice</a>, <a href="phonon-objectdescription.html#EffectDescription-typedef">Phonon::EffectDescription</a>, <a href="phonon-capabilities.html">Capabilities Example</a>, and <a href="phonon-module.html">Phonon Module</a>.</p>
<!-- @@@ObjectDescription -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$description[overload1]$$$description -->
<h3 class="fn"><a name="description"></a><span class="type"><a href="qstring.html">QString</a></span> ObjectDescription::<span class="name">description</span> () const</h3>
<p>Returns a more extensive description than the <a href="phonon-objectdescription.html#name">name</a>() function.</p>
<p>For example, in the case of <a href="phonon-objectdescription.html#AudioOutputDevice-typedef">AudioOutputDevice</a>s, this text should make clear which sound source is described; this is sometimes hard to describe or understand from just the name.</p>
<p>The text is appropriate to present to an end user in for example tool tips of items, with the <a href="phonon-objectdescription.html#name">name</a>()'s as text, in a <a href="qcombobox.html">QComboBox</a>.</p>
<!-- @@@description -->
<!-- $$$index[overload1]$$$index -->
<h3 class="fn"><a name="index"></a><span class="type">int</span> ObjectDescription::<span class="name">index</span> () const</h3>
<p>Returns a unique identifier for this <a href="phonon-objectdescription.html">ObjectDescription</a>. Used internally to distinguish between the descriptions.</p>
<p>Notice that the identifiers are only unique to the type of description, e.g&#x2e;, <a href="phonon-objectdescription.html#AudioOutputDevice-typedef">AudioOutputDevice</a> or <a href="phonon-objectdescription.html#EffectDescription-typedef">EffectDescription</a>.</p>
<!-- @@@index -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> ObjectDescription::<span class="name">isValid</span> () const</h3>
<p>Returns true if the device or effect described exists.</p>
<p>An <a href="phonon-objectdescription.html">ObjectDescription</a> that is invalid, will also have an <a href="phonon-objectdescription.html#index">index</a>() of -1.</p>
<p><b>See also </b><a href="phonon-objectdescription.html#index">index</a>().</p>
<!-- @@@isValid -->
<!-- $$$name[overload1]$$$name -->
<h3 class="fn"><a name="name"></a><span class="type"><a href="qstring.html">QString</a></span> ObjectDescription::<span class="name">name</span> () const</h3>
<p>Returns a string appropriate for a user to select between object descriptions, e.g&#x2e;, from a <a href="qcombobox.html">QComboBox</a>.</p>
<p><b>See also </b><a href="phonon-objectdescription.html#description">description</a>().</p>
<!-- @@@name -->
<!-- $$$property[overload1]$$$propertyconstchar* -->
<h3 class="fn"><a name="property"></a><span class="type"><a href="qvariant.html">QVariant</a></span> ObjectDescription::<span class="name">property</span> ( const <span class="type">char</span> * <i>name</i> ) const</h3>
<p>Returns the property named <i>name</i>. A property can be used for extended information, such as the manufacturer of a sound card. The information will usually be given as text.</p>
<p>If the property is not set an invalid <a href="qvariant.html">QVariant</a> is returned.</p>
<p>Qt's backends do not use properties at the time of this writing.</p>
<p><b>See also </b><a href="phonon-objectdescription.html#propertyNames">propertyNames</a>().</p>
<!-- @@@property -->
<!-- $$$propertyNames[overload1]$$$propertyNames -->
<h3 class="fn"><a name="propertyNames"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qbytearray.html">QByteArray</a></span>&gt; ObjectDescription::<span class="name">propertyNames</span> () const</h3>
<p>Properties can be used for extended information about a <a href="phonon-objectdescription.html">ObjectDescription</a>, e.g&#x2e;, a manufacturer of a sound card. The information will usually be given text.</p>
<p>This function returns all names that return valid data when <a href="phonon-objectdescription.html#property">property</a>() is called.</p>
<p>Currently, Qt backends do not use properties for their object descriptions.</p>
<p><b>See also </b><a href="phonon-objectdescription.html#property">property</a>().</p>
<!-- @@@propertyNames -->
<!-- $$$operator!=[overload1]$$$operator!=constObjectDescription& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> ObjectDescription::<span class="name">operator!=</span> ( const <span class="type">ObjectDescription</span> &amp; <i>otherDescription</i> ) const</h3>
<p>Returns <tt>false</tt> if this <a href="phonon-objectdescription.html">ObjectDescription</a> describes the same as <i>otherDescription</i>; otherwise, returns <tt>true</tt>.</p>
<!-- @@@operator!= -->
<!-- $$$operator==[overload1]$$$operator==constObjectDescription& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> ObjectDescription::<span class="name">operator==</span> ( const <span class="type">ObjectDescription</span> &amp; <i>otherDescription</i> ) const</h3>
<p>Returns <tt>true</tt> if this <a href="phonon-objectdescription.html">ObjectDescription</a> describes the same object as <i>otherDescription</i>; otherwise, returns <tt>false</tt>.</p>
<!-- @@@operator== -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$AudioOutputDevice -->
<h3 class="fn"><a name="AudioOutputDevice-typedef"></a>typedef Phonon::<span class="name">AudioOutputDevice</span></h3>
<p>This typedef of <a href="phonon-objectdescription.html">ObjectDescription</a> describes an audio output device, such as soundcards (with different drivers), sound servers, or other virtual outputs like playback on a different computer on the network.</p>
<p>A list of available devices is given by the backend with Backendcapabilities::availableAudioOutputDevices()</p>
<pre class="cpp"> <span class="type"><a href="qlist.html">QList</a></span><span class="operator">&lt;</span>Phonon<span class="operator">::</span>AudioOutputDevice<span class="operator">&gt;</span> audioOutputDevices <span class="operator">=</span>
Phonon<span class="operator">::</span>BackendCapabilities<span class="operator">::</span>availableAudioOutputDevices();</pre>
<!-- @@@AudioOutputDevice -->
<!-- $$$EffectDescription -->
<h3 class="fn"><a name="EffectDescription-typedef"></a>typedef Phonon::<span class="name">EffectDescription</span></h3>
<p>EffectDescription gives a description of an <a href="phonon-overview.html#processors">audio effect</a>. It is a typedef of the <a href="phonon-objectdescription.html">ObjectDescription</a> class. Please see its class description for details.</p>
<p>EffectDescription is used to create audio <a href="phonon-effect.html">Effect</a>s, which can be inserted into a media graph, altering an audio stream.</p>
<p><b>See also </b><a href="phonon-objectdescription.html">Phonon::ObjectDescription</a>, <a href="phonon-capabilities.html">Capabilities Example</a>, and <a href="demos-qmediaplayer.html">Media Player</a>.</p>
<!-- @@@EffectDescription -->
<!-- $$$ObjectDescriptionType$$$AudioOutputDeviceType$$$EffectType$$$AudioChannelType$$$SubtitleType$$$AudioCaptureDeviceType -->
<h3 class="fn"><a name="ObjectDescriptionType-enum"></a>enum Phonon::<span class="name">ObjectDescriptionType</span></h3>
<p>This enum defines the type of information that is contained in a <a href="phonon-objectdescription.html">ObjectDescription</a> object.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>Phonon::AudioOutputDeviceType</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">An audio output device (<a href="phonon-objectdescription.html#AudioOutputDevice-typedef">AudioOutputDevice</a>). This can be soundcards (with different drivers), sound servers, or other virtual outputs like playback on a different computer on the network.</td></tr>
<tr><td class="topAlign"><tt>Phonon::EffectType</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">An audio effect (<a href="phonon-objectdescription.html#EffectDescription-typedef">EffectDescription</a>).</td></tr>
</table>
<!-- @@@ObjectDescriptionType -->
</div>
</div>
</div>
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
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>
Qt and respective logos are trademarks of The Qt Company Ltd
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>
<script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>