Home · All Classes · All Functions ·

QMediaService Class Reference

The QMediaService class provides a common base class for media service implementations. More...

    #include <QMediaService>

This class is under development and is subject to change.

Inherits QObject.


Public Types

enum MediaEndpoint { AudioDevice }

Public Functions

~QMediaService ()
virtual QString activeEndpoint ( QMediaService::MediaEndpoint endpointType )
virtual QMediaControl * control ( const char * interface ) const = 0
T control () const
virtual QString endpointDescription ( QMediaService::MediaEndpoint endpointType, const QString & endpoint )
bool isEndpointSupported ( QMediaService::MediaEndpoint endpointType )
virtual bool setActiveEndpoint ( QMediaService::MediaEndpoint endpointType, const QString & endpoint )
virtual QStringList supportedEndpoints ( QMediaService::MediaEndpoint endpointType ) const

Signals

void activeEndpointChanged ( QMediaService::MediaEndpoint endpointType, const QString & endpoint )
void supportedEndpointsChanged ()

Protected Functions

QMediaService ( QObject * parent )

Additional Inherited Members


Detailed Description

The QMediaService class provides a common base class for media service implementations.

Media services provide implementations of the functionality promised by media objects, and allow multiple providers to implement a QMediaObject.

To provide the functionality of a QMediaObject media services implement QMediaControl interfaces. Services typically implement one core media control which provides the core feature of a media object, and some number of additional controls which provide either optional features of the media object, or features of a secondary media object or peripheral object.

A pointer to media service's QMediaControl implementation can be obtained by passing the control's interface name to the control() function.

    QMediaPlayerControl *control = qobject_cast<QMediaPlayerControl *>(
            service->control("com.nokia.Qt.QMediaPlayerControl/1.0"));

Media objects can use services loaded dynamically from plug-ins or implemented statically within an applications. Plug-in based services should also implement the QMediaServiceProviderPlugin interface. Static services should implement the QMediaServiceProvider interface.

See also QMediaObject, QMediaControl, QMediaServiceProvider, and QMediaServiceProviderPlugin.


Member Type Documentation

enum QMediaService::MediaEndpoint

Enumerates the possible end points a media service may have.

ConstantValueDescription
QMediaService::AudioDevice0An audio device for either input or output.


Member Function Documentation

QMediaService::QMediaService ( QObject * parent )   [protected]

Construct a media service with the given parent. This class is meant as a base class for Multimedia services so this constructor is protected.

QMediaService::~QMediaService ()

Destroys a media service.

QString QMediaService::activeEndpoint ( QMediaService::MediaEndpoint endpointType )   [virtual]

Returns the active endpoint for endpointType.

See also setActiveEndpoint().

void QMediaService::activeEndpointChanged ( QMediaService::MediaEndpoint endpointType, const QString & endpoint )   [signal]

This signal emitted when the active endpoint of type endpointType has been changed to endpoint.

QMediaControl * QMediaService::control ( const char * interface ) const   [pure virtual]

Returns a pointer to the media control implementing interface.

If the service does not implement the control a null pointer is returned instead.

T QMediaService::control () const

Returns a pointer to the media control of type T implemented by a media service.

If the service does not implment the control a null pointer is returned instead.

QString QMediaService::endpointDescription ( QMediaService::MediaEndpoint endpointType, const QString & endpoint )   [virtual]

Returns the description of the endpoint for the endpointType.

bool QMediaService::isEndpointSupported ( QMediaService::MediaEndpoint endpointType )

Return true if endpointType is available.

bool QMediaService::setActiveEndpoint ( QMediaService::MediaEndpoint endpointType, const QString & endpoint )   [virtual]

Returns true if set of the active endpoint for endpointType to endpoint succeeds.

See also activeEndpoint().

QStringList QMediaService::supportedEndpoints ( QMediaService::MediaEndpoint endpointType ) const   [virtual]

Returns a list of endpoints available for the endpointType.

void QMediaService::supportedEndpointsChanged ()   [signal]

This signal is emitted when there is a change in the availability of devices.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0 (Technology Preview)