The MediaController class controls optional features of a media file/device. 更多...
| 头: | #include <Phonon/MediaController> |
| Since: | Qt 4.4 |
| 继承: | QObject |
| enum | Feature { Angles, Chapters, Titles } |
| flags | 特征 |
| MediaController (MediaObject * parent ) | |
| ~MediaController () | |
| bool | autoplayTitles () const |
| int | availableAngles () const |
| int | availableChapters () const |
| int | availableTitles () const |
| int | currentAngle () const |
| int | currentChapter () const |
| int | currentTitle () const |
| 特征 | supportedFeatures () const |
| void | nextTitle () |
| void | previousTitle () |
| void | setAutoplayTitles (bool enable ) |
| void | setCurrentAngle (int angleNumber ) |
| void | setCurrentChapter (int chapterNumber ) |
| void | setCurrentTitle (int titleNumber ) |
| void | angleChanged (int angleNumber ) |
| void | availableAnglesChanged (int availableAngles ) |
| void | availableChaptersChanged (int availableChapters ) |
| void | availableTitlesChanged (int availableTitles ) |
| void | chapterChanged (int chapterNumber ) |
| void | titleChanged (int titleNumber ) |
The MediaController class controls optional features of a media file/device.
Some media sources have content that the MediaObject does not provide control over, for instance, chapters in a DVD file. The functionality the media controller offers is dependent on the type of media source that is played back. Commonly, the media controller allows you to:
The Feature enum explains these terms in more detail, and their context in playback of CD and DVD.
The media controller keeps a MediaObject , of which media source is played back. You can still call the media object's functions, e.g., stop(); this is all handled correctly by the media controller. You have the option of letting the media controller play all titles of a source in sequence by setting the autoplay titles 选项。
To start a playback using a media object, you call play() on the media object. To play a specific title, use setCurrentTitle () and then call play().
警告: The Phonon::MediaController class is not yet supported by Qt backends.
另请参阅 Phonon 模块 .
The values of this enum are interpreted differently depending on the type of media source, e.g., DVD or CD. We give examples for these sources.
| 常量 | 值 | 描述 |
|---|---|---|
Phonon::MediaController::Angles
|
1
|
In the VOB (DVD) format, it is possible to 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. |
Phonon::MediaController::Chapters
|
2
|
In the VOB format, chapters are points in a single video stream that can be played and seeked to separately. |
Phonon::MediaController::Titles
|
4
|
On a CD, a title is a separate sound track. On DVD, a title is a separate VOB file. |
The Features type is a typedef for QFlags <Feature>. It stores an OR combination of Feature values.
构造新的 MediaController with the media object ( parent ) to be used by the media controller.
另请参阅 MediaObject and Feature .
[signal]
void
MediaController::
angleChanged
(
int
angleNumber
)
This signal is emitted whenever the current angle changes. The new angle number is given by angleNumber .
另请参阅 Feature .
Returns true if titles will automatically be played when the media is played; otherwise returns false.
The media controller will play the titles of the media source in sequence when the media object's play() function is called. If the autoplay option is disabled, the media object will play the MediaController::currentTitle(){current title} and then finish the playback.
另请参阅 setAutoplayTitles () 和 currentTitle ().
Returns the available angles that is available for the current media source.
另请参阅 Feature .
[signal]
void
MediaController::
availableAnglesChanged
(
int
availableAngles
)
This signal is emitted whenever the number of available angles changes. The new number of available angles is given by availableAngles .
另请参阅 Feature .
Returns the number of chapters the current media source contains.
另请参阅 Feature .
[signal]
void
MediaController::
availableChaptersChanged
(
int
availableChapters
)
This signal is emitted whenever the number of available chapters changes. The new number of available chapters is given by availableChapters .
另请参阅 Feature .
Returns the number of titles that the current media source contains.
另请参阅 Feature .
[signal]
void
MediaController::
availableTitlesChanged
(
int
availableTitles
)
This signal is emitted whenever the number of available titles changes. The new number of available titles is given by availableTitles .
另请参阅 Feature .
[signal]
void
MediaController::
chapterChanged
(
int
chapterNumber
)
This signal is emitted whenever the current chapter changes. The new chapter number is given by chapterNumber .
另请参阅 Feature .
Returns the angle that is currently used.
另请参阅 setCurrentAngle () 和 Feature .
Returns the chapter that is currently being played back.
另请参阅 setCurrentChapter () 和 Feature .
Returns the title that is currently played back.
The current title is 0 (the first) by default.
另请参阅 setCurrentTitle () 和 Feature .
[slot]
void
MediaController::
nextTitle
()
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.
另请参阅 Feature .
[slot]
void
MediaController::
previousTitle
()
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.
另请参阅 Feature .
[slot]
void
MediaController::
setAutoplayTitles
(
bool
enable
)
Sets the titles to play automatically when the media is played if enable is true; otherwise disables this option.
The media controller will play the titles of the media source in sequence when the media object's play() function is called. If the autoplay option is disabled, the media object will play the MediaController::currentTitle(){current title} and then finish the playback.
另请参阅 autoplayTitles () 和 currentTitle ().
[slot]
void
MediaController::
setCurrentAngle
(
int
angleNumber
)
Sets the current angle to the given angleNumber if the media file or device supports navigation by angle number.
另请参阅 currentAngle () 和 Feature .
[slot]
void
MediaController::
setCurrentChapter
(
int
chapterNumber
)
Sets the current chapter to the given chapterNumber if the media file or device supports navigation by chapter number.
另请参阅 currentChapter () 和 Feature .
[slot]
void
MediaController::
setCurrentTitle
(
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.
另请参阅 currentTitle () 和 Feature .
[signal]
void
MediaController::
titleChanged
(
int
titleNumber
)
This signal is emitted whenever the current title changes. The new title number is given by titleNumber .
另请参阅 Feature .