Made QRadioData bind to QRadioTuner to avoid using multiple services

QRadioData has been updated to be a QMediaBindableInterface, and it
will bind to a QRadioTuner instance, i.e. a QMediaObject that provides
a service which implements the QRadioDataControl.
This change is reflected in the declarative implementations of radio
tuner and data. There is a new `radioData` property in the Radio element
which will give access to the declarative RadioData element for the
tuner.
If a RadioData element is created in QML, it will have an anonymous
tuner which communicates with the underlying media service (which is
pretty much the same how the QRadioTuner and QRadioData classes work
previously).
Updated radio tuner and data test cases to use availability control
and extended the mock media service to allow providing a number of
controls rather than just one (needed for testing availability of
all classes extending from or using QMediaObject).

Change-Id: Id41dde66eee529decd828fd2dcdfe4a54c0e81f4
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Jonas Rabbe
2012-03-08 11:05:30 +10:00
committed by Qt by Nokia
parent a15b9d3ce8
commit 942ff7a3c6
12 changed files with 319 additions and 118 deletions

View File

@@ -87,7 +87,9 @@ QT_BEGIN_NAMESPACE
You can also use the Radio element to get information about tuning, for instance the
frequency steps supported for tuning.
The corresponding \l RadioData element gives RDS information about the current radio station.
The corresponding \l RadioData element gives RDS information about the
current radio station. The best way to access the RadioData element for
the current Radio is to use the \c radioData property.
\sa {Radio Overview}
@@ -95,10 +97,10 @@ QT_BEGIN_NAMESPACE
QDeclarativeRadio::QDeclarativeRadio(QObject *parent) :
QObject(parent),
m_radioTuner(0)
QObject(parent)
{
m_radioTuner = new QRadioTuner(this);
m_radioData = new QDeclarativeRadioData(m_radioTuner, this);
connect(m_radioTuner, SIGNAL(stateChanged(QRadioTuner::State)), this, SLOT(_q_stateChanged(QRadioTuner::State)));
connect(m_radioTuner, SIGNAL(bandChanged(QRadioTuner::Band)), this, SLOT(_q_bandChanged(QRadioTuner::Band)));