6c4156e211b1875e793643acac5a139d6e19ba7a
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / keyframepopup.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * Copyright (C) 2003-2016 Cinelerra CV contributors
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #ifndef KEYFRAMEPOPUP_H
24 #define KEYFRAMEPOPUP_H
25
26 #include "apatchgui.h"
27 #include "guicast.h"
28 #include "mwindow.inc"
29 #include "mwindowgui.inc"
30 #include "patchgui.inc"
31 #include "plugin.inc"
32 #include "plugindialog.inc"
33 #include "keyframe.inc"
34 #include "keyframepopup.inc"
35 #include "automation.h"
36 #include "floatauto.h"
37
38
39
40 class KeyframePopup : public BC_PopupMenu
41 {
42 public:
43         KeyframePopup(MWindow *mwindow, MWindowGUI *gui);
44         ~KeyframePopup();
45
46         void create_objects();
47         int update(Plugin *plugin, KeyFrame *keyframe);
48         int update(Automation *automation, Autos *autos, Auto *auto_keyframe);
49
50         MWindow *mwindow;
51         MWindowGUI *gui;
52 // Acquired through the update command as the plugin currently being operated on
53
54         Plugin *keyframe_plugin;
55         Autos *keyframe_autos;
56         Automation *keyframe_automation;
57         Auto *keyframe_auto;
58         BC_MenuItem *key_mbar;
59         int popx, popy;
60
61 private:
62         KeyframePopupDelete *key_delete;
63         KeyframePopupHide *key_hide;
64         KeyframePopupShow *key_show;
65         KeyframePopupCopy *key_copy;
66         KeyframePopupEdit *key_edit;
67         KeyframePopupCurveMode *key_smooth;
68         KeyframePopupCurveMode *key_linear;
69         KeyframePopupCurveMode *key_free_t;
70         KeyframePopupCurveMode *key_free;
71         KeyframePopupCurveMode *key_bump;
72         bool key_edit_displayed;
73         bool key_mode_displayed;
74
75         void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
76 };
77
78 class KeyframePopupDelete : public BC_MenuItem
79 {
80 public:
81         KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
82         ~KeyframePopupDelete();
83         int handle_event();
84
85         MWindow *mwindow;
86         KeyframePopup *popup;
87 };
88
89 class KeyframePopupHide : public BC_MenuItem
90 {
91 public:
92         KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup);
93         ~KeyframePopupHide();
94         int handle_event();
95
96         MWindow *mwindow;
97         KeyframePopup *popup;
98 };
99
100 class KeyframePopupShow : public BC_MenuItem
101 {
102 public:
103         KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
104         ~KeyframePopupShow();
105         int handle_event();
106
107         MWindow *mwindow;
108         KeyframePopup *popup;
109 };
110
111 class KeyframePopupCopy : public BC_MenuItem
112 {
113 public:
114         KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
115         ~KeyframePopupCopy();
116         int handle_event();
117
118         MWindow *mwindow;
119         KeyframePopup *popup;
120 };
121
122 class KeyframePopupCurveMode : public BC_MenuItem
123 {
124 public:
125         KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
126         ~KeyframePopupCurveMode();
127         int handle_event();
128
129 private:
130         MWindow *mwindow;
131         KeyframePopup *popup;
132         int curve_mode;
133         const char* get_labeltext(int);
134         void toggle_mode(FloatAuto*);
135
136 friend class KeyframePopup;
137 };
138
139
140 class KeyframePopupEdit : public BC_MenuItem
141 {
142 public:
143         KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
144         int handle_event();
145
146         MWindow *mwindow;
147         KeyframePopup *popup;
148 };
149
150 class KeyframeHidePopup : public BC_PopupMenu
151 {
152 public:
153         KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
154         ~KeyframeHidePopup();
155
156         void create_objects();
157         int update(Autos *autos);
158
159         MWindow *mwindow;
160         MWindowGUI *gui;
161         Autos *keyframe_autos;
162 };
163
164 class KeyframeHideItem : public BC_MenuItem
165 {
166 public:
167         KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
168         int handle_event();
169
170         MWindow *mwindow;
171         KeyframeHidePopup *popup;
172 };
173
174 class KeyMutePatch : public BC_SubWindow
175 {
176 public:
177         KeyMutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
178         void create_objects();
179
180         MWindow *mwindow;
181         PatchGUI *patch;
182         KeyMuteValue *key_mute_checkbox;
183 };
184
185 class KeyMuteValue : public BC_CheckBox
186 {
187 public:
188         KeyMuteValue(KeyMutePatch *key_mute_patch);
189         int button_release_event();
190         int handle_event();
191
192         KeyMutePatch *key_mute_patch;
193 };
194
195 class KeySpeedPatch : public BC_SubWindow
196 {
197 public:
198         KeySpeedPatch(MWindow *mwindow, PatchGUI *gui,
199                         int bump, int x, int y);
200         ~KeySpeedPatch();
201         void create_objects();
202         void update(float v);
203         void set_edge(int edge);
204         void set_span(int span);
205         void update_speed(float v);
206
207         MWindow *mwindow;
208         PatchGUI *gui;
209         KeySpeedSlider *key_speed_slider;
210         KeySpeedText *key_speed_text;
211         KeySpeedOK *key_speed_ok;
212         KeySpeedAutoEdge *auto_edge;
213         KeySpeedAutoSpan *auto_span;
214         int need_undo;
215 };
216
217 class KeySpeedOK : public BC_Button
218 {
219 public:
220         KeySpeedOK(KeySpeedPatch *key_speed_patch, int x, int y, VFrame **images);
221         int handle_event();
222
223         KeySpeedPatch *key_speed_patch;
224 };
225
226 class KeySpeedText : public BC_TextBox
227 {
228 public:
229         KeySpeedText(KeySpeedPatch *key_speed_patch, int x, int y, int w, float v);
230         int handle_event();
231
232         KeySpeedPatch *key_speed_patch;
233 };
234
235 class KeySpeedSlider : public BC_FSlider
236 {
237 public:
238         KeySpeedSlider(KeySpeedPatch *key_speed_patch,
239                 int x, int y, int w, float v);
240         ~KeySpeedSlider();
241
242         int handle_event();
243
244         KeySpeedPatch *key_speed_patch;
245 };
246
247 class KeySpeedAutoEdge : public BC_Toggle
248 {
249 public:
250         KeySpeedAutoEdge(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
251         int handle_event();
252         MWindow *mwindow;
253         KeySpeedPatch *patch;
254 };
255
256 class KeySpeedAutoSpan : public BC_Toggle
257 {
258 public:
259         KeySpeedAutoSpan(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
260         int handle_event();
261         MWindow *mwindow;
262         KeySpeedPatch *patch;
263 };
264
265 #endif