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
@@ -87,10 +87,12 @@ class QDeclarativeAudio : public QObject, public QDeclarativeMediaBase, public Q
|
||||
Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
|
||||
Q_PROPERTY(QDeclarativeMediaMetaData *metaData READ metaData CONSTANT)
|
||||
Q_PROPERTY(QObject *mediaObject READ mediaObject NOTIFY mediaObjectChanged SCRIPTABLE false DESIGNABLE false)
|
||||
Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged)
|
||||
Q_ENUMS(Status)
|
||||
Q_ENUMS(Error)
|
||||
Q_ENUMS(Loop)
|
||||
Q_ENUMS(PlaybackState)
|
||||
Q_ENUMS(Availability)
|
||||
Q_INTERFACES(QDeclarativeParserStatus)
|
||||
public:
|
||||
enum Status
|
||||
@@ -128,6 +130,13 @@ public:
|
||||
StoppedState = QMediaPlayer::StoppedState
|
||||
};
|
||||
|
||||
enum Availability {
|
||||
Available = QtMultimedia::NoError,
|
||||
Busy = QtMultimedia::BusyError,
|
||||
Unavailable = QtMultimedia::ServiceMissingError,
|
||||
ResourceMissing = QtMultimedia::ResourceError
|
||||
};
|
||||
|
||||
QDeclarativeAudio(QObject *parent = 0);
|
||||
~QDeclarativeAudio();
|
||||
|
||||
@@ -143,6 +152,8 @@ public:
|
||||
|
||||
QObject *mediaObject() { return m_mediaObject; }
|
||||
|
||||
Availability availability() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void play();
|
||||
void pause();
|
||||
@@ -175,6 +186,8 @@ Q_SIGNALS:
|
||||
void seekableChanged();
|
||||
void playbackRateChanged();
|
||||
|
||||
void availabilityChanged(Availability availability);
|
||||
|
||||
void errorChanged();
|
||||
void error(QDeclarativeAudio::Error error, const QString &errorString);
|
||||
|
||||
@@ -182,6 +195,7 @@ Q_SIGNALS:
|
||||
|
||||
private Q_SLOTS:
|
||||
void _q_error(int, const QString &);
|
||||
void _q_availabilityChanged(QtMultimedia::AvailabilityError);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QDeclarativeAudio)
|
||||
|
||||
Reference in New Issue
Block a user