Phonon::BackendInterface

Search for usage in LXR

Phonon::BackendInterface Class Referenceabstract

#include <phonon/BackendInterface>

Public Types

enum  Class {
  MediaObjectClass , VolumeFaderEffectClass , AudioOutputClass , AudioDataOutputClass ,
  VisualizationClass , VideoDataOutputClass , EffectClass , VideoWidgetClass ,
  VideoGraphicsObjectClass
}
 

Public Member Functions

virtual ~BackendInterface ()
 
virtual QStringList availableMimeTypes () const =0
 
virtual bool connectNodes (QObject *, QObject *)=0
 
virtual QObjectcreateObject (Class c, QObject *parent, const QList< QVariant > &args=QList< QVariant >())=0
 
virtual bool disconnectNodes (QObject *, QObject *)=0
 
virtual bool endConnectionChange (QSet< QObject * >)=0
 
virtual QList< int > objectDescriptionIndexes (ObjectDescriptionType type) const =0
 
virtual QHash< QByteArray, QVariantobjectDescriptionProperties (ObjectDescriptionType type, int index) const =0
 
virtual bool startConnectionChange (QSet< QObject * >)=0
 

Detailed Description

Main Backend class interface.

This interface defines the main factory of the backend. The createObject function creates all the objects needed by the frontend.

The objectDescriptionIndexes and objectDescriptionProperties functions return information about available devices, effects and codecs.

An implementation could look like this:

QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args)
{
switch (c) {
return new MediaObject(parent);
return new VolumeFaderEffect(parent);
return new AudioOutput(parent);
return new AudioDataOutput(parent);
return new Visualization(parent);
return new VideoDataOutput(parent);
return new Effect(args[0].toInt(), parent);
return new VideoWidget(qobject_cast<QWidget *>(parent));
}
return 0;
}
QSet<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
{
QSet<int> set;
switch(type)
{
case Phonon::AudioOutputDeviceType:
// use AudioDeviceEnumerator to list ALSA and OSS devices
set << 10000 << 10001;
break;
case Phonon::AudioCaptureDeviceType:
set << 20000 << 20001;
break;
case Phonon::VideoOutputDeviceType:
break;
case Phonon::VideoCaptureDeviceType:
set << 30000 << 30001;
break;
case Phonon::VisualizationType:
case Phonon::AudioCodecType:
case Phonon::VideoCodecType:
case Phonon::ContainerFormatType:
break;
case Phonon::EffectType:
set << 0x7F000001;
break;
}
return set;
}
QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescriptionType type, int index) const
{
switch (type) {
case Phonon::AudioOutputDeviceType:
switch (index) {
case 10000:
ret.insert("name", QLatin1String("internal Soundcard"));
break;
case 10001:
ret.insert("name", QLatin1String("USB Headset"));
ret.insert("icon", KIcon("usb-headset"));
ret.insert("available", false);
break;
}
break;
case Phonon::AudioCaptureDeviceType:
switch (index) {
case 20000:
ret.insert("name", QLatin1String("Soundcard"));
ret.insert("description", QLatin1String("first description"));
break;
case 20001:
ret.insert("name", QLatin1String("DV"));
ret.insert("description", QLatin1String("second description"));
break;
}
break;
case Phonon::VideoOutputDeviceType:
break;
case Phonon::VideoCaptureDeviceType:
switch (index) {
case 30000:
ret.insert("name", QLatin1String("USB Webcam"));
ret.insert("description", QLatin1String("first description"));
break;
case 30001:
ret.insert("name", QLatin1String("DV"));
ret.insert("description", QLatin1String("second description"));
break;
}
break;
case Phonon::VisualizationType:
break;
case Phonon::AudioCodecType:
break;
case Phonon::VideoCodecType:
break;
case Phonon::ContainerFormatType:
break;
case Phonon::EffectType:
switch (index) {
case 0x7F000001:
ret.insert("name", QLatin1String("Delay"));
ret.insert("description", QLatin1String("Simple delay effect with time, feedback and level controls."));
break;
}
break;
}
return ret;
}
This class gives you the audio data (for visualizations).
Class for audio output to the soundcard.
Definition audiooutput.h:49
Class
Classes that the createObject function has to handle.
@ EffectClass
Request to return a Effect object.
@ VideoDataOutputClass
Request to return a VideoDataOutput object.
@ AudioDataOutputClass
Request to return a AudioDataOutput object.
@ VideoWidgetClass
Request to return a VideoWidget object.
@ VolumeFaderEffectClass
Request to return a VolumeFaderEffect object.
@ VisualizationClass
Request to return a Visualization object.
@ MediaObjectClass
Request to return a MediaObject object.
@ AudioOutputClass
Request to return a AudioOutput object.
Effects that can be inserted into a Path.
Definition effect.h:64
Interface for media playback of a given URL.
Widget to display video.
Definition videowidget.h:55
Audio effect to gradually fade the audio volume.
iterator insert(const Key &key, const T &value)
Author
Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

