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
@@ -76,11 +76,13 @@ class QDeclarativeRadio : public QObject
|
||||
Q_PROPERTY(int minimumFrequency READ minimumFrequency NOTIFY bandChanged)
|
||||
Q_PROPERTY(int maximumFrequency READ maximumFrequency NOTIFY bandChanged)
|
||||
Q_PROPERTY(bool antennaConnected READ isAntennaConnected NOTIFY antennaConnectedChanged)
|
||||
Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged)
|
||||
Q_ENUMS(State)
|
||||
Q_ENUMS(Band)
|
||||
Q_ENUMS(Error)
|
||||
Q_ENUMS(StereoMode)
|
||||
Q_ENUMS(SearchMode)
|
||||
Q_ENUMS(Availability)
|
||||
|
||||
public:
|
||||
enum State {
|
||||
@@ -114,6 +116,13 @@ public:
|
||||
SearchGetStationId = QRadioTuner::SearchGetStationId
|
||||
};
|
||||
|
||||
enum Availability {
|
||||
Available = QtMultimedia::NoError,
|
||||
Busy = QtMultimedia::BusyError,
|
||||
Unavailable = QtMultimedia::ServiceMissingError,
|
||||
ResourceMissing = QtMultimedia::ResourceError
|
||||
};
|
||||
|
||||
QDeclarativeRadio(QObject *parent = 0);
|
||||
~QDeclarativeRadio();
|
||||
|
||||
@@ -134,7 +143,8 @@ public:
|
||||
|
||||
bool isAntennaConnected() const;
|
||||
|
||||
Q_INVOKABLE bool isAvailable() const;
|
||||
Q_INVOKABLE bool isAvailable() const {return availability() == Available;}
|
||||
Availability availability() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setBand(QDeclarativeRadio::Band band);
|
||||
@@ -165,6 +175,8 @@ Q_SIGNALS:
|
||||
void stationFound(int frequency, QString stationId);
|
||||
void antennaConnectedChanged(bool connectionStatus);
|
||||
|
||||
void availabilityChanged(Availability availability);
|
||||
|
||||
void errorChanged();
|
||||
void error(QDeclarativeRadio::Error errorCode);
|
||||
|
||||
@@ -172,6 +184,7 @@ private Q_SLOTS:
|
||||
void _q_stateChanged(QRadioTuner::State state);
|
||||
void _q_bandChanged(QRadioTuner::Band band);
|
||||
void _q_error(QRadioTuner::Error errorCode);
|
||||
void _q_availabilityChanged(QtMultimedia::AvailabilityError);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QDeclarativeRadio)
|
||||
|
||||
Reference in New Issue
Block a user