Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QMediaContentContext class allows multiple related player objects to be grouped together. More...
#include <QMediaContentContext>
Inherits QObject.
The QMediaContentContext class allows multiple related player objects to be grouped together.
The QMediaContentContext is useful when multiple player objects are required to always work with the same media content object. The class allows related player objects to be group together and updated when the shared media content object changes.
By convention player objects are defined by a setMediaContent() slot in the class declaration. The following declaration outlines a simple player object class.
class PlayerObject : public QObject { Q_OBJECT public: PlayerObject( QObject* parent = 0 ); public slots: void setMediaContent( QMediaContent* content ); };
After creating a context add related player objects to the context. When setMediaContent() is called the context will also call setMediaContent() for all player objects added to the context.
PlayerObject *a = new PlayerObject( this ); PlayerObject *b = new PlayerObject( this ); QMediaContentContext *context = new QMediaContentContext( this ); context->addObject( a ); context->addObject( b );
This way all player objects added to the context will always be working with the same media content object.
QMediaContentContext is a player object.
See also QMediaContent.
Constructs an empty media content context.
The parent argument is passed to the QObject constructor.
Destroys the context.
Adds object to the context. The object should be a player object.
Returns the current media content object for the context.
The media content object has changed to content within the context.
See also setMediaContent().
Removes object from the context.
Sets content as the media content object for the context as well as all player objects added to the context.
See also contentChanged().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |