]> git.tdb.fi Git - xinema.git/blob - remote/source/discoveryitem.h
Implement seeking and play/pause controls in the remote
[xinema.git] / remote / source / discoveryitem.h
1 #ifndef DISCOVERYITEM_H_
2 #define DISCOVERYITEM_H_
3
4 #include <QQuickItem>
5 #include "discovery.h"
6
7 class DiscoveryItem: public QQuickItem
8 {
9         Q_OBJECT
10
11         Q_PROPERTY(bool active READ is_active WRITE set_active NOTIFY active_changed)
12         Q_PROPERTY(QString serverName READ get_server_name NOTIFY server_name_changed)
13
14 private:
15         Discovery discovery;
16         bool active;
17         QHostAddress server_addr;
18
19 public:
20         DiscoveryItem();
21
22         void set_active(bool);
23         bool is_active() const { return active; }
24         QString get_server_name() const { return server_addr.toString(); }
25
26 signals:
27         void server_name_changed();
28         void active_changed();
29
30 private slots:
31         void server_discovered(const QHostAddress &);
32 };
33
34 #endif