
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheObjectDescription class provides information about Phonon objects.More...
| Header: | #include <Phonon/ObjectDescription> |
| Since: | Qt 4.4 |
| QString | description() const |
| int | index() const |
| bool | isValid() const |
| QString | name() const |
| QVariant | property(const char * name) const |
| QList<QByteArray> | propertyNames() const |
| bool | operator!=(const ObjectDescription & otherDescription) const |
| bool | operator==(const ObjectDescription & otherDescription) const |
| typedef | AudioOutputDevice |
| typedef | EffectDescription |
| enum | ObjectDescriptionType { AudioOutputDeviceType, EffectType } |
TheObjectDescription class provides information about Phonon objects.
Phonon currently uses this class to describe audio effects and audio output devices - using the typedefsAudioOutputDevice andEffectDescription. The type of anObjectDescription is also described through theObjectDescriptionType enum. Objects of the sametype are uniquely identified by anindex().
The class gives adescription() and aname() 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 isvalid. This does not guarantee that the device or effect functions as expected, but that theObjectDescription describes an existing device or effect.
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 availableAudioOutputDevices() and availableAudioEffects() static functions in thePhonon::BackendCapabilities namespace
QList<Phonon::EffectDescription> effectDescriptions= Phonon::BackendCapabilities::availableAudioEffects();QList<Phonon::AudioOutputDevice> audioOutputDevices= Phonon::BackendCapabilities::availableAudioOutputDevices(); foreach (Phonon::EffectDescription effectDescription, effectDescriptions) { Phonon::Effect*effect=new Phonon::Effect(effectDescription);// ... Do something with the effect, like insert it into a media graph } Phonon::AudioOutput*audioOutput=new Phonon::AudioOutput; audioOutput->setOutputDevice(audioOutputDevices[0]);
Other types of ObjectDescriptions might be possible in the future, e.g., descriptions of audio capture devices, such as microphones.
See alsoPhonon::AudioOutputDevice,Phonon::EffectDescription,Capabilities Example, andPhonon Module.
Returns a more extensive description than thename() function.
For example, in the case ofAudioOutputDevices, this text should make clear which sound source is described; this is sometimes hard to describe or understand from just the name.
The text is appropriate to present to an end user in for example tool tips of items, with thename()'s as text, in aQComboBox.
Returns a unique identifier for thisObjectDescription. Used internally to distinguish between the descriptions.
Notice that the identifiers are only unique to the type of description, e.g.,AudioOutputDevice orEffectDescription.
Returns true if the device or effect described exists.
AnObjectDescription that is invalid, will also have anindex() of -1.
See alsoindex().
Returns a string appropriate for a user to select between object descriptions, e.g., from aQComboBox.
See alsodescription().
Returns the property namedname. A property can be used for extended information, such as the manufacturer of a sound card. The information will usually be given as text.
If the property is not set an invalidQVariant is returned.
Qt's backends do not use properties at the time of this writing.
See alsopropertyNames().
Properties can be used for extended information about aObjectDescription, e.g., a manufacturer of a sound card. The information will usually be given text.
This function returns all names that return valid data whenproperty() is called.
Currently, Qt backends do not use properties for their object descriptions.
See alsoproperty().
Returnsfalse if thisObjectDescription describes the same asotherDescription; otherwise, returnstrue.
Returnstrue if thisObjectDescription describes the same object asotherDescription; otherwise, returnsfalse.
This typedef ofObjectDescription 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.
A list of available devices is given by the backend with Backendcapabilities::availableAudioOutputDevices()
QList<Phonon::AudioOutputDevice> audioOutputDevices= Phonon::BackendCapabilities::availableAudioOutputDevices();
EffectDescription gives a description of anaudio effect. It is a typedef of theObjectDescription class. Please see its class description for details.
EffectDescription is used to create audioEffects, which can be inserted into a media graph, altering an audio stream.
See alsoPhonon::ObjectDescription,Capabilities Example, andMedia Player.
This enum defines the type of information that is contained in aObjectDescription object.
| Constant | Value | Description |
|---|---|---|
Phonon::AudioOutputDeviceType | 0 | An audio output device (AudioOutputDevice). This can be soundcards (with different drivers), sound servers, or other virtual outputs like playback on a different computer on the network. |
Phonon::EffectType | 1 | An audio effect (EffectDescription). |
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. 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.