4 * Copyright (C) 2017 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, int is_factory);
53 void delete_preset(const char *title, int is_factory);
54 void apply_preset(const char *title, int is_factory);
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];
67 // the currently selected preset is a factory preset
69 // title of the currently selected preset from the DB
70 char preset_text[BCTEXTLEN];
72 const char *column_titles[KEYFRAME_COLUMNS];
73 int column_width[KEYFRAME_COLUMNS];
74 // list of preset text to display
75 ArrayList<BC_ListBoxItem*> *presets_data;
76 // flag for each preset shown
77 ArrayList<int> is_factories;
78 // title of each preset shown
79 ArrayList<char*> preset_titles;
80 PresetsDB *presets_db;
86 class KeyFrameList : public BC_ListBox
89 KeyFrameList(KeyFrameThread *thread,
90 KeyFrameWindow *window,
95 int selection_changed();
97 int column_resize_event();
98 KeyFrameThread *thread;
99 KeyFrameWindow *window;
103 class KeyFramePresetsList : public BC_ListBox
106 KeyFramePresetsList(KeyFrameThread *thread,
107 KeyFrameWindow *window,
112 int selection_changed();
114 KeyFrameThread *thread;
115 KeyFrameWindow *window;
118 class KeyFramePresetsText : public BC_TextBox
121 KeyFramePresetsText(KeyFrameThread *thread,
122 KeyFrameWindow *window,
127 KeyFrameThread *thread;
128 KeyFrameWindow *window;
132 class KeyFramePresetsDelete : public BC_GenericButton
135 KeyFramePresetsDelete(KeyFrameThread *thread,
136 KeyFrameWindow *window,
140 KeyFrameThread *thread;
141 KeyFrameWindow *window;
144 class KeyFramePresetsSave : public BC_GenericButton
147 KeyFramePresetsSave(KeyFrameThread *thread,
148 KeyFrameWindow *window,
152 KeyFrameThread *thread;
153 KeyFrameWindow *window;
156 class KeyFramePresetsApply : public BC_GenericButton
159 KeyFramePresetsApply(KeyFrameThread *thread,
160 KeyFrameWindow *window,
164 KeyFrameThread *thread;
165 KeyFrameWindow *window;
169 * class KeyFrameText : public BC_TextBox
172 * KeyFrameText(KeyFrameThread *thread,
173 * KeyFrameWindow *window,
177 * int handle_event();
178 * KeyFrameThread *thread;
179 * KeyFrameWindow *window;
186 class KeyFrameValue : public BC_TextBox
189 KeyFrameValue(KeyFrameThread *thread,
190 KeyFrameWindow *window,
195 KeyFrameThread *thread;
196 KeyFrameWindow *window;
199 class KeyFrameAll : public BC_CheckBox
202 KeyFrameAll(KeyFrameThread *thread,
203 KeyFrameWindow *window,
207 KeyFrameThread *thread;
208 KeyFrameWindow *window;
214 class KeyFramePresetsOK : public BC_OKButton
217 KeyFramePresetsOK(KeyFrameThread *thread,
218 KeyFrameWindow *window);
219 int keypress_event();
220 KeyFrameThread *thread;
221 KeyFrameWindow *window;
226 class KeyFrameWindow : public BC_Window
229 KeyFrameWindow(MWindow *mwindow,
230 KeyFrameThread *thread,
234 void create_objects();
235 int resize_event(int w, int h);
236 void update_editing();
240 // List of parameters, values, & whether the parameter is defined by the current keyframe.
241 KeyFrameList *keyframe_list;
242 // The text area of the plugin
243 // KeyFrameText *keyframe_text;
244 // Value text of the current parameter
245 KeyFrameValue *value_text;
246 KeyFrameAll *all_toggle;
249 KeyFramePresetsList *preset_list;
250 KeyFramePresetsText *preset_text;
251 KeyFramePresetsDelete *delete_preset;
252 KeyFramePresetsSave *save_preset;
253 KeyFramePresetsApply *apply_preset;
266 KeyFrameThread *thread;