Phonon.MediaController

KDE 4.7 PyKDE API Reference

- KDE's Python API

# MediaController Class Reference

`from PyKDE4.phonon import *`

Inherits: QObject
Namespace: Phonon

## Detailed Description

\class MediaController mediacontroller.h phonon/MediaController Controls optional features of a media file/device like title, chapter, angle.

Author:
  Matthias Kretz <kretz@kde.org>

## Enumerations
Feature | { Angles, Chapters, Navigations, Titles }
NavigationMenu | { RootMenu, TitleMenu, AudioMenu, SubtitleMenu, ChapterMenu, AngleMenu }
## Signals
| angleChanged (int angleNumber)
| availableAnglesChanged (int availableAngles)
| availableAudioChannelsChanged ()
| availableChaptersChanged (int availableChapters)
| availableMenusChanged ([Phonon.MediaController.NavigationMenu] menus)
| availableSubtitlesChanged ()
| availableTitlesChanged (int availableTitles)
| chapterChanged (int chapterNumber)
| titleChanged (int titleNumber)
## Methods
| __init__ (self, Phonon.MediaObject parent)
bool | autoplayTitles (self)
int | availableAngles (self)
[Phonon::ObjectDescription] | availableAudioChannels (self)
int | availableChapters (self)
[Phonon.MediaController.NavigationMenu] | availableMenus (self)
[Phonon::ObjectDescription] | availableSubtitles (self)
int | availableTitles (self)
int | currentAngle (self)
Phonon::ObjectDescription | currentAudioChannel (self)
int | currentChapter (self)
Phonon::ObjectDescription | currentSubtitle (self)
int | currentTitle (self)
| nextTitle (self)
| previousTitle (self)
| setAutoplayTitles (self, bool a0)
| setCurrentAngle (self, int angleNumber)
| setCurrentAudioChannel (self, Phonon::ObjectDescription stream)
| setCurrentChapter (self, int chapterNumber)
| setCurrentMenu (self, Phonon.MediaController.NavigationMenu menu)
| setCurrentSubtitle (self, Phonon::ObjectDescription stream)
| setCurrentTitle (self, int titleNumber)
Phonon.MediaController.Features | supportedFeatures (self)
## Static Methods
QString | navigationMenuToString (Phonon.MediaController.NavigationMenu menu)

## Signal Documentation

angleChanged | ( | int | angleNumber
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("angleChanged(int)"), target_slot)`

availableAnglesChanged | ( | int | availableAngles
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("availableAnglesChanged(int)"), target_slot)`

availableAudioChannelsChanged | ( |  | ) |

Signal syntax:
  `QObject.connect(source, SIGNAL("availableAudioChannelsChanged()"), target_slot)`

availableChaptersChanged | ( | int | availableChapters
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("availableChaptersChanged(int)"), target_slot)`

availableMenusChanged | ( | [Phonon.MediaController.NavigationMenu] | menus
| ) |  |  |

The available menus changed, this for example emitted when Phonon switches from a media source without menus to one with menus (e.g. a DVD).

Parameters:

  | menus | is a list of all currently available menus, you should update GUI representations of the available menus with the new set.

See also:
  availableMenus()

See also:
  navigationMenuToString()

Signal syntax:
  `QObject.connect(source, SIGNAL("availableMenusChanged(QList)"), target_slot)`

availableSubtitlesChanged | ( |  | ) |

Signal syntax:
  `QObject.connect(source, SIGNAL("availableSubtitlesChanged()"), target_slot)`

availableTitlesChanged | ( | int | availableTitles
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("availableTitlesChanged(int)"), target_slot)`

