]> git.sesse.net Git - pkanalytics/blobdiff - video_widget.h
Make it possible to seek using the 4th and 5th mouse buttons.
[pkanalytics] / video_widget.h
index 801d5cdb6844565e1c7de2853a06de28bc6e99ee..1f1ffe2ffb6b8f752fff942a031108dce94f6477 100644 (file)
@@ -39,8 +39,15 @@ public:
        void paintGL() override;
        void wheelEvent(QWheelEvent *event) override;
 
+       // For dragging, and for back/forward button presses.
+       void mousePressEvent(QMouseEvent *e);
+       void mouseReleaseEvent(QMouseEvent *e);
+       void mouseMoveEvent(QMouseEvent *e);
+
 signals:
        void position_changed(uint64_t pos);
+       void mouse_back_clicked();
+       void mouse_forward_clicked();
 
 private:
        // Should really have been persistent and a PBO, but this is OK for now.
@@ -92,6 +99,9 @@ private:
 
        std::string pathname;
 
+       bool dragging = false;
+       float last_drag_x, last_drag_y;
+
        void producer_thread_func();
        bool play_video(const std::string &pathname);
        void internal_rewind();