initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / keyframegui.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
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.
10  * 
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.
15  * 
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
19  * 
20  */
21
22 #ifndef KEYFRAMEGUI_H
23 #define KEYFRAMEGUI_H
24
25
26 #include "bcdialog.h"
27 #include "guicast.h"
28 #include "presets.inc"
29
30 class KeyFrameWindow;
31
32
33
34
35 #define KEYFRAME_COLUMNS 2
36 // Enable editing of detailed keyframe parameters.
37 #define EDIT_KEYFRAME
38
39 class KeyFrameThread : public BC_DialogThread
40 {
41 public:
42         KeyFrameThread(MWindow *mwindow);
43         ~KeyFrameThread();
44
45
46         BC_Window* new_gui();
47         void start_window(Plugin *plugin, KeyFrame *keyframe);
48         void handle_done_event(int result);
49         void handle_close_event(int result);
50         void update_values();
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);
55         void apply_value();
56         void calculate_preset_list();
57         void update_gui(int update_value_text = 1);
58         void close_window();
59
60         ArrayList<BC_ListBoxItem*> *keyframe_data;
61         Plugin *plugin;
62         KeyFrame *keyframe;
63         MWindow *mwindow;
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;
70 };
71
72 #ifdef EDIT_KEYFRAME
73
74
75 class KeyFrameList : public BC_ListBox
76 {
77 public:
78         KeyFrameList(KeyFrameThread *thread,
79                 KeyFrameWindow *window,
80                 int x,
81                 int y,
82                 int w, 
83                 int h);
84         int selection_changed();
85         int handle_event();
86         int column_resize_event();
87         KeyFrameThread *thread;
88         KeyFrameWindow *window;
89 };
90 #endif
91
92 class KeyFramePresetsList : public BC_ListBox
93 {
94 public:
95         KeyFramePresetsList(KeyFrameThread *thread,
96                 KeyFrameWindow *window,
97                 int x,
98                 int y,
99                 int w, 
100                 int h);
101         int selection_changed();
102         int handle_event();
103         KeyFrameThread *thread;
104         KeyFrameWindow *window;
105 };
106
107 class KeyFramePresetsText : public BC_TextBox
108 {
109 public:
110         KeyFramePresetsText(KeyFrameThread *thread,
111                 KeyFrameWindow *window,
112                 int x,
113                 int y,
114                 int w);
115         int handle_event();
116         KeyFrameThread *thread;
117         KeyFrameWindow *window;
118 };
119
120
121 class KeyFramePresetsDelete : public BC_GenericButton
122 {
123 public:
124         KeyFramePresetsDelete(KeyFrameThread *thread,
125                 KeyFrameWindow *window,
126                 int x,
127                 int y);
128         int handle_event();
129         KeyFrameThread *thread;
130         KeyFrameWindow *window;
131 };
132
133 class KeyFramePresetsSave : public BC_GenericButton
134 {
135 public:
136         KeyFramePresetsSave(KeyFrameThread *thread,
137                 KeyFrameWindow *window,
138                 int x,
139                 int y);
140         int handle_event();
141         KeyFrameThread *thread;
142         KeyFrameWindow *window;
143 };
144
145 class KeyFramePresetsApply : public BC_GenericButton
146 {
147 public:
148         KeyFramePresetsApply(KeyFrameThread *thread,
149                 KeyFrameWindow *window,
150                 int x,
151                 int y);
152         int handle_event();
153         KeyFrameThread *thread;
154         KeyFrameWindow *window;
155 };
156
157 /*
158  * class KeyFrameText : public BC_TextBox
159  * {
160  * public:
161  *      KeyFrameText(KeyFrameThread *thread,
162  *              KeyFrameWindow *window,
163  *              int x,
164  *              int y,
165  *              int w);
166  *      int handle_event();
167  *      KeyFrameThread *thread;
168  *      KeyFrameWindow *window;
169  * };
170  */
171
172 #ifdef EDIT_KEYFRAME
173
174
175 class KeyFrameValue : public BC_TextBox
176 {
177 public:
178         KeyFrameValue(KeyFrameThread *thread,
179                 KeyFrameWindow *window,
180                 int x,
181                 int y,
182                 int w);
183         int handle_event();
184         KeyFrameThread *thread;
185         KeyFrameWindow *window;
186 };
187
188 class KeyFrameAll : public BC_CheckBox
189 {
190 public:
191         KeyFrameAll(KeyFrameThread *thread,
192                 KeyFrameWindow *window,
193                 int x,
194                 int y);
195         int handle_event();
196         KeyFrameThread *thread;
197         KeyFrameWindow *window;
198 };
199
200 #endif
201
202
203 class KeyFramePresetsOK : public BC_OKButton
204 {
205 public:
206         KeyFramePresetsOK(KeyFrameThread *thread,
207                 KeyFrameWindow *window);
208         int keypress_event();
209         KeyFrameThread *thread;
210         KeyFrameWindow *window;
211 };
212
213
214
215 class KeyFrameWindow : public BC_Window
216 {
217 public:
218         KeyFrameWindow(MWindow *mwindow,
219                 KeyFrameThread *thread,
220                 int x,
221                 int y,
222                 char *title);
223         void create_objects();
224         int resize_event(int w, int h);
225
226 #ifdef EDIT_KEYFRAME
227
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;
235 #endif
236         
237         KeyFramePresetsList *preset_list;
238         KeyFramePresetsText *preset_text;
239         KeyFramePresetsDelete *delete_preset;
240         KeyFramePresetsSave *save_preset;
241         KeyFramePresetsApply *apply_preset;
242
243 #ifdef EDIT_KEYFRAME
244
245         BC_Title *title1;
246 //      BC_Title *title2;
247         BC_Title *title3;
248 #endif
249
250         BC_Title *title4;
251         BC_Title *title5;
252
253         MWindow *mwindow;
254         KeyFrameThread *thread;
255 };
256
257
258
259
260 #endif
261
262
263
264
265