Olive
viewerwidget.h
1 #ifndef VIEWERWIDGET_H
2 #define VIEWERWIDGET_H
3 
4 #include <QOpenGLWidget>
5 #include <QMatrix4x4>
6 #include <QOpenGLTexture>
7 #include <QTimer>
8 #include <QThread>
9 #include <QMutex>
10 #include <QWaitCondition>
11 #include <QOpenGLFunctions>
12 
13 class Viewer;
14 class Clip;
15 struct FootageStream;
16 class QOpenGLFramebufferObject;
17 class Effect;
18 class EffectGizmo;
19 class ViewerContainer;
20 struct GLTextureCoords;
21 class RenderThread;
22 class ViewerWindow;
23 
24 class ViewerWidget : public QOpenGLWidget, QOpenGLFunctions
25 {
26  Q_OBJECT
27 public:
28  ViewerWidget(QWidget *parent = nullptr);
29  ~ViewerWidget();
30 
31  void delete_function();
32  void close_window();
33 
34  void paintGL();
35  void initializeGL();
36  Viewer* viewer;
37  ViewerContainer* container;
38 
39  bool waveform;
40  Clip* waveform_clip;
41  const FootageStream* waveform_ms;
42  double waveform_zoom;
43  int waveform_scroll;
44 
45  void frame_update();
46  RenderThread* get_renderer();
47  void set_scroll(double x, double y);
48 public slots:
49  void set_waveform_scroll(int s);
50  void set_fullscreen(int screen = 0);
51 protected:
52  void mousePressEvent(QMouseEvent *event);
53  void mouseMoveEvent(QMouseEvent *event);
54  void mouseReleaseEvent(QMouseEvent *event);
55  void wheelEvent(QWheelEvent* event);
56 private:
57  void draw_waveform_func();
58  void draw_title_safe_area();
59  void draw_gizmos();
60  EffectGizmo* get_gizmo_from_mouse(int x, int y);
61  void move_gizmos(QMouseEvent *event, bool done);
62  bool dragging;
63  void seek_from_click(int x);
64  Effect* gizmos;
65  int drag_start_x;
66  int drag_start_y;
67  int gizmo_x_mvmt;
68  int gizmo_y_mvmt;
69  EffectGizmo* selected_gizmo;
70  RenderThread* renderer;
71  ViewerWindow* window;
72  double x_scroll;
73  double y_scroll;
74 private slots:
75  void context_destroy();
76  void retry();
77  void show_context_menu();
78  void save_frame();
79  void queue_repaint();
80  void fullscreen_menu_action(QAction* action);
81  void set_fit_zoom();
82  void set_custom_zoom();
83  void set_menu_zoom(QAction *action);
84 };
85 
86 #endif // VIEWERWIDGET_H
Definition: viewercontainer.h:9
Definition: effect.h:105
Definition: viewerwindow.h:11
Definition: effect.h:146
Definition: effectgizmo.h:21
Definition: footage.h:25
Definition: viewerwidget.h:24
Definition: clip.h:33
Definition: viewer.h:25
Definition: renderthread.h:15