~saviq/unity8/skip-logind-test

« back to all changes in this revision

Viewing changes to tests/mocks/QtMultimedia/audio.h

  • Committer: CI Train Bot
  • Author(s): Albert Astals Cid, Michael Zanetti
  • Date: 2016-01-07 08:04:43 UTC
  • mfrom: (1757.3.53 audioCardSupport)
  • Revision ID: ci-train-bot@canonical.com-20160107080443-6khrb6nm9o075wl4
Introduce audio cards
Approved by: Michał Sawicz, Pawel Stolowski, Andrea Cimitan

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2012,2013 Canonical, Ltd.
 
2
 * Copyright (C) 2012, 2013, 2015 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
13
13
 * You should have received a copy of the GNU General Public License
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 *
16
 
 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17
16
 */
18
17
 
19
18
#ifndef MOCK_AUDIO_H
23
22
#include <QUrl>
24
23
#include <QTimer>
25
24
 
 
25
class DeclarativePlaylist;
 
26
 
26
27
class Audio: public QObject
27
28
{
28
29
    Q_OBJECT
29
30
    Q_ENUMS(PlaybackState)
30
31
    Q_ENUMS(AudioRole)
31
 
    Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
32
32
    Q_PROPERTY(PlaybackState playbackState READ playbackState NOTIFY playbackStateChanged)
33
33
    Q_PROPERTY(int position READ position NOTIFY positionChanged)
34
34
    Q_PROPERTY(int duration READ duration NOTIFY durationChanged)
35
35
    Q_PROPERTY(QString errorString READ errorString NOTIFY errorStringChanged)
36
36
    Q_PROPERTY(AudioRole audioRole READ audioRole WRITE setAudioRole)
 
37
    Q_PROPERTY(DeclarativePlaylist *playlist READ playlist WRITE setPlaylist NOTIFY playlistChanged)
37
38
public:
38
39
    enum PlaybackState {
39
40
        PlayingState,
50
51
 
51
52
    explicit Audio(QObject *parent = 0);
52
53
 
53
 
    QUrl source() const;
54
 
    void setSource(const QUrl &source);
 
54
    DeclarativePlaylist *playlist() const;
 
55
    void setPlaylist(DeclarativePlaylist *playlist);
55
56
 
56
57
    PlaybackState playbackState() const;
57
58
 
70
71
    void stop();
71
72
 
72
73
Q_SIGNALS:
 
74
    void playlistChanged();
73
75
    void sourceChanged(const QUrl &source);
74
76
    void playbackStateChanged(PlaybackState playbackState);
75
77
    void positionChanged(int position);
80
82
    void timerEvent();
81
83
 
82
84
private:
83
 
    QUrl m_source;
84
85
    PlaybackState m_playbackState;
85
86
    QTimer m_timer;
86
87
    int m_position;
87
88
    int m_duration;
 
89
    DeclarativePlaylist *m_playlist;
88
90
};
89
91
 
90
92
#endif