]> git.tdb.fi Git - xinema.git/blobdiff - remote/source/xinemacontrolitem.cpp
Add a remote control program for Sailfish OS
[xinema.git] / remote / source / xinemacontrolitem.cpp
diff --git a/remote/source/xinemacontrolitem.cpp b/remote/source/xinemacontrolitem.cpp
new file mode 100644 (file)
index 0000000..6d6cf55
--- /dev/null
@@ -0,0 +1,23 @@
+#include <QHostAddress>
+#include "xinemacontrolitem.h"
+
+XinemaControlItem::XinemaControlItem()
+{
+       QObject::connect(&control, &XinemaControl::connected, this, &XinemaControlItem::connect_state_changed);
+       QObject::connect(&control, &XinemaControl::disconnected, this, &XinemaControlItem::connect_state_changed);
+}
+
+void XinemaControlItem::connect(const QString &host)
+{
+       control.connect(QHostAddress(host));
+}
+
+bool XinemaControlItem::is_connected() const
+{
+       return control.is_connected();
+}
+
+void XinemaControlItem::play_file(const QString &fn)
+{
+       control.play_file(fn);
+}