Phonon::AddonInterface

Search for usage in LXR

Phonon::AddonInterface Class Referenceabstract

#include <phonon/AddonInterface>

Public Types

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

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

Definition at line 42 of file addoninterface.h.

Member Enumeration Documentation

◆ AngleCommand

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.

Definition at line 70 of file addoninterface.h.

◆ AudioChannelCommand

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.

Definition at line 105 of file addoninterface.h.

◆ ChapterCommand

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.

Definition at line 63 of file addoninterface.h.

◆ Interface

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.

Definition at line 47 of file addoninterface.h.

◆ NavigationCommand

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.

Definition at line 56 of file addoninterface.h.

◆ SubtitleCommand

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

Definition at line 87 of file addoninterface.h.

◆ TitleCommand

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 title 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.

Definition at line 77 of file addoninterface.h.

Constructor & Destructor Documentation

◆ ~AddonInterface()

virtual Phonon::AddonInterface::~AddonInterface ( )
inlinevirtual

Definition at line 45 of file addoninterface.h.

Member Function Documentation

◆ hasInterface()

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

◆ interfaceCall()

virtual QVariant Phonon::AddonInterface::interfaceCall ( Interface iface,
int command,
const QList< QVariant > & arguments = QListQVariant >() )
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();
QList<QVariant>() << QVariant(titleNumber));
Interface for Menu, Chapter, Angle and Title/Track control.
@ ChapterInterface
Interface for chapter control.
virtual QVariant interfaceCall(Interface iface, int command, const QList< QVariant > &arguments=QList< QVariant >())=0
Calls an interface on the backend.
@ setChapter
Sets the current chapter to the first int in the QList.

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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:46:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.