From c13a13c4866bdacc066d9921290eed41e1b54a8b Mon Sep 17 00:00:00 2001 From: Mithra Pattison Date: Thu, 29 Dec 2011 11:19:19 +1000 Subject: Adding hasAudio and hasVideo properties to QML MediaPlayer Adding hasAudio and hasVideo to MediaPlayer QML object to allow users to determine whether the current media has audio and/or video streams. Also adding notifies for when these properties change. Change-Id: Ife7606e148f0c0ad558b4019c68c70973c199c08 Reviewed-by: Sergey Dubitskiy Reviewed-by: Michael Goddard --- src/imports/multimedia/qdeclarativeaudio_p.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/imports/multimedia/qdeclarativeaudio_p.h') diff --git a/src/imports/multimedia/qdeclarativeaudio_p.h b/src/imports/multimedia/qdeclarativeaudio_p.h index 7c50bf936..2e11d02ee 100644 --- a/src/imports/multimedia/qdeclarativeaudio_p.h +++ b/src/imports/multimedia/qdeclarativeaudio_p.h @@ -78,6 +78,8 @@ class QDeclarativeAudio : public QObject, public QDeclarativeMediaBase, public Q Q_PROPERTY(int position READ position WRITE setPosition NOTIFY positionChanged) Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged) Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) + Q_PROPERTY(bool hasAudio READ hasAudio NOTIFY hasAudioChanged) + Q_PROPERTY(bool hasVideo READ hasVideo NOTIFY hasVideoChanged) Q_PROPERTY(int bufferProgress READ bufferProgress NOTIFY bufferProgressChanged) Q_PROPERTY(bool seekable READ isSeekable NOTIFY seekableChanged) Q_PROPERTY(qreal playbackRate READ playbackRate WRITE setPlaybackRate NOTIFY playbackRateChanged) @@ -121,6 +123,9 @@ public: QDeclarativeAudio(QObject *parent = 0); ~QDeclarativeAudio(); + bool hasAudio() const; + bool hasVideo() const; + Status status() const; Error error() const; @@ -153,6 +158,8 @@ Q_SIGNALS: void volumeChanged(); void mutedChanged(); + void hasAudioChanged(); + void hasVideoChanged(); void bufferProgressChanged(); -- cgit v1.2.3