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();
102 PatchGUI *get_patchgui(Track *track);
106 KeyframePopup *popup;
109 class KeyframePopupCopy : public BC_MenuItem
112 KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
113 ~KeyframePopupCopy();
117 KeyframePopup *popup;
120 class KeyframePopupCurveMode : public BC_MenuItem
123 KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
124 ~KeyframePopupCurveMode();
129 KeyframePopup *popup;
131 const char* get_labeltext(int);
132 void toggle_mode(FloatAuto*);
134 friend class KeyframePopup;
138 class KeyframePopupEdit : public BC_MenuItem
141 KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
145 KeyframePopup *popup;
148 class KeyframeHidePopup : public BC_PopupMenu
151 KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
152 ~KeyframeHidePopup();
154 void create_objects();
155 int update(Autos *autos);
159 Autos *keyframe_autos;
162 class KeyframeHideItem : public BC_MenuItem
165 KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
169 KeyframeHidePopup *popup;
172 class KeyMutePatch : public BC_SubWindow
175 KeyMutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
176 void create_objects();
180 KeyMuteValue *key_mute_checkbox;
183 class KeyMuteValue : public BC_CheckBox
186 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 *patch, int x, int y);
198 void create_objects();
202 KeySpeedValue *key_speed_slider;
205 class KeySpeedValue : public BC_FSlider
208 KeySpeedValue(KeySpeedPatch *key_speed_patch);
213 int button_release_event();
215 KeySpeedPatch *key_speed_patch;