chapterChanged | ( | int | chapterNumber
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("chapterChanged(int)"), target_slot)`

titleChanged | ( | int | titleNumber
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("titleChanged(int)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | Phonon.MediaObject | parent
| ) |  |  |

bool autoplayTitles | ( |  | self ) |

int availableAngles | ( |  | self ) |

[Phonon::ObjectDescription] availableAudioChannels | ( |  | self ) |

Returns the audio streams that can be selected by the user. The strings can directly be used in the user interface.

See also:
  selectedAudioChannel

See also:
  setCurrentAudioChannel

int availableChapters | ( |  | self ) |

[Phonon.MediaController.NavigationMenu] availableMenus | ( |  | self ) |

Get the list of currently available menus for the present media source.

The list is always ordered by occurance in the NavgiationMenu enum. Should you wish to use a different order in your application you will have to make appropriate changes.

Returns:
  list of available menus (supported by backend and media source).

See also:
  navigationMenuToString()

[Phonon::ObjectDescription] availableSubtitles | ( |  | self ) |

Returns the subtitle streams that can be selected by the user. The strings can directly be used in the user interface.

See also:
  selectedSubtitle

See also:
  setCurrentSubtitle

int availableTitles | ( |  | self ) |

int currentAngle | ( |  | self ) |

Phonon::ObjectDescription currentAudioChannel | ( |  | self ) |

Returns the selected audio stream.

See also:
  availableAudioChannels

See also:
  setCurrentAudioChannel

int currentChapter | ( |  | self ) |

Phonon::ObjectDescription currentSubtitle | ( |  | self ) |

Returns the selected subtitle stream.

See also:
  availableSubtitles

See also:
  setCurrentSubtitle

int currentTitle | ( |  | self ) |

nextTitle | ( |  | self ) |

Skips to the next title.

If it was playing before the title change it will start playback on the next title if autoplayTitles is enabled.

previousTitle | ( |  | self ) |

Skips to the previous title.

If it was playing before the title change it will start playback on the previous title if autoplayTitles is enabled.

setAutoplayTitles | ( | self, |
|  | bool | a0
| ) |  |  |

setCurrentAngle | ( | self, |
|  | int | angleNumber
| ) |  |  |

setCurrentAudioChannel | ( | self, |
|  | Phonon::ObjectDescription | stream
| ) |  |  |

Selects an audio stream from the media.

Some media formats allow multiple audio streams to be stored in the same file. Normally only one should be played back.

Parameters:

  | stream | Description of an audio stream

See also:
  availableAudioChannels()

See also:
  currentAudioChannel()

setCurrentChapter | ( | self, |
|  | int | chapterNumber
| ) |  |  |

setCurrentMenu | ( | self, |
|  | Phonon.MediaController.NavigationMenu | menu
| ) |  |  |

Switches to a menu (e.g. on a DVD).

See also:
  availableMenus()

setCurrentSubtitle | ( | self, |
|  | Phonon::ObjectDescription | stream
| ) |  |  |

Selects a subtitle stream from the media.

Some media formats allow multiple subtitle streams to be stored in the same file. Normally only one should be displayed.

Parameters:

  | stream | description of a subtitle stream

See also:
  availableSubtitles()

See also:
  currentSubtitle()

setCurrentTitle | ( | self, |
|  | int | titleNumber
| ) |  |  |

Skips to the given title titleNumber.

If it was playing before the title change it will start playback on the new title if autoplayTitles is enabled.

Phonon.MediaController.Features supportedFeatures | ( |  | self ) |

## Static Method Documentation

QString navigationMenuToString | ( | Phonon.MediaController.NavigationMenu | menu
| ) |  |  |

Translates a NavigationMenu enum to a string you can use in your GUI. Please note that keyboard shortucts will not be present in the returned String, therefore it is probably not a good idea to use this function if you are providing keyboard shortcuts for every other clickable.

Please note that RootMenu has the string representation "Main Menu" as root is a rather technical term when talking about menus.

Example:

     QString s = Phonon.MediaController.navigationMenuToString(MenuMain);
     // s now contains "Main Menu"

Returns:
  the QString representation of the menu

## Enumeration Documentation

Feature

Enumerator:

  Angles = 1 |
  Chapters = 2 |
  Navigations = 3 |
  Titles = 4 |

NavigationMenu

Enumerator:

  RootMenu |
  TitleMenu |
  AudioMenu |
  SubtitleMenu |
  ChapterMenu |
  AngleMenu |