Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Phonon::MediaController Class Reference

Controls optional features of a media file/device like title, chapter, angle. More...

#include <phonon/MediaController>

Inheritance diagram for 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< NavigationMenuavailableMenus () 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< SubtitleDescriptionavailableSubtitles () 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
 

Detailed Description

Controls optional features of a media file/device like title, chapter, angle.

Author
Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

Member Enumeration Documentation

Enumerator
Angles 

In the VOB (DVD) format, it is possible to give several video streams of the same scene, each of which displays the scene from a different angle. The DVD viewer can then change between these angles.

Chapters 

In the VOB format, chapters are points in a single video stream that can be played and seeked to separately.

Navigations 

In the VOB format, navigations are menus to quickly navigate to content.

Titles 

On a CD, a title is a separate sound track. On DVD, a title is a separate VOB file (i.e. usually a different video entity).

Subtitles 

Subtitles for videos.

AudioChannels 

Audio channel/track setting for sources with multiple tracks. This can be a DVD or a regular file based container such as MKV or MP4.

Enumerator
TitleMenu 

< Root/main menu.

AudioMenu 

< Title Menu to access different titles on the media source. The title menu is usually where one would select the episode of a TV series DVD. It can be equal to the main menu but does not need to be.

SubtitleMenu 

< Audio menu for language (and somtimes also subtitle) settings etc.

ChapterMenu 

< Subtitle menu. Usually this represents the same menu as AudioMenu or is not present at all (in which case subtitle settings are propably also in the AudioMenu).

AngleMenu 

< Chapter menu for chapter selection. < Angle menu. Rarely supported on any media source.

Member Function Documentation

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.

See Also
selectedAudioChannel
setCurrentAudioChannel
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.

Returns
list of available menus (supported by backend and media source).
See Also
navigationMenuToString()
void Phonon::MediaController::availableMenusChanged ( QList< NavigationMenu menus)
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).

Parameters
menusis a list of all currently available menus, you should update GUI representations of the available menus with the new set.
See Also
availableMenus()
navigationMenuToString()
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.

See Also
selectedSubtitle
setCurrentSubtitle
AudioChannelDescription Phonon::MediaController::currentAudioChannel ( ) const

Returns the selected audio stream.

See Also
availableAudioChannels
setCurrentAudioChannel
SubtitleDescription Phonon::MediaController::currentSubtitle ( ) const

Returns the selected subtitle stream.

See Also
availableSubtitles
setCurrentSubtitle
QString Phonon::MediaController::navigationMenuToString ( NavigationMenu  menu)
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:

// s now contains "Main Menu"
Returns
the QString representation of the menu
void Phonon::MediaController::nextTitle ( )
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.

void Phonon::MediaController::previousTitle ( )
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.

Parameters
streamDescription of an audio stream
See Also
availableAudioChannels()
currentAudioChannel()
void Phonon::MediaController::setCurrentMenu ( NavigationMenu  menu)

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

See Also
availableMenus()
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.

Parameters
streamdescription of a subtitle stream
See Also
availableSubtitles()
currentSubtitle()
void Phonon::MediaController::setCurrentSubtitle ( const QUrl &  url)

Selects a subtitle file as subtitle source for the media.

Note
The file will also be added to the model of SubtitleDescriptions, so you do not need special handling in the UI.
See Also
setCurrentSubtitle(const Phonon::SubtitleDescription &stream)
void Phonon::MediaController::setCurrentTitle ( int  titleNumber)
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.

Note
The subtitle autodetection may only be changed in states other than Playing | Buffering | Paused.
See Also
subtitleAutodetect
Since
4.7.0
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.

Note
The subtitle encoding may only be changed in states other than Playing | Buffering | Paused.
Decoding support may vary between backends.
See Also
subtitleEncoding
Since
4.7.0
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.

Note
The subtitle font may only be changed in states other than Playing | Buffering | Paused.
Non-system fonts can not be used. In particular adding fonts manually to the QFontDatabase will not make them available as render fonts.
See Also
subtitleFont
Since
4.7.0
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.

Note
Auto-detection is always activate so long as the backend supports it.
Returns
true if subtitles are autodetected, otherwise false is returned.
See Also
setSubtitleAutodetect
Since
4.7.0
QString Phonon::MediaController::subtitleEncoding ( ) const

Returns the encoding used to render subtitles

See Also
setSubtitleEncoding
Since
4.7.0
QFont Phonon::MediaController::subtitleFont ( ) const

Returns the font used to render subtitles

See Also
setSubtitleFont
QApplication::setFont
Since
4.7.0

The documentation for this class was generated from the following files: