Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Types | Public Member Functions | List of all members
Phonon::AddonInterface Class Referenceabstract

Interface for Menu, Chapter, Angle and Title/Track control. More...

#include <phonon/AddonInterface>

Public Types

enum  Interface {
  NavigationInterface = 1, ChapterInterface = 2, AngleInterface = 3, TitleInterface = 4,
  SubtitleInterface = 5, AudioChannelInterface = 6
}
 
enum  NavigationCommand { availableMenus, setMenu }
 
enum  ChapterCommand { availableChapters, chapter, setChapter }
 
enum  AngleCommand { availableAngles, angle, setAngle }
 
enum  TitleCommand {
  availableTitles, title, setTitle, autoplayTitles,
  setAutoplayTitles
}
 
enum  SubtitleCommand {
  availableSubtitles, currentSubtitle, setCurrentSubtitle, setCurrentSubtitleFile,
  subtitleAutodetect, setSubtitleAutodetect, subtitleEncoding, setSubtitleEncoding,
  subtitleFont, setSubtitleFont
}
 
enum  AudioChannelCommand { availableAudioChannels, currentAudioChannel, setCurrentAudioChannel }
 

Public Member Functions

virtual bool hasInterface (Interface iface) const =0
 
virtual QVariant interfaceCall (Interface iface, int command, const QList< QVariant > &arguments=QList< QVariant >())=0
 

Detailed Description

Interface for Menu, Chapter, Angle and Title/Track control.

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

Member Enumeration Documentation

Enumerator
availableAngles 
Returns
int representing the amount of available angles on the media source
angle 
Returns
an int representing the current angle
setAngle 

Sets the current angle to the first int in the QList

Enumerator
availableAudioChannels 
Returns
int representing the amount of all available audio channels on the media source
currentAudioChannel 
Returns
int representing the current audio channel
setCurrentAudioChannel 

Sets the current audio channel to the first int in the QList

Enumerator
availableChapters 
Returns
an int representing the amount of available chapters on the media source
chapter 
Returns
an int representing the current chapter
setChapter 

Sets the current chapter to the first int in the QList

Enumerator
NavigationInterface 

Interface for (menu) navigation

ChapterInterface 

Interface for chapter control

AngleInterface 

Interface for angle control

TitleInterface 

Interface for title control

SubtitleInterface 

Interface for subtitle control

AudioChannelInterface 

Interface for audio channel control

Enumerator
availableMenus 
Returns
a QList<MediaController::NavigationMenu> containing all supported navigation menu types
setMenu 

Sets the current menu to the first MediaController::NavigationMenu in a QList

Enumerator
availableSubtitles 
Returns
int representing the amount of available subtitles on the media source
currentSubtitle 
Returns
int representing the current subtitle
setCurrentSubtitle 

Sets the current subtitle to the first int in the QList

setCurrentSubtitleFile 

Sets the current subtitle to the first QUrl

Since
4.7.0
subtitleAutodetect 
Returns
bool representing if subtitles autodetection is enabled
Since
4.7.0
setSubtitleAutodetect 

Sets/Unsets subtitles autodetection

Since
4.7.0
subtitleEncoding 
Returns
a QString representing the current encoding used to render subtitles
Since
4.7.0
subtitleFont 

Sets the current encoding used to render subtitles

Since
4.7.0
Returns
a QFont representing the current font used to render subtitles
Since
4.7.0
setSubtitleFont 

Sets the current font used to render subtitles

Since
4.7.0
Enumerator
availableTitles 
Returns
int representing the amount of available titles on the media source
title 
Returns
int representing the current title
setTitle 

Sets the current tittle to the first int in the QList

autoplayTitles 
Returns
bool whether autoplay of titles is on
setAutoplayTitles 

Sets autoplay to true or false as indicated in the first bool in the QList

Member Function Documentation

virtual bool Phonon::AddonInterface::hasInterface ( Interface  iface) const
pure virtual

Queries whether the backend supports a specific interface.

Parameters
ifaceThe interface to query support information about
Returns
true when the backend supports the interface, false otherwise
virtual QVariant Phonon::AddonInterface::interfaceCall ( Interface  iface,
int  command,
const QList< QVariant > &  arguments = QList< QVariant >() 
)
pure virtual

Calls an interface on the backend.

Parameters
ifaceThe interface to call.
commandThe command the interface shall execute. This can be any value of the Command enumeration associated with the command. The backend casts this appropriately.
argumentsThe arguments for the command. This list can contain a QVariant supported format + additions specific to Phonon. The content entirely depends on the command (e.g. a getter may simply use an empty list).
Returns
QVariant, as with the arguments this can be anything ranging from an empty QVariant to custom types used within Phonon

Setting the chapter of a Media could be done like this:

AddonInterface *iface = d->iface();
iface->interfaceCall(AddonInterface::ChapterInterface,
QList<QVariant>() << QVariant(titleNumber));

Handling such a request in the backend is done as follows:

switch (iface) {
switch (static_cast<AddonInterface::ChapterCommand>(command)) {
case setChapter:
setCurrentChapter(arguments.first().toInt());
return QVariant();
}
}
See Also
Interface
NavigationCommand
ChapterCommand
AngleCommand
TitleCommand
SubtitleCommand
AudioChannelCommand

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