Phonon
Phonon Backend Development
Overview | Application Example | Backend DevelopmentThe backend is the most important part in Phonon to provide functionality. This document will get you started how backends work, how to start development of a new backend and how to understand existing backend code.
Introduction
The first step is to understand how the Phonon frontend calls the backend: In the frontend objects all backend objects are "only" QObjects. But QObject has powerful introspection capabilities that Phonon uses to call methods in the backend. If you're interested look at QMetaObject::invokeMethod. In order to make sure that a backend is fully operational (there are no abstract classes that tell the backend developer what method signatures are wrong or what methods are missing) there are two test programs compiled with kdelibs (if KDE4_BUILD_TESTS is set in cmake) that inspects the backend.In short that requires the backend classes to inherit from QObject and to make all methods that are to be called from the frontend slots or prefixed with Q_INVOKABLE (the latter doesn't work reliable with Qt 4.1.3 at least, so you should simply make those methods slots).
The Backend Classes
The central class that needs to be implemented is the backend factory class, throughout this documentation simply called Backend:
The classes producing media data (sources)
- common methods/signals for media producing classes
- MediaObject
The path class
- Path
KDE 4.0 API Reference