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;
60 KeyframePopupDelete *key_delete;
61 KeyframePopupHide *key_hide;
62 KeyframePopupShow *key_show;
63 KeyframePopupCopy *key_copy;
64 KeyframePopupEdit *key_edit;
65 KeyframePopupCurveMode *key_smooth;
66 KeyframePopupCurveMode *key_linear;
67 KeyframePopupCurveMode *key_free_t;
68 KeyframePopupCurveMode *key_free;
69 bool key_edit_displayed;
70 bool key_mode_displayed;
72 void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
75 class KeyframePopupDelete : public BC_MenuItem
78 KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
79 ~KeyframePopupDelete();
86 class KeyframePopupHide : public BC_MenuItem
89 KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup);
97 class KeyframePopupShow : public BC_MenuItem
100 KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
101 ~KeyframePopupShow();
105 KeyframePopup *popup;
108 class KeyframePopupCopy : public BC_MenuItem
111 KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
112 ~KeyframePopupCopy();
116 KeyframePopup *popup;
119 class KeyframePopupCurveMode : public BC_MenuItem
122 KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
123 ~KeyframePopupCurveMode();
128 KeyframePopup *popup;
130 const char* get_labeltext(int);
131 void toggle_mode(FloatAuto*);
133 friend class KeyframePopup;
137 class KeyframePopupEdit : public BC_MenuItem
140 KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
144 KeyframePopup *popup;
147 class KeyframeHidePopup : public BC_PopupMenu
150 KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
151 ~KeyframeHidePopup();
153 void create_objects();
154 int update(Autos *autos);
158 Autos *keyframe_autos;
161 class KeyframeHideItem : public BC_MenuItem
164 KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
168 KeyframeHidePopup *popup;
171 class KeyMutePatch : public BC_SubWindow
174 KeyMutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
175 void create_objects();
179 KeyMuteValue *key_mute_checkbox;
182 class KeyMuteValue : public BC_CheckBox
185 KeyMuteValue(KeyMutePatch *key_mute_patch);
187 int button_release_event();
190 KeyMutePatch *key_mute_patch;
193 class KeySpeedPatch : public BC_SubWindow
196 KeySpeedPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
197 void create_objects();
201 KeySpeedValue *key_speed_slider;
204 class KeySpeedValue : public BC_FSlider
207 KeySpeedValue(KeySpeedPatch *key_speed_patch);
212 int button_release_event();
214 KeySpeedPatch *key_speed_patch;