summaryrefslogtreecommitdiffstats
path: root/examples/mediaplayer/spengine.h
blob: 3134b75dececb5a1969b7265cdcacb92f44aa619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef SPENGINE_H
#define SPENGINE_H
#include <QObject>
#include <QUrl>
class SPEngine : public QObject
{
    Q_OBJECT
    Q_PROPERTY(int totalTime READ totalTime)
    Q_PROPERTY(int currentTime READ currentTime)
    Q_PROPERTY(int volume READ volume WRITE setVolume)

    Q_SIGNALS:
        void aboutToFinish();
        void tick(qint64);
        void totalTimeChanged(qint64);
        void volumeChanged(int);

    public Q_SLOTS:
        void clearQueue();
        void enqueue (const QUrl &);
        void setTrack(const QUrl &);
        void play();
        void pause();
        void seek(qint64);
        void stop ();

    protected Q_SLOTS:
	    void onVolumeChanged(qreal);

    public:
        SPEngine(QObject*);
        virtual ~SPEngine ();
        int currentTime () const;
        int totalTime () const;
        void setVolume(int);
        int volume () const;

    private:
        class SPEnginePvt* pvt;
};
#endif