on xenial help sign in
Bring back source property to audio mock

I mistakenly deleted it a while ago

commit3caee59068b4f84cb087e208236736f31f5c1e5f authorAlbert Astals Cid <albert.astals@canonical.com> dateMon 18 Apr 2016, 11:53 (11 years ago) parentb7d0e38
2 files changed+18
tests/mocks/QtMultimedia/audio.cpp+13 tests/mocks/QtMultimedia/audio.h+5
tests/mocks/QtMultimedia/audio.cpp+13
@@ -34,6 +34,19 @@ Audio::Audio(QObject* parent):
3434 Q_EMIT durationChanged(m_duration);
3535}
3636
37+QUrl Audio::source() const
38+{
39+ return m_source;
40+}
41+
42+void Audio::setSource(const QUrl &source)
43+{
44+ if (m_source != source) {
45+ m_source = source;
46+ Q_EMIT sourceChanged(source);
47+ }
48+}
49+
3750Audio::PlaybackState Audio::playbackState() const
3851{
3952 return m_playbackState;
tests/mocks/QtMultimedia/audio.h+5
@@ -29,6 +29,7 @@ class Audio: public QObject
2929 Q_OBJECT
3030 Q_ENUMS(PlaybackState)
3131 Q_ENUMS(AudioRole)
32+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
3233 Q_PROPERTY(PlaybackState playbackState READ playbackState NOTIFY playbackStateChanged)
3334 Q_PROPERTY(int position READ position NOTIFY positionChanged)
3435 Q_PROPERTY(int duration READ duration NOTIFY durationChanged)
@@ -51,6 +52,9 @@ public:
5152
5253 explicit Audio(QObject *parent = 0);
5354
55+ QUrl source() const;
56+ void setSource(const QUrl &source);
57+
5458 DeclarativePlaylist *playlist() const;
5559 void setPlaylist(DeclarativePlaylist *playlist);
5660
@@ -82,6 +86,7 @@ private Q_SLOTS:
8286 void timerEvent();
8387
8488private:
89+ QUrl m_source;
8590 PlaybackState m_playbackState;
8691 QTimer m_timer;
8792 int m_position;