4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
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.
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.
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
23 #ifndef KEYFRAMEPOPUP_H
24 #define KEYFRAMEPOPUP_H
26 #include "apatchgui.h"
28 #include "mwindow.inc"
29 #include "mwindowgui.inc"
30 #include "patchgui.inc"
32 #include "plugindialog.inc"
33 #include "keyframe.inc"
34 #include "keyframepopup.inc"
35 #include "automation.h"
36 #include "floatauto.h"
40 class KeyframePopup : public BC_PopupMenu
43 KeyframePopup(MWindow *mwindow, MWindowGUI *gui);
46 void create_objects();
47 int update(Plugin *plugin, KeyFrame *keyframe);
48 int update(Automation *automation, Autos *autos, Auto *auto_keyframe);
52 // Acquired through the update command as the plugin currently being operated on
54 Plugin *keyframe_plugin;
55 Autos *keyframe_autos;
56 Automation *keyframe_automation;
58 BC_MenuItem *key_mbar;
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;
75 void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
78 class KeyframePopupDelete : public BC_MenuItem
81 KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
82 ~KeyframePopupDelete();
89 class KeyframePopupHide : public BC_MenuItem
92 KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup);
100 class KeyframePopupShow : public BC_MenuItem
103 KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
104 ~KeyframePopupShow();
108 KeyframePopup *popup;
111 class KeyframePopupCopy : public BC_MenuItem
114 KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
115 ~KeyframePopupCopy();
119 KeyframePopup *popup;
122 class KeyframePopupCurveMode : public BC_MenuItem
125 KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
126 ~KeyframePopupCurveMode();
131 KeyframePopup *popup;
133 const char* get_labeltext(int);
134 void toggle_mode(FloatAuto*);
136 friend class KeyframePopup;
140 class KeyframePopupEdit : public BC_MenuItem
143 KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
147 KeyframePopup *popup;
150 class KeyframeHidePopup : public BC_PopupMenu
153 KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
154 ~KeyframeHidePopup();
156 void create_objects();
157 int update(Autos *autos);
161 Autos *keyframe_autos;
164 class KeyframeHideItem : public BC_MenuItem
167 KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
171 KeyframeHidePopup *popup;
174 class KeyMutePatch : public BC_SubWindow
177 KeyMutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
178 void create_objects();
182 KeyMuteValue *key_mute_checkbox;
185 class KeyMuteValue : public BC_CheckBox
188 KeyMuteValue(KeyMutePatch *key_mute_patch);
189 int button_release_event();
192 KeyMutePatch *key_mute_patch;
195 class KeySpeedPatch : public BC_SubWindow
198 KeySpeedPatch(MWindow *mwindow, PatchGUI *gui,
199 int bump, int x, int y);
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);
209 KeySpeedSlider *key_speed_slider;
210 KeySpeedText *key_speed_text;
211 KeySpeedOK *key_speed_ok;
212 KeySpeedAutoEdge *auto_edge;
213 KeySpeedAutoSpan *auto_span;
217 class KeySpeedOK : public BC_Button
220 KeySpeedOK(KeySpeedPatch *key_speed_patch, int x, int y, VFrame **images);
223 KeySpeedPatch *key_speed_patch;
226 class KeySpeedText : public BC_TextBox
229 KeySpeedText(KeySpeedPatch *key_speed_patch, int x, int y, int w, float v);
232 KeySpeedPatch *key_speed_patch;
235 class KeySpeedSlider : public BC_FSlider
238 KeySpeedSlider(KeySpeedPatch *key_speed_patch,
239 int x, int y, int w, float v);
244 KeySpeedPatch *key_speed_patch;
247 class KeySpeedAutoEdge : public BC_Toggle
250 KeySpeedAutoEdge(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
253 KeySpeedPatch *patch;
256 class KeySpeedAutoSpan : public BC_Toggle
259 KeySpeedAutoSpan(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
262 KeySpeedPatch *patch;