#include <Phonon/Path>
Connection object providing convenient effect insertion.
Public Member Functions | |
~Path () | |
Destroys this reference to the Path. More... | |
Path () | |
Creates an invalid path. More... | |
Path (const Path &) | |
Constructs a copy of the given path. More... | |
bool | isValid () const |
Returns whether the path object connects two MediaNodes or not. More... | |
Effect * | insertEffect (const EffectDescription &desc, Effect *insertBefore=0) |
Creates and inserts an effect into the path. More... | |
bool | insertEffect (Effect *newEffect, Effect *insertBefore=0) |
Inserts an effect into the path. More... | |
bool | removeEffect (Effect *effect) |
Removes an effect from the path. More... | |
QList< Effect * > | effects () const |
Returns a list of Effect objects that are currently used as effects. More... | |
bool | reconnect (MediaNode *source, MediaNode *sink) |
Tries to change the MediaNodes the path is connected to. More... | |
bool | disconnect () |
Disconnects the path from the MediaNodes it was connected to. More... | |
Path & | operator= (const Path &p) |
Assigns p to this Path and returns a reference to this Path. More... | |
bool | operator== (const Path &p) const |
Returns true if this Path is equal to p ; otherwise returns false ;. More... | |
bool | operator!= (const Path &p) const |
Returns true if this Path is not equal to p ; otherwise returns false ;. More... | |
MediaNode * | source () const |
Returns the source MediaNode used by the path. More... | |
MediaNode * | sink () const |
Returns the sink MediaNode used by the path. More... | |
Protected Attributes | |
QExplicitlySharedDataPointer< PathPrivate > | d |
Friends | |
class | FactoryPrivate |
class | PathPrivate |
Related Functions | |
(Note that these are not member functions.) | |
PHONON_EXPORT Path | createPath (MediaNode *source, MediaNode *sink) |
~Path | ( | ) |
Destroys this reference to the Path.
If the path was valid the connection is not broken as both the source and the sink MediaNodes still keep a reference to the Path.
Path | ( | ) |
Creates an invalid path.
You can still make it a valid path by calling reconnect. To create a path you should use createPath, though.
Constructs a copy of the given path.
This constructor is fast thanks to explicit sharing.
bool isValid | ( | ) | const |
Returns whether the path object connects two MediaNodes or not.
true
when the path connects two MediaNodes false
when the path is disconnected Effect* insertEffect | ( | const EffectDescription & | desc, |
Effect * | insertBefore = 0 |
||
) |
Creates and inserts an effect into the path.
You may insert effects of the same class as often as you like, but if you insert the same object, the call will fail.
desc | The EffectDescription object for the effect to be inserted. |
insertBefore | If you already inserted an effect you can tell with this parameter in which order the data gets processed. If this is 0 the effect is appended at the end of the processing list. If the effect has not been inserted before the method will do nothing and return false . |
0
is returned the effect was not inserted.Inserts an effect into the path.
You may insert effects of the same class as often as you like, but if you insert the same object, the call will fail.
newEffect | An Effect object. |
insertBefore | If you already inserted an effect you can tell with this parameter in which order the data gets processed. If this is 0 the effect is appended at the end of the processing list. If the effect has not been inserted before the method will do nothing and return false . |
false
is returned the effect was not inserted.bool removeEffect | ( | Effect * | effect | ) |
Removes an effect from the path.
If the effect gets deleted while it is still connected the effect will be removed automatically.
effect | The effect to be removed. |
false
the effect could not be found in the path, meaning it has not been inserted before.Returns a list of Effect objects that are currently used as effects.
The order in the list determines the order the signal is sent through the effects.
Tries to change the MediaNodes the path is connected to.
If reconnect fails the old connection is kept.
bool disconnect | ( | ) |
Disconnects the path from the MediaNodes it was connected to.
This invalidates the path (isValid returns false
then).
bool operator== | ( | const Path & | p | ) | const |
Returns true
if this Path is equal to p
; otherwise returns false
;.
bool operator!= | ( | const Path & | p | ) | const |
Returns true
if this Path is not equal to p
; otherwise returns false
;.
|
related |
Creates a new Path connecting two MediaNodes.
The implementation will automatically select the right format and media type. E.g. connecting a MediaObject and AudioOutput will create a Path object connecting the audio. This might be represented as PCM or perhaps even AC3 depending on the AudioOutput object.
|
protected |