Olive
effectcontrols.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 EFFECTCONTROLS_H
22 #define EFFECTCONTROLS_H
23 
24 #include <QDockWidget>
25 #include <QUndoCommand>
26 #include <QMutex>
27 
28 class Clip;
29 class QMenu;
30 class Effect;
31 class TimelineHeader;
32 class QScrollArea;
33 class KeyframeView;
34 class QVBoxLayout;
35 class ResizableScrollBar;
36 class QLabel;
37 class KeyframeView;
38 class QScrollBar;
39 class QHBoxLayout;
40 
41 class EffectsArea : public QWidget {
42  Q_OBJECT
43 public:
44  EffectsArea(QWidget* parent = 0);
45  QScrollArea* parent_widget;
46  KeyframeView* keyframe_area;
47  TimelineHeader* header;
48 public slots:
49  void receive_wheel_event(QWheelEvent* e);
50 };
51 
52 class EffectControls : public QDockWidget
53 {
54  Q_OBJECT
55 public:
56  explicit EffectControls(QWidget *parent = 0);
57  ~EffectControls();
58  int get_mode();
59  void set_clips(QVector<int>& clips, int mode);
60  void clear_effects(bool clear_cache);
61  void delete_effects();
62  bool is_focused();
63  void reload_clips();
64  void set_zoom(bool in);
65  bool keyframe_focus();
66  void delete_selected_keyframes();
67  bool multiple;
68  void scroll_to_frame(long frame);
69 
70  QVector<int> selected_clips;
71 
72  double zoom;
73 
74  ResizableScrollBar* horizontalScrollBar;
75  QScrollBar* verticalScrollBar;
76 
77  QMutex effects_loaded;
78 
79  void add_effect_paste_action(QMenu* menu);
80 public slots:
81  void cut();
82  void copy(bool del = false);
83  void update_keyframes();
84 private slots:
85  void menu_select(QAction* q);
86 
87  void video_effect_click();
88  void audio_effect_click();
89  void video_transition_click();
90  void audio_transition_click();
91 
92  void deselect_all_effects(QWidget*);
93 
94  void update_scrollbar();
95  void queue_post_update();
96 
97  void effects_area_context_menu();
98 protected:
99  void resizeEvent(QResizeEvent *event);
100 private:
101  void show_effect_menu(int type, int subtype);
102  void load_effects();
103  void load_keyframes();
104  void open_effect(QVBoxLayout* hlayout, Effect* e);
105 
106  void setup_ui();
107 
108  int effect_menu_type;
109  int effect_menu_subtype;
110  QString panel_name;
111  int mode;
112 
113  TimelineHeader* headers;
114  EffectsArea* effects_area;
115  QScrollArea* scrollArea;
116  QLabel* lblMultipleClipsSelected;
117  KeyframeView* keyframeView;
118  QWidget* video_effect_area;
119  QWidget* audio_effect_area;
120  QWidget* vcontainer;
121  QWidget* acontainer;
122 };
123 
124 #endif // EFFECTCONTROLS_H
Definition: keyframeview.h:33
Definition: effectcontrols.h:41
Definition: effect.h:166
Definition: timelineheader.h:31
Definition: effectcontrols.h:52
Definition: resizablescrollbar.h:26
Definition: clip.h:53