Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

ObjectDescription Class Reference
(Phonon::ObjectDescription)
[Phonon module]

The ObjectDescription class provides information about Phonon objects. More...

 #include <Phonon/ObjectDescription>

This class is not part of the Qt GUI Framework Edition.

This class was introduced in Qt 4.4.


Public Functions

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

Related Non-Members

typedef AudioOutputDevice
typedef EffectDescription
enum ObjectDescriptionType { AudioOutputDeviceType, EffectType }

Detailed Description

The ObjectDescription class provides information about Phonon objects.

Phonon currently uses this class to describe audio effects and audio output devices - using the typedefs AudioOutputDevice and EffectDescription. The type of an ObjectDescription is also described through the ObjectDescriptionType enum. Objects of the same type are uniquely identified by an index().

The class gives a description() and a name() 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 valid. This does not guarantee that the device or effect functions as expected, but that the ObjectDescription 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 the Phonon::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 also Phonon::AudioOutputDevice, Phonon::EffectDescription, Capabilities Example, and Phonon Module.


Member Function Documentation

QString ObjectDescription::description () const

Returns a more extensive description than the name() function.

For example, in the case of AudioOutputDevices, 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 the name()'s as text, in a QComboBox.

int ObjectDescription::index () const

Returns a unique identifier for this ObjectDescription. Used internally to distinguish between the descriptions.

Notice that the identifiers are only unique to the type of description, e.g., AudioOutputDevice or EffectDescription.

bool ObjectDescription::isValid () const

Returns true if the device or effect described exists.

An ObjectDescription that is invalid, will also have an index() of -1.

See also index().

QString ObjectDescription::name () const

Returns a string appropriate for a user to select between object descriptions, e.g., from a QComboBox.

See also description().

QVariant ObjectDescription::property ( const char * name ) const

Returns the property named name. 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 invalid QVariant is returned.

Qt's backends do not use properties at the time of this writing.

See also propertyNames().

QList<QByteArray> ObjectDescription::propertyNames () const

Properties can be used for extended information about a ObjectDescription, e.g., a manufacturer of a sound card. The information will usually be given text.

This function returns all names that return valid data when property() is called.

Currently, Qt backends do not use properties for their object descriptions.

See also property().

bool ObjectDescription::operator!= ( const ObjectDescription & otherDescription ) const

Returns false if this ObjectDescription describes the same as otherDescription; otherwise, returns true.

bool ObjectDescription::operator== ( const ObjectDescription & otherDescription ) const

Returns true if this ObjectDescription describes the same object as otherDescription; otherwise, returns false.


Related Non-Members

typedef Phonon::AudioOutputDevice

This typedef of ObjectDescription 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();

typedef Phonon::EffectDescription

EffectDescription gives a description of an audio effect. It is a typedef of the ObjectDescription class. Please see its class description for details.

EffectDescription is used to create audio Effects, which can be inserted into a media graph, altering an audio stream.

See also Phonon::ObjectDescription, Capabilities Example, and Media Player.

enum Phonon::ObjectDescriptionType

This enum defines the type of information that is contained in a ObjectDescription object.

ConstantValueDescription
Phonon::AudioOutputDeviceType0An 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::EffectType1An audio effect (EffectDescription).

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 7
Page suivante

Le Qt Developer Network au hasard

Logo

Installation de PySide : binaires et compilation

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.6
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web