Expose availability from the backend to C++ and QML.
The availabilityError property was static based on the service, but it can change at run time, so add the plumbing to allow the backend to report it itself. Also make sure that both QML and C++ expose the availability. The radio tuner and data controls previously had properties (but no signals) for availability - these have been removed. Change-Id: I9240cf93e2a51b14cd38642f9312ae3c75f05361 Reviewed-by: Ling Hu <ling.hu@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
d1b6bf5fac
commit
2a8463711c
@@ -70,8 +70,10 @@ class QDeclarativeRadioData : public QObject
|
||||
Q_PROPERTY(QString radioText READ radioText NOTIFY radioTextChanged)
|
||||
Q_PROPERTY(bool alternativeFrequenciesEnabled READ alternativeFrequenciesEnabled
|
||||
WRITE setAlternativeFrequenciesEnabled NOTIFY alternativeFrequenciesEnabledChanged)
|
||||
Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged)
|
||||
Q_ENUMS(Error)
|
||||
Q_ENUMS(ProgramType)
|
||||
Q_ENUMS(Availability)
|
||||
|
||||
public:
|
||||
|
||||
@@ -130,14 +132,19 @@ public:
|
||||
ReligiousTalk = QRadioData::ReligiousTalk,
|
||||
Personality = QRadioData::Personality,
|
||||
Public = QRadioData::Public,
|
||||
College = QRadioData::College,
|
||||
College = QRadioData::College
|
||||
};
|
||||
|
||||
enum Availability {
|
||||
Available = QtMultimedia::NoError,
|
||||
Busy = QtMultimedia::BusyError,
|
||||
Unavailable = QtMultimedia::ServiceMissingError,
|
||||
ResourceMissing = QtMultimedia::ResourceError
|
||||
};
|
||||
|
||||
QDeclarativeRadioData(QObject *parent = 0);
|
||||
~QDeclarativeRadioData();
|
||||
|
||||
Q_INVOKABLE bool isAvailable() const;
|
||||
|
||||
QString stationId() const;
|
||||
QDeclarativeRadioData::ProgramType programType() const;
|
||||
QString programTypeName() const;
|
||||
@@ -145,6 +152,9 @@ public:
|
||||
QString radioText() const;
|
||||
bool alternativeFrequenciesEnabled() const;
|
||||
|
||||
Q_INVOKABLE bool isAvailable() const {return availability() == Available;}
|
||||
Availability availability() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setAlternativeFrequenciesEnabled(bool enabled);
|
||||
|
||||
@@ -156,12 +166,15 @@ Q_SIGNALS:
|
||||
void radioTextChanged(QString radioText);
|
||||
void alternativeFrequenciesEnabledChanged(bool enabled);
|
||||
|
||||
void availabilityChanged(Availability availability);
|
||||
|
||||
void errorChanged();
|
||||
void error(QDeclarativeRadioData::Error errorCode);
|
||||
|
||||
private Q_SLOTS:
|
||||
void _q_programTypeChanged(QRadioData::ProgramType programType);
|
||||
void _q_error(QRadioData::Error errorCode);
|
||||
void _q_availabilityChanged(QtMultimedia::AvailabilityError);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QDeclarativeRadioData)
|
||||
|
||||
Reference in New Issue
Block a user