]> git.tdb.fi Git - xinema.git/blobdiff - remote/source/xinemacontrol.h
Add a remote control program for Sailfish OS
[xinema.git] / remote / source / xinemacontrol.h
diff --git a/remote/source/xinemacontrol.h b/remote/source/xinemacontrol.h
new file mode 100644 (file)
index 0000000..5dd5e27
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef XINEMACONTROL_H_
+#define XINEMACONTROL_H_
+
+#include <QObject>
+#include <QTcpSocket>
+
+class XinemaControl: public QObject
+{
+       Q_OBJECT
+
+private:
+       QTcpSocket socket;
+       QByteArray buffer;
+
+public:
+       XinemaControl();
+
+       void connect(const QHostAddress &);
+       bool is_connected() const;
+
+       void list_directory(const QString &);
+       void play_file(const QString &);
+
+signals:
+       void connected();
+       void disconnected();
+       void directory_started(const QString &);
+       void file_added(const QString &);
+       void subdirectory_added(const QString &);
+
+private:
+       void send_request(const QString &);
+
+private slots:
+       void data_available();
+       void process_reply(const QString &);
+};
+
+#endif