summaryrefslogtreecommitdiffstats
path: root/DOCS/client_api_examples/qml/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'DOCS/client_api_examples/qml/main.h')
-rw-r--r--DOCS/client_api_examples/qml/main.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/DOCS/client_api_examples/qml/main.h b/DOCS/client_api_examples/qml/main.h
new file mode 100644
index 0000000000..9a65ae5350
--- /dev/null
+++ b/DOCS/client_api_examples/qml/main.h
@@ -0,0 +1,36 @@
+#ifndef MPVRENDERER_H_
+#define MPVRENDERER_H_
+
+#include <QtQuick/QQuickFramebufferObject>
+
+#include <mpv/client.h>
+#include <mpv/opengl_cb.h>
+#include <mpv/qthelper.hpp>
+
+class MpvRenderer;
+
+class MpvObject : public QQuickFramebufferObject
+{
+ Q_OBJECT
+
+ mpv::qt::Handle mpv;
+ mpv_opengl_cb_context *mpv_gl;
+
+ friend class MpvRenderer;
+
+public:
+ MpvObject(QQuickItem * parent = 0);
+ virtual ~MpvObject();
+ virtual Renderer *createRenderer() const;
+public slots:
+ void command(const QVariant& params);
+ void setProperty(const QString& name, const QVariant& value);
+signals:
+ void onUpdate();
+private slots:
+ void doUpdate();
+private:
+ static void on_update(void *ctx);
+};
+
+#endif