diff options
author | Jonas Rabbe <jonas.rabbe@nokia.com> | 2012-03-08 11:05:30 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-12 08:21:07 +0100 |
commit | 942ff7a3c6d25dc3a79d28a79676b0995d95874b (patch) | |
tree | b738fe9761a829e216aeeebdabb3a8febcd3e415 /src/imports/multimedia/qdeclarativeradio.cpp | |
parent | a15b9d3ce88037c973f868fdf6959eea4e157f68 (diff) |
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>
Diffstat (limited to 'src/imports/multimedia/qdeclarativeradio.cpp')
-rw-r--r-- | src/imports/multimedia/qdeclarativeradio.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/imports/multimedia/qdeclarativeradio.cpp b/src/imports/multimedia/qdeclarativeradio.cpp index 1c7ea4cae..ff4bbb3fb 100644 --- a/src/imports/multimedia/qdeclarativeradio.cpp +++ b/src/imports/multimedia/qdeclarativeradio.cpp @@ -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))); |