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);
59 ArrayList<BC_ListBoxItem*> *keyframe_data;
63 char window_title[BCTEXTLEN];
64 char plugin_title[BCTEXTLEN];
65 char *column_titles[KEYFRAME_COLUMNS];
66 int column_width[KEYFRAME_COLUMNS];
67 ArrayList<BC_ListBoxItem*> *presets_data;
68 PresetsDB *presets_db;
74 class KeyFrameList : public BC_ListBox
77 KeyFrameList(KeyFrameThread *thread,
78 KeyFrameWindow *window,
83 int selection_changed();
85 int column_resize_event();
86 KeyFrameThread *thread;
87 KeyFrameWindow *window;
91 class KeyFramePresetsList : public BC_ListBox
94 KeyFramePresetsList(KeyFrameThread *thread,
95 KeyFrameWindow *window,
100 int selection_changed();
102 KeyFrameThread *thread;
103 KeyFrameWindow *window;
106 class KeyFramePresetsText : public BC_TextBox
109 KeyFramePresetsText(KeyFrameThread *thread,
110 KeyFrameWindow *window,
115 KeyFrameThread *thread;
116 KeyFrameWindow *window;
120 class KeyFramePresetsDelete : public BC_GenericButton
123 KeyFramePresetsDelete(KeyFrameThread *thread,
124 KeyFrameWindow *window,
128 KeyFrameThread *thread;
129 KeyFrameWindow *window;
132 class KeyFramePresetsSave : public BC_GenericButton
135 KeyFramePresetsSave(KeyFrameThread *thread,
136 KeyFrameWindow *window,
140 KeyFrameThread *thread;
141 KeyFrameWindow *window;
144 class KeyFramePresetsApply : public BC_GenericButton
147 KeyFramePresetsApply(KeyFrameThread *thread,
148 KeyFrameWindow *window,
152 KeyFrameThread *thread;
153 KeyFrameWindow *window;
157 * class KeyFrameText : public BC_TextBox
160 * KeyFrameText(KeyFrameThread *thread,
161 * KeyFrameWindow *window,
165 * int handle_event();
166 * KeyFrameThread *thread;
167 * KeyFrameWindow *window;
174 class KeyFrameValue : public BC_TextBox
177 KeyFrameValue(KeyFrameThread *thread,
178 KeyFrameWindow *window,
183 KeyFrameThread *thread;
184 KeyFrameWindow *window;
187 class KeyFrameAll : public BC_CheckBox
190 KeyFrameAll(KeyFrameThread *thread,
191 KeyFrameWindow *window,
195 KeyFrameThread *thread;
196 KeyFrameWindow *window;
202 class KeyFramePresetsOK : public BC_OKButton
205 KeyFramePresetsOK(KeyFrameThread *thread,
206 KeyFrameWindow *window);
207 int keypress_event();
208 KeyFrameThread *thread;
209 KeyFrameWindow *window;
214 class KeyFrameWindow : public BC_Window
217 KeyFrameWindow(MWindow *mwindow,
218 KeyFrameThread *thread,
222 void create_objects();
223 int resize_event(int w, int h);
227 // List of parameters, values, & whether the parameter is defined by the current keyframe.
228 KeyFrameList *keyframe_list;
229 // The text area of the plugin
230 // KeyFrameText *keyframe_text;
231 // Value text of the current parameter
232 KeyFrameValue *value_text;
233 KeyFrameAll *all_toggle;
236 KeyFramePresetsList *preset_list;
237 KeyFramePresetsText *preset_text;
238 KeyFramePresetsDelete *delete_preset;
239 KeyFramePresetsSave *save_preset;
240 KeyFramePresetsApply *apply_preset;
253 KeyFrameThread *thread;