#ifndef MPVOBJECT_H #define MPVOBJECT_H #include #include "config.h" #include #ifdef USE_RENDER #include #else #include #endif #include #include #include #include #include #include #include #include #include class MpvRenderer; class MpvObject : public QQuickFramebufferObject { Q_OBJECT #ifdef USE_RENDER mpv_handle *mpv; mpv_render_context *mpv_gl; #else mpv::qt::Handle mpv; mpv_opengl_cb_context *mpv_gl; #endif friend class MpvRenderer; public: static void on_update(void *ctx); 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); void setOption(const QString& name, const QVariant& value); QVariant getProperty(const QString& name) const; QVariant getThumbnailFile(const QString& name) const; signals: void onUpdate(); void positionChanged(int value); void mpv_events(); private slots: void doUpdate(); void on_mpv_events(); private: void handle_mpv_event(mpv_event *event); }; #endif