Controls optional features of a media file/device like title, chapter, angle. More...
#include <phonon/MediaController>
Public Types | |
enum | Feature { Angles = 1, Chapters = 2, Navigations = 3, Titles = 4, Subtitles = 5, AudioChannels = 6 } |
enum | NavigationMenu { RootMenu, TitleMenu, AudioMenu, SubtitleMenu, ChapterMenu, AngleMenu } |
Public Slots | |
void | setCurrentAngle (int angleNumber) |
void | setCurrentChapter (int chapterNumber) |
void | setCurrentTitle (int titleNumber) |
void | setAutoplayTitles (bool) |
void | nextTitle () |
void | previousTitle () |
Signals | |
void | availableAnglesChanged (int availableAngles) |
void | availableAudioChannelsChanged () |
void | availableChaptersChanged (int availableChapters) |
void | availableMenusChanged (QList< NavigationMenu > menus) |
void | availableSubtitlesChanged () |
void | availableTitlesChanged (int availableTitles) |
void | angleChanged (int angleNumber) |
void | chapterChanged (int chapterNumber) |
void | titleChanged (int titleNumber) |
Public Member Functions | |
MediaController (MediaObject *parent) | |
Features | supportedFeatures () const |
int | availableAngles () const |
int | currentAngle () const |
int | availableChapters () const |
int | currentChapter () const |
QList< NavigationMenu > | availableMenus () const |
int | availableTitles () const |
int | currentTitle () const |
bool | autoplayTitles () const |
AudioChannelDescription | currentAudioChannel () const |
SubtitleDescription | currentSubtitle () const |
bool | subtitleAutodetect () const |
QString | subtitleEncoding () const |
QFont | subtitleFont () const |
QList < Phonon::AudioChannelDescription > | availableAudioChannels () const |
QList< SubtitleDescription > | availableSubtitles () const |
void | setCurrentAudioChannel (const Phonon::AudioChannelDescription &stream) |
void | setCurrentMenu (NavigationMenu menu) |
void | setCurrentSubtitle (const Phonon::SubtitleDescription &stream) |
void | setCurrentSubtitle (const QUrl &url) |
Selects a subtitle file as subtitle source for the media. More... | |
void | setSubtitleAutodetect (bool enable) |
void | setSubtitleEncoding (const QString &encoding) |
void | setSubtitleFont (const QFont &font) |
Static Public Member Functions | |
static QString | navigationMenuToString (NavigationMenu menu) |
Protected Attributes | |
MediaControllerPrivate *const | d |
Controls optional features of a media file/device like title, chapter, angle.
QList< AudioChannelDescription > Phonon::MediaController::availableAudioChannels | ( | ) | const |
Returns the audio streams that can be selected by the user. The strings can directly be used in the user interface.
QList< MediaController::NavigationMenu > Phonon::MediaController::availableMenus | ( | ) | const |
Get the list of currently available menus for the present media source.
The list is always ordered by occurrence in the NavgiationMenu enum. Should you wish to use a different order in your application you will have to make appropriate changes.
|
signal |
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).
menus | is a list of all currently available menus, you should update GUI representations of the available menus with the new set. |
QList< SubtitleDescription > Phonon::MediaController::availableSubtitles | ( | ) | const |
Returns the subtitle streams that can be selected by the user. The strings can directly be used in the user interface.
AudioChannelDescription Phonon::MediaController::currentAudioChannel | ( | ) | const |
Returns the selected audio stream.
SubtitleDescription Phonon::MediaController::currentSubtitle | ( | ) | const |
Returns the selected subtitle stream.
|
static |
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:
|
slot |
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.
|
slot |
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.
void Phonon::MediaController::setCurrentAudioChannel | ( | const Phonon::AudioChannelDescription & | 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.
stream | Description of an audio stream |
void Phonon::MediaController::setCurrentMenu | ( | NavigationMenu | menu) |
Switches to a menu (e.g. on a DVD).
void Phonon::MediaController::setCurrentSubtitle | ( | const Phonon::SubtitleDescription & | 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.
stream | description of a subtitle stream |
void Phonon::MediaController::setCurrentSubtitle | ( | const QUrl & | url) |
Selects a subtitle file as subtitle source for the media.
|
slot |
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.
void Phonon::MediaController::setSubtitleAutodetect | ( | bool | enable) |
Sets/Unsets subtitles autodetection.
Detection is attempted when moving the MediaObject into Playing state. In order to enable/disable autodetection it must be set before play() is called. Whether a MediaSource is set on the MediaObject does not matter, and once detection is set it will remain set that way for this exact combination of MediaController and MediaObject.
void Phonon::MediaController::setSubtitleEncoding | ( | const QString & | encoding) |
Selects the current encoding used to render subtitles.
The encoding name must respect the Link text IANA character-sets encoding file If no encoding is explicitly set, it defaults to UTF-8.
void Phonon::MediaController::setSubtitleFont | ( | const QFont & | font) |
Selects the current font used to render subtitles.
If no font is explicitly set, the system default font is used.
bool Phonon::MediaController::subtitleAutodetect | ( | ) | const |
Subtitle auto-detection transparently tries to find a subtitle file for the current MediaSource and will automatically select a possible match. Detected subtitles are added to the regular subtitle descriptions, allowing the user to deactivate it manually or switch to another detected file.
Matching method depends on the backend in use and may either be driven by a backend or even subsystem implementation. Consequently different backends may not give the same results. At any rate all algorithms are supposed to give as accurate as possible matches. Should you require reproducible matching across backends you should deactivate auto-detection entirely and instead do the lookup yourself and set the desired file using setCurrentSubtitle(QUrl); the file will still be added to the subtitledescriptions model.
true
if subtitles are autodetected, otherwise false
is returned.QString Phonon::MediaController::subtitleEncoding | ( | ) | const |
QFont Phonon::MediaController::subtitleFont | ( | ) | const |