no longer need ffmpeg patch0 which was for Termux
[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  *
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 2 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, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef KEYFRAMEPOPUP_H
23 #define KEYFRAMEPOPUP_H
24
25 #include "apatchgui.h"
26 #include "guicast.h"
27 #include "mwindow.inc"
28 #include "mwindowgui.inc"
29 #include "patchgui.inc"
30 #include "plugin.inc"
31 #include "plugindialog.inc"
32 #include "keyframe.inc"
33 #include "keyframepopup.inc"
34 #include "automation.h"
35 #include "floatauto.h"
36
37
38
39 class KeyframePopup : public BC_PopupMenu
40 {
41 public:
42         KeyframePopup(MWindow *mwindow, MWindowGUI *gui);
43         ~KeyframePopup();
44
45         void create_objects();
46         int update(Plugin *plugin, KeyFrame *keyframe);
47         int update(Automation *automation, Autos *autos, Auto *auto_keyframe);
48
49         MWindow *mwindow;
50         MWindowGUI *gui;
51 // Acquired through the update command as the plugin currently being operated on
52
53         Plugin *keyframe_plugin;
54         Autos *keyframe_autos;
55         Automation *keyframe_automation;
56         Auto *keyframe_auto;
57         BC_MenuItem *key_mbar;
58         int popx, popy;
59
60 private:
61         KeyframePopupDelete *key_delete;
62         KeyframePopupHide *key_hide;
63         KeyframePopupShow *key_show;
64         KeyframePopupCopy *key_copy;
65         KeyframePopupEdit *key_edit;
66         KeyframePopupCurveMode *key_smooth;
67         KeyframePopupCurveMode *key_linear;
68         KeyframePopupCurveMode *key_free_t;
69         KeyframePopupCurveMode *key_free;
70         KeyframePopupCurveMode *key_bump;
71         bool key_edit_displayed;
72         bool key_mode_displayed;
73
74         void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
75 };
76
77 class KeyframePopupDelete : public BC_MenuItem
78 {
79 public:
80         KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
81         ~KeyframePopupDelete();
82         int handle_event();
83
84         MWindow *mwindow;
85         KeyframePopup *popup;
86 };
87
88 class KeyframePopupHide : public BC_MenuItem
89 {
90 public:
91         KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup);
92         ~KeyframePopupHide();
93         int handle_event();
94
95         MWindow *mwindow;
96         KeyframePopup *popup;
97 };
98
99 class KeyframePopupShow : public BC_MenuItem
100 {
101 public:
102         KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
103         ~KeyframePopupShow();
104         int handle_event();
105
106         MWindow *mwindow;
107         KeyframePopup *popup;
108 };
109
110 class KeyframePopupCopy : public BC_MenuItem
111 {
112 public:
113         KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
114         ~KeyframePopupCopy();
115         int handle_event();
116
117         MWindow *mwindow;
118         KeyframePopup *popup;
119 };
120
121 class KeyframePopupCurveMode : public BC_MenuItem
122 {
123 public:
124         KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
125         ~KeyframePopupCurveMode();
126         int handle_event();
127
128 private:
129         MWindow *mwindow;
130         KeyframePopup *popup;
131         int curve_mode;
132         const char* get_labeltext(int);
133         void toggle_mode(FloatAuto*);
134
135 friend class KeyframePopup;
136 };
137
138
139 class KeyframePopupEdit : public BC_MenuItem
140 {
141 public:
142         KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
143         int handle_event();
144
145         MWindow *mwindow;
146         KeyframePopup *popup;
147 };
148
149 class KeyframeHidePopup : public BC_PopupMenu
150 {
151 public:
152         KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
153         ~KeyframeHidePopup();
154
155         void create_objects();
156         int update(Autos *autos);
157
158         MWindow *mwindow;
159         MWindowGUI *gui;
160         Autos *keyframe_autos;
161 };
162
163 class KeyframeHideItem : public BC_MenuItem
164 {
165 public:
166         KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
167         int handle_event();
168
169         MWindow *mwindow;
170         KeyframeHidePopup *popup;
171 };
172
173 class KeyMutePatch : public BC_SubWindow
174 {
175 public:
176         KeyMutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
177         void create_objects();
178
179         MWindow *mwindow;
180         PatchGUI *patch;
181         KeyMuteValue *key_mute_checkbox;
182 };
183
184 class KeyMuteValue : public BC_CheckBox
185 {
186 public:
187         KeyMuteValue(KeyMutePatch *key_mute_patch);
188         int button_release_event();
189         int handle_event();
190
191         KeyMutePatch *key_mute_patch;
192 };
193
194 class KeySpeedPatch : public BC_SubWindow
195 {
196 public:
197         KeySpeedPatch(MWindow *mwindow, PatchGUI *gui,
198                         int bump, int x, int y);
199         ~KeySpeedPatch();
200         void create_objects();
201         void update(float v);
202         void set_edge(int edge);
203         void set_span(int span);
204         void update_speed(float v);
205
206         MWindow *mwindow;
207         PatchGUI *gui;
208         KeySpeedSlider *key_speed_slider;
209         KeySpeedText *key_speed_text;
210         KeySpeedOK *key_speed_ok;
211         KeySpeedAutoEdge *auto_edge;
212         KeySpeedAutoSpan *auto_span;
213         int need_undo;
214 };
215
216 class KeySpeedOK : public BC_Button
217 {
218 public:
219         KeySpeedOK(KeySpeedPatch *key_speed_patch, int x, int y, VFrame **images);
220         int handle_event();
221
222         KeySpeedPatch *key_speed_patch;
223 };
224
225 class KeySpeedText : public BC_TextBox
226 {
227 public:
228         KeySpeedText(KeySpeedPatch *key_speed_patch, int x, int y, int w, float v);
229         int handle_event();
230
231         KeySpeedPatch *key_speed_patch;
232 };
233
234 class KeySpeedSlider : public BC_FSlider
235 {
236 public:
237         KeySpeedSlider(KeySpeedPatch *key_speed_patch,
238                 int x, int y, int w, float v);
239         ~KeySpeedSlider();
240
241         int handle_event();
242
243         KeySpeedPatch *key_speed_patch;
244 };
245
246 class KeySpeedAutoEdge : public BC_Toggle
247 {
248 public:
249         KeySpeedAutoEdge(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
250         int handle_event();
251         MWindow *mwindow;
252         KeySpeedPatch *patch;
253 };
254
255 class KeySpeedAutoSpan : public BC_Toggle
256 {
257 public:
258         KeySpeedAutoSpan(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
259         int handle_event();
260         MWindow *mwindow;
261         KeySpeedPatch *patch;
262 };
263
264 #endif