4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef KEYFRAMEPOPUP_H
23 #define KEYFRAMEPOPUP_H
25 #include "apatchgui.h"
27 #include "mwindow.inc"
28 #include "mwindowgui.inc"
29 #include "patchgui.inc"
31 #include "plugindialog.inc"
32 #include "keyframe.inc"
33 #include "keyframepopup.inc"
34 #include "automation.h"
35 #include "floatauto.h"
39 class KeyframePopup : public BC_PopupMenu
42 KeyframePopup(MWindow *mwindow, MWindowGUI *gui);
45 void create_objects();
46 int update(Plugin *plugin, KeyFrame *keyframe);
47 int update(Automation *automation, Autos *autos, Auto *auto_keyframe);
51 // Acquired through the update command as the plugin currently being operated on
53 Plugin *keyframe_plugin;
54 Autos *keyframe_autos;
55 Automation *keyframe_automation;
57 BC_MenuItem *key_mbar;
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;
74 void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
77 class KeyframePopupDelete : public BC_MenuItem
80 KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
81 ~KeyframePopupDelete();
88 class KeyframePopupHide : public BC_MenuItem
91 KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup);
99 class KeyframePopupShow : public BC_MenuItem
102 KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
103 ~KeyframePopupShow();
107 KeyframePopup *popup;
110 class KeyframePopupCopy : public BC_MenuItem
113 KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
114 ~KeyframePopupCopy();
118 KeyframePopup *popup;
121 class KeyframePopupCurveMode : public BC_MenuItem
124 KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
125 ~KeyframePopupCurveMode();
130 KeyframePopup *popup;
132 const char* get_labeltext(int);
133 void toggle_mode(FloatAuto*);
135 friend class KeyframePopup;
139 class KeyframePopupEdit : public BC_MenuItem
142 KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
146 KeyframePopup *popup;
149 class KeyframeHidePopup : public BC_PopupMenu
152 KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
153 ~KeyframeHidePopup();
155 void create_objects();
156 int update(Autos *autos);
160 Autos *keyframe_autos;
163 class KeyframeHideItem : public BC_MenuItem
166 KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
170 KeyframeHidePopup *popup;
173 class KeyMutePatch : public BC_SubWindow
176 KeyMutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
177 void create_objects();
181 KeyMuteValue *key_mute_checkbox;
184 class KeyMuteValue : public BC_CheckBox
187 KeyMuteValue(KeyMutePatch *key_mute_patch);
188 int button_release_event();
191 KeyMutePatch *key_mute_patch;
194 class KeySpeedPatch : public BC_SubWindow
197 KeySpeedPatch(MWindow *mwindow, PatchGUI *gui,
198 int bump, int x, int y);
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);
208 KeySpeedSlider *key_speed_slider;
209 KeySpeedText *key_speed_text;
210 KeySpeedOK *key_speed_ok;
211 KeySpeedAutoEdge *auto_edge;
212 KeySpeedAutoSpan *auto_span;
216 class KeySpeedOK : public BC_Button
219 KeySpeedOK(KeySpeedPatch *key_speed_patch, int x, int y, VFrame **images);
222 KeySpeedPatch *key_speed_patch;
225 class KeySpeedText : public BC_TextBox
228 KeySpeedText(KeySpeedPatch *key_speed_patch, int x, int y, int w, float v);
231 KeySpeedPatch *key_speed_patch;
234 class KeySpeedSlider : public BC_FSlider
237 KeySpeedSlider(KeySpeedPatch *key_speed_patch,
238 int x, int y, int w, float v);
243 KeySpeedPatch *key_speed_patch;
246 class KeySpeedAutoEdge : public BC_Toggle
249 KeySpeedAutoEdge(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
252 KeySpeedPatch *patch;
255 class KeySpeedAutoSpan : public BC_Toggle
258 KeySpeedAutoSpan(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
261 KeySpeedPatch *patch;