]> git.tdb.fi Git - xinema.git/blob - remote/source/xinemacontrol.h
dc7ad8fcd20cbdce0d439013bbe5f359e6da3aa2
[xinema.git] / remote / source / xinemacontrol.h
1 #ifndef XINEMACONTROL_H_
2 #define XINEMACONTROL_H_
3
4 #include <QObject>
5 #include <QTcpSocket>
6
7 class XinemaControl: public QObject
8 {
9         Q_OBJECT
10
11 private:
12         QTcpSocket socket;
13         QByteArray buffer;
14         QString title;
15         float duration;
16         float position;
17
18 public:
19         XinemaControl();
20
21         void connect(const QHostAddress &);
22         bool is_connected() const;
23
24         void list_directory(const QString &);
25         void play_file(const QString &);
26
27         const QString &get_title() const { return title; }
28         float get_duration() const { return duration; }
29         float get_position() const { return position; }
30
31 signals:
32         void connected();
33         void disconnected();
34         void directory_started(const QString &);
35         void file_added(const QString &);
36         void subdirectory_added(const QString &);
37         void title_changed(const QString &);
38         void duration_changed(float);
39         void position_changed(float);
40
41 private:
42         void send_request(const QString &);
43
44 private slots:
45         void data_available();
46         void process_reply(const QString &);
47 };
48
49 #endif