File: keyframeview.h

package info (click to toggle)
olive-editor 20181223-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,844 kB
  • sloc: cpp: 20,147; xml: 315; ansic: 16; makefile: 11
file content (59 lines) | stat: -rw-r--r-- 1,333 bytes parent folder | download
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
#ifndef KEYFRAMEVIEW_H
#define KEYFRAMEVIEW_H

#include <QWidget>
#include <QPainter>

struct Clip;
class Effect;
class EffectRow;
class TimelineHeader;

class KeyframeView : public QWidget {
	Q_OBJECT
public:
	KeyframeView(QWidget* parent = 0);

	void delete_selected_keyframes();

	TimelineHeader* header;

	long visible_in;
	long visible_out;
public slots:
	void set_x_scroll(int);
	void set_y_scroll(int);
private:
	long adjust_row_keyframe(EffectRow* row, long time);
	QVector<EffectRow*> selected_rows;
    QVector<int> selected_keyframes;
	QVector<int> rowY;
	long frame_diff;
	QVector<EffectRow*> rows;
	void mousePressEvent(QMouseEvent* event);
	void mouseMoveEvent(QMouseEvent* event);
	void mouseReleaseEvent(QMouseEvent *event);
	void paintEvent(QPaintEvent *event);
    void draw_keyframe(QPainter& p, int type, int x, int y, bool darker);
    bool mousedown;
	bool dragging;
	bool keys_selected;
	bool select_rect;

	bool keyframeIsSelected(EffectRow* row, int keyframe);

	long drag_frame_start;
	long last_frame_diff;
	int rect_select_x;
	int rect_select_y;
	int rect_select_w;
	int rect_select_h;

	int x_scroll;
	int y_scroll;
private slots:
    void show_context_menu(const QPoint& pos);
    void menu_set_key_type(QAction*);
};

#endif // KEYFRAMEVIEW_H