Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • e89b9012bc08ee2c2d37e64be2f99f7a181abb67
  • master par défaut
  • 1-baka-export
  • meson
  • assdraw
  • old-master
  • v3.2.2
  • v3.2.1
  • v3.2.0
  • v3.1.3
  • v3.1.2
  • v3.1.1
  • v3.1.0
  • v3.0.4
  • v3.0.3
  • v3.0.2
  • v3.0.1
  • v3.0.0
  • v2.1.3
  • v2.1.4
  • v2.1.5
  • v2.1.6
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.1.7
26 résultats

freetype2.wrap

Blame
  • mpvwidget.hh 1,48 Kio
    #pragma once
    
    #include <QtOpenGLWidgets/QOpenGLWidget>
    #include <mpv/client.h>
    #include <mpv/render_gl.h>
    #include <QtGui>
    #include <lektor/common.h>
    
    class MpvWidget Q_DECL_FINAL : public QOpenGLWidget {
        Q_OBJECT
    public:
        MpvWidget(struct queue *queue, lkt_db *db, struct module_reg *reg, bool *launched,
                  QWidget *parent);
        ~MpvWidget() override;
        void command(const QVariant &params);
        void setProperty(const QString &name, const QVariant &value);
        QVariant getProperty(const QString &name) const;
        QSize sizeHint() const { return QSize(480, 270); }
    
    protected:
        void initializeGL() Q_DECL_OVERRIDE;
        void paintGL() Q_DECL_OVERRIDE;
    private Q_SLOTS:
        void on_mpv_events();
        void maybeUpdate();
    
    public:
        void handle_mpv_event(mpv_event *event);
        static void on_update(void *ctx);
    
        mpv_handle *mpv;
        mpv_render_context *mpv_gl;
    
    private:
        enum { PLAY, PAUSE, STOP, NONSTOPPED } m_state = STOP;
    
        queue *m_queue;
        lkt_db *m_db;
        module_reg *m_reg;
        bool *m_launched;
    
        int m_position;
        int m_duration;
        bool m_oscVisible = false;
        bool m_inhib      = false;
    
    protected:
        void keyPressEvent(QKeyEvent *event);
    
    public:
        bool get_elapsed(int *);
        bool get_duration(int *);
        bool set_paused(int);
        bool set_volume(int);
        bool set_position(int);
        bool load_file(const char *);
        bool toggle_pause();
        bool stop();
    
    private:
        void update_window_title();
    
    signals:
        void titleChanged(QString str);
    };