Definition at line 166 of file backendinterface.h.

Member Enumeration Documentation

◆ Class

Classes that the createObject function has to handle.

Enumerator
MediaObjectClass 

Request to return a MediaObject object.

VolumeFaderEffectClass 

Request to return a VolumeFaderEffect object.

AudioOutputClass 

Request to return a AudioOutput object.

AudioDataOutputClass 

Request to return a AudioDataOutput object.

VisualizationClass 

Request to return a Visualization object.

VideoDataOutputClass 

Request to return a VideoDataOutput object.

EffectClass 

Request to return a Effect object.

Takes an additional int that specifies the effect Id.

VideoWidgetClass 

Request to return a VideoWidget object.

Definition at line 179 of file backendinterface.h.

Constructor & Destructor Documentation

◆ ~BackendInterface()

virtual Phonon::BackendInterface::~BackendInterface ( )
inlinevirtual

Silence gcc's warning.

Definition at line 174 of file backendinterface.h.

Member Function Documentation

◆ availableMimeTypes()

virtual QStringList Phonon::BackendInterface::availableMimeTypes ( ) const
pure virtual

gets all available mime types

◆ connectNodes()

virtual bool Phonon::BackendInterface::connectNodes ( QObject * ,
QObject *  )
pure virtual

Defines a signal connection between the two given nodes.

◆ createObject()

virtual QObject * Phonon::BackendInterface::createObject ( Class c,
QObject * parent,
const QList< QVariant > & args = QListQVariant >() )
pure virtual

Returns a new instance of the requested class.

Parameters
cThe requested class.
parentThe parent object.
argsAdditional arguments (documented in Class).

◆ disconnectNodes()

virtual bool Phonon::BackendInterface::disconnectNodes ( QObject * ,
QObject *  )
pure virtual

Cuts a signal connection between the two given nodes.

◆ endConnectionChange()

virtual bool Phonon::BackendInterface::endConnectionChange ( QSet< QObject * > )
pure virtual

When this function is called the nodes given in the parameter list may lose signal data when a port is not connected.

◆ objectDescriptionIndexes()

virtual QList< int > Phonon::BackendInterface::objectDescriptionIndexes ( ObjectDescriptionType type) const
pure virtual

Returns the unique identifiers for the devices/effects/codecs of the given type.

Parameters
typesee ObjectDescriptionType

◆ objectDescriptionProperties()

virtual QHash< QByteArray, QVariant > Phonon::BackendInterface::objectDescriptionProperties ( ObjectDescriptionType type,
int index ) const
pure virtual

Given a unique identifier that was returned from objectDescriptionIndexes this function returns a hash mapping property names to values.

The property "name" must always be present. All other properties are optional.

List of possible properties:

  • name: The name of the device/effect/codec/...
  • description: A text explaining what this device/effect/codec/... is/can do
  • icon: An icon name (using the freedesktop naming scheme) or a QIcon for this device/effect/codec/...
  • available: A bool telling whether the device is present or unplugged.
Parameters
typesee ObjectDescriptionType
indexThe unique identifier that is returned from objectDescriptionIndexes

◆ startConnectionChange()

virtual bool Phonon::BackendInterface::startConnectionChange ( QSet< QObject * > )
pure virtual

When this function is called the nodes given in the parameter list should not lose any signal data when connections are changed.


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 Mon Nov 18 2024 12:18:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.