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
28 #include "presets.inc"
35 #define KEYFRAME_COLUMNS 2
36 // Enable editing of detailed keyframe parameters.
39 class KeyFrameThread : public BC_DialogThread
42 KeyFrameThread(MWindow *mwindow);
47 void start_window(Plugin *plugin, KeyFrame *keyframe);
48 void handle_done_event(int result);
49 void handle_close_event(int result);
51 void save_value(char *value);
52 void save_preset(const char *title);
53 void delete_preset(const char *title);
54 void apply_preset(const char *title);
56 void calculate_preset_list();
57 void update_gui(int update_value_text = 1);
60 ArrayList<BC_ListBoxItem*> *keyframe_data;
64 char window_title[BCTEXTLEN];
65 char plugin_title[BCTEXTLEN];
66 char *column_titles[KEYFRAME_COLUMNS];
67 int column_width[KEYFRAME_COLUMNS];
68 ArrayList<BC_ListBoxItem*> *presets_data;
69 PresetsDB *presets_db;
75 class KeyFrameList : public BC_ListBox
78 KeyFrameList(KeyFrameThread *thread,
79 KeyFrameWindow *window,
84 int selection_changed();
86 int column_resize_event();
87 KeyFrameThread *thread;
88 KeyFrameWindow *window;
92 class KeyFramePresetsList : public BC_ListBox
95 KeyFramePresetsList(KeyFrameThread *thread,
96 KeyFrameWindow *window,
101 int selection_changed();
103 KeyFrameThread *thread;
104 KeyFrameWindow *window;
107 class KeyFramePresetsText : public BC_TextBox
110 KeyFramePresetsText(KeyFrameThread *thread,
111 KeyFrameWindow *window,
116 KeyFrameThread *thread;
117 KeyFrameWindow *window;
121 class KeyFramePresetsDelete : public BC_GenericButton
124 KeyFramePresetsDelete(KeyFrameThread *thread,
125 KeyFrameWindow *window,
129 KeyFrameThread *thread;
130 KeyFrameWindow *window;
133 class KeyFramePresetsSave : public BC_GenericButton
136 KeyFramePresetsSave(KeyFrameThread *thread,
137 KeyFrameWindow *window,
141 KeyFrameThread *thread;
142 KeyFrameWindow *window;
145 class KeyFramePresetsApply : public BC_GenericButton
148 KeyFramePresetsApply(KeyFrameThread *thread,
149 KeyFrameWindow *window,
153 KeyFrameThread *thread;
154 KeyFrameWindow *window;
158 * class KeyFrameText : public BC_TextBox
161 * KeyFrameText(KeyFrameThread *thread,
162 * KeyFrameWindow *window,
166 * int handle_event();
167 * KeyFrameThread *thread;
168 * KeyFrameWindow *window;
175 class KeyFrameValue : public BC_TextBox
178 KeyFrameValue(KeyFrameThread *thread,
179 KeyFrameWindow *window,
184 KeyFrameThread *thread;
185 KeyFrameWindow *window;
188 class KeyFrameAll : public BC_CheckBox
191 KeyFrameAll(KeyFrameThread *thread,
192 KeyFrameWindow *window,
196 KeyFrameThread *thread;
197 KeyFrameWindow *window;
203 class KeyFramePresetsOK : public BC_OKButton
206 KeyFramePresetsOK(KeyFrameThread *thread,
207 KeyFrameWindow *window);
208 int keypress_event();
209 KeyFrameThread *thread;
210 KeyFrameWindow *window;
215 class KeyFrameWindow : public BC_Window
218 KeyFrameWindow(MWindow *mwindow,
219 KeyFrameThread *thread,
223 void create_objects();
224 int resize_event(int w, int h);
228 // List of parameters, values, & whether the parameter is defined by the current keyframe.
229 KeyFrameList *keyframe_list;
230 // The text area of the plugin
231 // KeyFrameText *keyframe_text;
232 // Value text of the current parameter
233 KeyFrameValue *value_text;
234 KeyFrameAll *all_toggle;
237 KeyFramePresetsList *preset_list;
238 KeyFramePresetsText *preset_text;
239 KeyFramePresetsDelete *delete_preset;
240 KeyFramePresetsSave *save_preset;
241 KeyFramePresetsApply *apply_preset;
254 KeyFrameThread *thread;