]> git.tdb.fi Git - xinema.git/blob - remote/source/streamcontrolitem.h
cb08836c69ca0a21327832057069202b5405020d
[xinema.git] / remote / source / streamcontrolitem.h
1 #ifndef STREAMCONTROLITEM_H_
2 #define STREAMCONTROLITEM_H_
3
4 #include <QQuickItem>
5 #include "xinemacontrol.h"
6
7 class XinemaControlItem;
8
9 class StreamControlItem: public QQuickItem
10 {
11         Q_OBJECT
12
13         Q_PROPERTY(XinemaControlItem *control READ get_control WRITE set_control NOTIFY control_changed)
14         Q_PROPERTY(PlaybackState playbackState READ get_playback_state WRITE set_playback_state NOTIFY playback_state_changed)
15         Q_PROPERTY(QString title READ get_title NOTIFY title_changed)
16         Q_PROPERTY(float duration READ get_duration NOTIFY duration_changed)
17         Q_PROPERTY(float position READ get_position WRITE set_position NOTIFY position_changed)
18
19         Q_ENUMS(PlaybackState)
20
21 public:
22         enum PlaybackState
23         {
24                 Stopped = XinemaControl::STOPPED,
25                 Paused = XinemaControl::PAUSED,
26                 Playing = XinemaControl::PLAYING
27         };
28
29 private:
30         XinemaControlItem *control;
31
32 public:
33         StreamControlItem();
34
35         void set_control(XinemaControlItem *);
36         XinemaControlItem *get_control() const { return control; }
37
38         PlaybackState get_playback_state() const;
39         void set_playback_state(PlaybackState);
40         QString get_title() const;
41         float get_duration() const;
42         void set_position(float);
43         float get_position() const;
44
45 signals:
46         void control_changed();
47         void playback_state_changed();
48         void title_changed();
49         void duration_changed();
50         void position_changed();
51 };
52
53 #endif