QMediaControl Class
The QMediaControl class provides a base interface for media service controls. More...
Public Functions
| virtual | ~QMediaControl() |
- 30 public functions inherited from QObject
Protected Functions
| QMediaControl(QObject *parent = nullptr) |
- 9 protected functions inherited from QObject
Related Non-Members
| typedef | QObjectList |
| QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
| T | qobject_cast(QObject *object) |
| T | qobject_cast(const QObject *object) |
Macros
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
| Q_CLASSINFO(Name, Value) | |
| Q_DISABLE_COPY(Class) | |
| Q_DISABLE_COPY_MOVE(Class) | |
| Q_DISABLE_MOVE(Class) | |
| Q_EMIT | |
| Q_ENUM(...) | |
| Q_ENUM_NS(...) | |
| Q_FLAG(...) | |
| Q_FLAG_NS(...) | |
| Q_GADGET | |
| Q_INTERFACES(...) | |
| Q_INVOKABLE | |
| Q_MEDIA_DECLARE_CONTROL(Class, IId) | |
| Q_NAMESPACE | |
| Q_OBJECT | |
| Q_PROPERTY(...) | |
| Q_REVISION | |
| Q_SET_OBJECT_NAME(Object) | |
| Q_SIGNAL | |
| Q_SIGNALS | |
| Q_SLOT | |
| Q_SLOTS |
Additional Inherited Members
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 2 signals inherited from QObject
- 9 static public members inherited from QObject
Detailed Description
Media controls provide an interface to individual features provided by a media service. Most services implement a principal control which exposes the core functionality of the service and a number of optional controls which expose any additional functionality.
A pointer to a control implemented by a media service can be obtained using the QMediaService::requestControl() member of QMediaService. If the service doesn't implement a control it will instead return a null pointer.
QMediaPlayerControl *control = qobject_cast<QMediaPlayerControl *>( mediaService->requestControl("org.qt-project.qt.mediaplayercontrol/5.0"));
Alternatively if the IId of the control has been declared using Q_MEDIA_DECLARE_CONTROL the template version of QMediaService::requestControl() can be used to request the service without explicitly passing the IId or using qobject_cast().
QMediaPlayerControl *control = mediaService->requestControl<QMediaPlayerControl *>();
Most application code will not interface directly with a media service's controls, instead the QMediaObject which owns the service acts as an intermediary between one or more controls and the application.
See also QMediaService and QMediaObject.
Member Function Documentation
[protected] QMediaControl::QMediaControl(QObject *parent = nullptr)
Constructs a media control with the given parent.
[virtual] QMediaControl::~QMediaControl()
Destroys a media control.
Macro Documentation
QMediaControl::Q_MEDIA_DECLARE_CONTROL(Class, IId)
The Q_MEDIA_DECLARE_CONTROL macro declares an IId for a Class that inherits from QMediaControl.
Declaring an IId for a QMediaControl allows an instance of that control to be requested from QMediaService::requestControl() without explicitly passing the IId.
QMediaPlayerControl *control = mediaService->requestControl<QMediaPlayerControl *>();
See also QMediaService::requestControl().