QtMobility Reference Documentation

QMediaControl Class Reference

The QMediaControl class provides a base interface for media service controls. More...

 #include <QMediaControl>

Inherits: QObject.

Inherited by: QAudioEncoderControl, QAudioEndpointSelector, QCameraCaptureBufferFormatControl, QCameraCaptureDestinationControl, QCameraControl, QCameraExposureControl, QCameraFlashControl, QCameraFocusControl, QCameraImageCaptureControl, QCameraImageProcessingControl, QCameraLocksControl, QImageEncoderControl, QMediaContainerControl, QMediaNetworkAccessControl, QMediaPlayerControl, QMediaPlaylistControl, QMediaPlaylistSourceControl, QMediaRecorderControl, QMediaStreamsControl, QMetaDataReaderControl, QMetaDataWriterControl, QRadioTunerControl, QVideoDeviceControl, QVideoEncoderControl, QVideoRendererControl, QVideoWidgetControl, and QVideoWindowControl.

This class was introduced in Qt Mobility 1.0.

Public Functions

~QMediaControl ()
  • 29 public functions inherited from QObject

Protected Functions

QMediaControl ( QObject * parent = 0 )
  • 7 protected functions inherited from QObject

Macros

Q_MEDIA_DECLARE_CONTROL ( Class, IId )

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 1 public variable inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QMediaControl class provides a base interface for media service controls.

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 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("com.nokia.Qt.QMediaPlayerControl/1.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.

 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

QMediaControl::QMediaControl ( QObject * parent = 0 ) [protected]

Constructs a media control with the given parent.

This function was introduced in Qt Mobility 1.0.

QMediaControl::~QMediaControl ()

Destroys a media control.

Macro Documentation

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().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.