Olive
keyframeview.h
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef KEYFRAMEVIEW_H
22 #define KEYFRAMEVIEW_H
23 
24 #include <QWidget>
25 #include <QPainter>
26 
27 class Clip;
28 class Effect;
29 class EffectRow;
30 class EffectField;
31 class TimelineHeader;
32 
33 class KeyframeView : public QWidget {
34  Q_OBJECT
35 public:
36  KeyframeView(QWidget* parent = 0);
37 
38  void delete_selected_keyframes();
39 
40  TimelineHeader* header;
41 
42  long visible_in;
43  long visible_out;
44 signals:
45  void wheel_event_signal(QWheelEvent*);
46 public slots:
47  void set_x_scroll(int);
48  void set_y_scroll(int);
49  void resize_move(double d);
50 private:
51  QVector<EffectField*> selected_fields;
52  QVector<int> selected_keyframes;
53  QVector<int> rowY;
54  QVector<EffectRow*> rows;
55  QVector<long> old_key_vals;
56  void mousePressEvent(QMouseEvent* event);
57  void mouseMoveEvent(QMouseEvent* event);
58  void mouseReleaseEvent(QMouseEvent *event);
59  void paintEvent(QPaintEvent *event);
60  void wheelEvent(QWheelEvent* e);
61  bool mousedown;
62  bool dragging;
63  bool keys_selected;
64  bool select_rect;
65  bool scroll_drag;
66 
67  bool keyframeIsSelected(EffectField *field, int keyframe);
68 
69  long drag_frame_start;
70  long last_frame_diff;
71  int rect_select_x;
72  int rect_select_y;
73  int rect_select_w;
74  int rect_select_h;
75  int rect_select_offset;
76 
77  int x_scroll;
78  int y_scroll;
79 
80  void update_keys();
81 private slots:
82  void show_context_menu(const QPoint& pos);
83  void menu_set_key_type(QAction*);
84 };
85 
86 #endif // KEYFRAMEVIEW_H
Definition: keyframeview.h:33
Definition: effect.h:166
Definition: timelineheader.h:31
Definition: effectrow.h:37
Definition: clip.h:53
Definition: effectfield.h:43