Update background audio element to use new service name

Change-Id: I8f0480e4fb40b034f75dcd900f2d440fd0e7610d
Reviewed-on: http://codereview.qt-project.org/4493
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: derick hawcroft <derick.hawcroft@nokia.com>
This commit is contained in:
Ling Hu
2011-09-09 11:25:53 +10:00
committed by Qt by Nokia
parent ee0ea8c442
commit 989aefc5f1
3 changed files with 6 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ void QDeclarativeBackgroundAudio::classBegin()
void QDeclarativeBackgroundAudio::componentComplete()
{
setObject(this, QMediaServiceProviderHint(QMediaServiceProviderHint::BackgroundPlayback));
setObject(this, Q_MEDIASERVICE_BACKGROUNDMEDIAPLAYER);
if (m_mediaService) {
m_backgroundPlaybackControl =
static_cast<QMediaBackgroundPlaybackControl*>(
@@ -61,6 +61,8 @@ void QDeclarativeBackgroundAudio::componentComplete()
} else {
qWarning("can not get QMediaBackgroundPlaybackControl!");
}
} else {
qWarning("Unable to get any background mediaplayer!");
}
QDeclarativeMediaBase::componentComplete();
}

View File

@@ -260,12 +260,12 @@ void QDeclarativeMediaBase::shutdown()
}
void QDeclarativeMediaBase::setObject(QObject *object, const QMediaServiceProviderHint& hint)
void QDeclarativeMediaBase::setObject(QObject *object, const QByteArray &type)
{
m_qmlObject = object;
if ((m_mediaProvider = QMediaServiceProvider::defaultServiceProvider()) != 0) {
m_mediaService = m_mediaProvider->requestService(Q_MEDIASERVICE_MEDIAPLAYER, hint);
m_mediaService = m_mediaProvider->requestService(type);
if (m_mediaService != 0) {
m_playerControl = qobject_cast<QMediaPlayerControl *>(
m_mediaService->requestControl(QMediaPlayerControl_iid));

View File

@@ -123,7 +123,7 @@ public:
protected:
void shutdown();
void setObject(QObject *object, const QMediaServiceProviderHint& hint = QMediaServiceProviderHint());
void setObject(QObject *object, const QByteArray &type = Q_MEDIASERVICE_MEDIAPLAYER);
virtual void sourceChanged() = 0;
virtual void autoLoadChanged() = 0;