/*
 * Kylin-video
 *
 * Copyright (C) 2021, Tianjin KYLIN Information Technology Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * Authors: Liu Cong <liucong1@kylinos.cn>
 *
 */

#ifndef PLAYGLWIDGET_H
#define PLAYGLWIDGET_H

#include <QOpenGLWidget>
#include <mpv/client.h>
#include <mpv/render.h>
#include "qthelper.hpp"

#include "core/mpvtypes.h"

class PlayGLWidget : public QWidget
{
public:
    PlayGLWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
    ~PlayGLWidget();
//    void setMpvHandle(mpv::qt::Handle mh){mpv_h = mh;initMpvGL();}
//    void setMouseUsed(bool used);

private slots:
//    void swapped();

private:
//    double m_scale;
//    mpv::qt::Handle mpv_h;
//    mpv_opengl_cb_context *mpv_gl;
//    Mpv::PlayState m_state;
//    QTimer  *m_checkMouseTimer,
//            *m_lMouseClickTimer,
//            *m_fpsTimer;
//    bool    m_mouseUsed,
//            m_isMouseEnter,
//            hasVideo;

//    void initGlobalSig();
//    static void on_update(void *ctx);
//    void initMpvGL();

protected:
//    void initializeGL() override;
//    void paintGL() override;
//    void mousePressEvent(QMouseEvent *e) override;
//    void mouseMoveEvent(QMouseEvent *e) override;
//    void mouseDoubleClickEvent(QMouseEvent *e) override;
//    void enterEvent(QEvent *e) override;
//    void leaveEvent(QEvent *e) override;
};

#endif // PLAYGLWIDGET_H
