com.trolltech.qt.phonon
Class Effect

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QObject
                  extended by com.trolltech.qt.phonon.Effect
All Implemented Interfaces:
QtJambiInterface
Direct Known Subclasses:
VolumeFaderEffect

public class Effect
extends QObject

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 its 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.

    List<EffectDescription> effectDescriptions =
            BackendCapabilities.availableAudioEffects();
    EffectDescription effectDescription = effectDescriptions.get(4);

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


    Effect effect = new 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 comboboxes.

See also:
Phonon Module, and EffectWidget.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
Effect(EffectDescription description)
          Constructs a new effect object with the given description and parent object.
Effect(EffectDescription description, QObject parent)
          Constructs a new effect object with the given description and parent object.
 
Method Summary
 EffectDescription description()
          Returns the description of this effect.
 java.util.List inputPaths()
          Returns the paths that inputs multimedia to this media node.
 boolean isValid()
          Returns true if the backend provides an implementation of this class; otherwise returns false.
 java.util.List outputPaths()
          Returns the paths to which this media node outputs media.
 java.util.List parameters()
          Returns a list of parameters that this effect provides to control its behavior.
 java.lang.Object parameterValue(EffectParameter arg__1)
          Returns the value of the given effect parameter.
 void setParameterValue(EffectParameter arg__1, java.lang.Object value)
          Sets the given effect parameter to the specified value.
 
Methods inherited from class com.trolltech.qt.core.QObject
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

Effect

public Effect(EffectDescription description)
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(), and


Effect

public Effect(EffectDescription description,
              QObject parent)
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(), and

Method Detail

description

public final EffectDescription description()
Returns the description of this effect. This is the same description that was passed to the constructor.


inputPaths

public final java.util.List inputPaths()
Returns the paths that inputs multimedia to this media node.

See also:
outputPaths().


isValid

public final boolean isValid()
Returns true if the backend provides an implementation of this class; otherwise returns false.

This does not guarantee that instances of the class works as expected, but that the backend has implemented the functionality for this class. For instance, Qt's GStreamer backend will return true for instances of the AudioOutput class, even if there is a problem with GStreamer and it could not play sound.


outputPaths

public final java.util.List outputPaths()
Returns the paths to which this media node outputs media.

See also:
inputPaths().


parameterValue

public final java.lang.Object parameterValue(EffectParameter arg__1)
Returns the value of the given effect parameter. You can fetch the available parameters for an effect with parameters().

See also:
setParameterValue(), and EffectParameter.


parameters

public final java.util.List parameters()
Returns a list of parameters that this effect provides to control its behavior.

See also:
EffectParameter, and EffectWidget.


setParameterValue

public final void setParameterValue(EffectParameter arg__1,
                                    java.lang.Object value)
Sets the given effect parameter to the specified value.

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

See also:
parameterValue(), and EffectParameter.