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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Effect Class

(Phonon::Effect)

The Effect class is used to transform audio streams. More...

 #include <Phonon/Effect>

Inherits: QObject and MediaNode.

This class was introduced in Qt 4.4.

Public Functions

Effect(const EffectDescription & description, QObject * parent = 0)
EffectDescription description() const
QVariant parameterValue(const EffectParameter & parameter) const
QList<EffectParameter> parameters() const
void setParameterValue(const EffectParameter & parameter, const QVariant & value)

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 2 signal inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The Effect class is used to transform audio streams.

An effect is a media node which is inserted into a path between a MediaObject and an audio output node, for instance, an AudioOutput. The Effect transforms the media stream on that path.

Examples may include simple modifiers, such as fading or pitch shifting, and more complex mathematical transformations. You can query the backend for available effects with BackendCapabilities::availableAudioEffects(). Note that the effects available is dependent on the underlying system (DirectDraw, GStreamer, or QuickTime).

In order to use an effect, insert it into the path as follows:

 Path path = Phonon::createPath(...);
 Effect *effect = new Effect(this);
 path.insertEffect(effect);

The effect will immediately begin applying it's transformations on the path. To stop it, remove the Effect from the path.

To create an effect, you use the EffectDescription class, which you get from availableAudioEffects(). We give a code example below.

     QList<Phonon::EffectDescription> effectDescriptions =
             Phonon::BackendCapabilities::availableAudioEffects();
     Phonon::EffectDescription effectDescription = effectDescriptions.at(4);

     Phonon::Path path = Phonon::createPath(mediaObject, audioOutput);

     Phonon::Effect *effect = new Phonon::Effect(effectDescription);
     path.insertEffect(effect);

An effect can have one or more parameters, which let you alter how the effect works, for instance, by specifying the depth of a reverb effect. See the EffectParameter class description for details.

Phonon also provides EffectWidget, which lets the user modify the parameters of an effect an the fly; e.g., with combo boxes.

See also Phonon Module and EffectWidget.

Member Function Documentation

Effect::Effect(const EffectDescription & description, QObject * parent = 0)

Constructs a new effect object with the given description and parent object.

The EffectDescription object determines the type of the effect.

See also Phonon::BackendCapabilities::availableAudioEffects().

EffectDescription Effect::description() const

Returns the description of this effect. This is the same description that was passed to the constructor.

QVariant Effect::parameterValue(const EffectParameter & parameter) const

Returns the value of the given effect parameter. You can fetch the available parameters for an effect with parameters().

See also setParameterValue() and EffectParameter.

QList<EffectParameter> Effect::parameters() const

Returns a list of parameters that this effect provides to control its behavior.

See also EffectParameter and EffectWidget.

void Effect::setParameterValue(const EffectParameter & parameter, const QVariant & value)

Sets the given effect parameter to the specified value.

Parameters for an effect are returned by parameters(). You can check which QVariant::Type(obsolete) an EffectParameter takes with the EffectParameter::type() function.

See also parameterValue() and EffectParameter.

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 5.0-snapshot
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