KDE 4.7 PyKDE API Reference

- KDE's Python API

# Path Class Reference

`from PyKDE4.phonon import *`

Namespace: Phonon

## Detailed Description

\class Path path.h phonon/Path Connection object providing convenient effect insertion

    MediaObject *media = new MediaObject;
    AudioOutput *output = new AudioOutput(Phonon.MusicCategory);
    Path path = Phonon.createPath(media, output);
    Q_ASSERT(path.isValid()); // for this simple case the path should always be
    //valid - there are unit tests to ensure it
    // insert an effect
    QList<EffectDescription> effectList = BackendCapabilities.availableAudioEffects();
    if (!effectList.isEmpty()) {
    Effect *effect = path.insertEffect(effectList.first());
    }

Author:
  Matthias Kretz <kretz@kde.org>

Author:
  Thierry Bastian <thierry.bastian@trolltech.com>

## Methods
| __init__ (self)
| __init__ (self, Phonon.Path a0)
bool | disconnect (self)
[Phonon.Effect] | effects (self)
Phonon.Effect | insertEffect (self, Phonon::ObjectDescription desc, Phonon.Effect insertBefore=0)
bool | insertEffect (self, Phonon.Effect newEffect, Phonon.Effect insertBefore=0)
bool | isValid (self)
bool | operator != (self, Phonon.Path p)
bool | operator == (self, Phonon.Path p)
bool | reconnect (self, Phonon.MediaNode source, Phonon.MediaNode sink)
bool | removeEffect (self, Phonon.Effect effect)
Phonon.MediaNode | sink (self)
Phonon.MediaNode | source (self)

## Method Documentation

__init__ | ( |  | self ) |

Constructs a copy of the given path.

This constructor is fast thanks to explicit sharing.

__init__ | ( | self, |
|  | Phonon.Path | a0
| ) |  |  |

Constructs a copy of the given path.

This constructor is fast thanks to explicit sharing.

bool disconnect | ( |  | self ) |

Disconnects the path from the MediaNodes it was connected to. This invalidates the path (isValid returns false then).

[Phonon.Effect] effects | ( |  | self ) |

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.

Returns:
  A list with all current effects.

See also:
  insertEffect

See also:
  removeEffect

Phonon.Effect insertEffect | ( | self, |
|  | Phonon::ObjectDescription | desc,
|  | Phonon.Effect | insertBefore=0
| ) |  |  |

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.

Parameters:

  | newEffect | An Effect object.

Parameters:

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

Returns:
  Returns whether the effect could be inserted at the specified position. If false is returned the effect was not inserted.

See also:
  removeEffect

See also:
  effects

bool insertEffect | ( | self, |
|  | Phonon.Effect | newEffect,
|  | Phonon.Effect | insertBefore=0
| ) |  |  |

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.

Parameters:

  | newEffect | An Effect object.

Parameters:

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

Returns:
  Returns whether the effect could be inserted at the specified position. If false is returned the effect was not inserted.

See also:
  removeEffect

See also:
  effects

bool isValid | ( |  | self ) |

Returns whether the path object connects two MediaNodes or not.

Returns:
  true when the path connects two MediaNodes

Returns:
  false when the path is disconnected

bool operator != | ( | self, |
|  | Phonon.Path | p
| ) |  |  |

Returns true if this Path is not equal to p; otherwise returns false;

bool operator == | ( | self, |
|  | Phonon.Path | p
| ) |  |  |

Returns true if this Path is equal to p; otherwise returns false;

bool reconnect | ( | self, |
|  | Phonon.MediaNode | source,
|  | Phonon.MediaNode | sink
| ) |  |  |

Tries to change the MediaNodes the path is connected to.

If reconnect fails the old connection is kept.

bool removeEffect | ( | self, |
|  | Phonon.Effect | effect
| ) |  |  |

Removes an effect from the path.

If the effect gets deleted while it is still connected the effect will be removed automatically.

Parameters:

  | effect | The effect to be removed.

Returns:
  Returns whether the call was successful. If it returns

false the effect could not be found in the path, meaning it has not been inserted before.

See also:
  insertEffect

See also:
  effects

Phonon.MediaNode sink | ( |  | self ) |

Returns the sink MediaNode used by the path.

Phonon.MediaNode source | ( |  | self ) |

Returns the source MediaNode used by the path.