1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
#ifndef VIEWERWIDGET_H
#define VIEWERWIDGET_H
#include <QOpenGLWidget>
#include <QMatrix4x4>
#include <QOpenGLTexture>
#include <QTimer>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <QOpenGLFunctions>
class Viewer;
struct Clip;
struct FootageStream;
class QOpenGLFramebufferObject;
class Effect;
class EffectGizmo;
class ViewerContainer;
struct GLTextureCoords;
class ViewerWidget : public QOpenGLWidget, QOpenGLFunctions
{
Q_OBJECT
public:
ViewerWidget(QWidget *parent = 0);
void paintGL();
void initializeGL();
Viewer* viewer;
ViewerContainer* container;
QOpenGLFramebufferObject* default_fbo;
bool waveform;
Clip* waveform_clip;
FootageStream* waveform_ms;
double waveform_zoom;
int waveform_scroll;
bool force_quit;
public slots:
void delete_function();
void set_waveform_scroll(int s);
protected:
void paintEvent(QPaintEvent *e);
// void resizeGL(int w, int h);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
private:
QTimer retry_timer;
void drawTitleSafeArea();
bool dragging;
void seek_from_click(int x);
GLuint compose_sequence(QVector<Clip *> &nests, bool render_audio);
GLuint draw_clip(QOpenGLFramebufferObject *clip, GLuint texture, bool clear);
void process_effect(Clip* c, Effect* e, double timecode, GLTextureCoords& coords, GLuint& composite_texture, bool& fbo_switcher, int data);
Effect* gizmos;
int drag_start_x;
int drag_start_y;
int gizmo_x_mvmt;
int gizmo_y_mvmt;
EffectGizmo* selected_gizmo;
EffectGizmo* get_gizmo_from_mouse(int x, int y);
bool drawn_gizmos;
void move_gizmos(QMouseEvent *event, bool done);
private slots:
void retry();
void show_context_menu();
void save_frame();
void show_fullscreen();
};
#endif // VIEWERWIDGET_H
|