c56dd4f6a5092731ff0b190316d58fe93285999b
[goodguy/history.git] / cinelerra-5.1 / cinelerra / new.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 NEW_H
23 #define NEW_H
24
25 #include "assets.inc"
26 #include "bcdialog.h"
27 #include "edl.inc"
28 #include "file.inc"
29 #include "filexml.inc"
30 #include "guicast.h"
31 #include "bchash.inc"
32 #include "formatpresets.h"
33 #include "mwindow.inc"
34
35 class NewThread;
36 class NewWindow;
37 class NewPresets;
38 class InterlacemodePulldown;
39 class ColormodelPulldown;
40
41 class New
42 {
43 public:
44         New(MWindow *mwindow);
45         ~New();
46
47         virtual void create_objects() = 0;
48         int handle_event();
49         int run_script(FileXML *script);
50         int create_new_project(int load_mode);
51         void create_new_edl();
52
53         MWindow *mwindow;
54         NewThread *thread;
55         EDL *new_edl;
56
57 private:
58         FileXML *script;
59 };
60
61 class NewProject : public BC_MenuItem, public New
62 {
63 public:
64         NewProject(MWindow *mwindow);
65         ~NewProject();
66
67         void create_objects();
68         int handle_event() { return New::handle_event(); }
69 };
70
71 class AppendTracks : public BC_MenuItem, public New
72 {
73 public:
74         AppendTracks(MWindow *mwindow);
75         ~AppendTracks();
76
77         void create_objects();
78         int handle_event() { return New::handle_event(); }
79 };
80
81 class NewThread : public BC_DialogThread
82 {
83 public:
84         NewThread(MWindow *mwindow, New *new_project, const char *title, int load_mode);
85         ~NewThread();
86
87         BC_Window* new_gui();
88         void handle_close_event(int result);
89
90         int load_defaults();
91         int save_defaults();
92         int update_aspect();
93         int auto_aspect;
94         int auto_sizes;
95         NewWindow *nwindow;
96         MWindow *mwindow;
97         New *new_project;
98         const char *title;
99         int load_mode;
100 };
101
102 class NewWindow : public BC_Window
103 {
104 public:
105         NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y);
106         ~NewWindow();
107
108         void create_objects();
109         int update();
110
111         MWindow *mwindow;
112         NewThread *new_thread;
113         EDL *new_edl;
114         BC_TextBox *atracks;
115         BC_TextBox *achannels;
116         BC_TextBox *sample_rate;
117         BC_TextBox *vtracks;
118         BC_TextBox *vchannels;
119         BC_TextBox *frame_rate;
120         BC_TextBox *aspect_w_text, *aspect_h_text;
121         BC_TextBox *output_w_text, *output_h_text;
122         InterlacemodePulldown *interlace_pulldown;
123         ColormodelPulldown *color_model;
124         NewPresets *format_presets;
125 };
126
127 class NewPresets : public FormatPresets
128 {
129 public:
130         NewPresets(MWindow *mwindow, NewWindow *gui, int x, int y);
131         ~NewPresets();
132         int handle_event();
133         EDL* get_edl();
134 };
135
136
137 class NewSwapExtents : public BC_Button
138 {
139 public:
140         NewSwapExtents(MWindow *mwindow, NewWindow *gui, int x, int y);
141         int handle_event();
142         MWindow *mwindow;
143         NewWindow *gui;
144 };
145
146
147
148 class NewATracks : public BC_TextBox
149 {
150 public:
151         NewATracks(NewWindow *nwindow, const char *text, int x, int y);
152         int handle_event();
153         NewWindow *nwindow;
154 };
155
156 class NewATracksTumbler : public BC_Tumbler
157 {
158 public:
159         NewATracksTumbler(NewWindow *nwindow, int x, int y);
160         int handle_up_event();
161         int handle_down_event();
162         NewWindow *nwindow;
163 };
164
165 class NewAChannels : public BC_TextBox
166 {
167 public:
168         NewAChannels(NewWindow *nwindow, const char *text, int x, int y);
169         int handle_event();
170         NewWindow *nwindow;
171 };
172
173 class NewAChannelsTumbler : public BC_Tumbler
174 {
175 public:
176         NewAChannelsTumbler(NewWindow *nwindow, int x, int y);
177         int handle_up_event();
178         int handle_down_event();
179         NewWindow *nwindow;
180 };
181
182 class NewSampleRate : public BC_TextBox
183 {
184 public:
185         NewSampleRate(NewWindow *nwindow, const char *text, int x, int y);
186         int handle_event();
187         NewWindow *nwindow;
188 };
189
190
191 class SampleRatePulldown : public BC_ListBox
192 {
193 public:
194         SampleRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y);
195         int handle_event();
196         MWindow *mwindow;
197         BC_TextBox *output;
198 };
199
200
201
202
203
204
205
206
207 class NewVTracks : public BC_TextBox
208 {
209 public:
210         NewVTracks(NewWindow *nwindow, const char *text, int x, int y);
211         int handle_event();
212         NewWindow *nwindow;
213 };
214
215 class NewVTracksTumbler : public BC_Tumbler
216 {
217 public:
218         NewVTracksTumbler(NewWindow *nwindow, int x, int y);
219         int handle_up_event();
220         int handle_down_event();
221         NewWindow *nwindow;
222 };
223
224 class NewVChannels : public BC_TextBox
225 {
226 public:
227         NewVChannels(NewWindow *nwindow, const char *text, int x, int y);
228         int handle_event();
229         NewWindow *nwindow;
230 };
231
232 class NewVChannelsTumbler : public BC_Tumbler
233 {
234 public:
235         NewVChannelsTumbler(NewWindow *nwindow, int x, int y);
236         int handle_up_event();
237         int handle_down_event();
238         NewWindow *nwindow;
239 };
240
241 class NewFrameRate : public BC_TextBox
242 {
243 public:
244         NewFrameRate(NewWindow *nwindow, const char *text, int x, int y);
245         int handle_event();
246         NewWindow *nwindow;
247 };
248
249 class FrameRatePulldown : public BC_ListBox
250 {
251 public:
252         FrameRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y);
253         int handle_event();
254         MWindow *mwindow;
255         BC_TextBox *output;
256 };
257
258 class NewTrackW : public BC_TextBox
259 {
260 public:
261         NewTrackW(NewWindow *nwindow, int x, int y);
262         int handle_event();
263         NewWindow *nwindow;
264 };
265
266 class NewTrackH : public BC_TextBox
267 {
268 public:
269         NewTrackH(NewWindow *nwindow, int x, int y);
270         int handle_event();
271         NewWindow *nwindow;
272 };
273
274 class FrameSizePulldown : public BC_ListBox
275 {
276 public:
277         FrameSizePulldown(Theme *theme,
278                 BC_TextBox *output_w,
279                 BC_TextBox *output_h,
280                 int x,
281                 int y);
282         int handle_event();
283         Theme *theme;
284         BC_TextBox *output_w;
285         BC_TextBox *output_h;
286 };
287
288 class NewOutputW : public BC_TextBox
289 {
290 public:
291         NewOutputW(NewWindow *nwindow, int x, int y);
292         int handle_event();
293         NewWindow *nwindow;
294 };
295
296 class NewOutputH : public BC_TextBox
297 {
298 public:
299         NewOutputH(NewWindow *nwindow, int x, int y);
300         int handle_event();
301         NewWindow *nwindow;
302 };
303
304 class NewAspectAuto : public BC_CheckBox
305 {
306 public:
307         NewAspectAuto(NewWindow *nwindow, int x, int y);
308         ~NewAspectAuto();
309         int handle_event();
310         NewWindow *nwindow;
311 };
312
313 class NewAspectW : public BC_TextBox
314 {
315 public:
316         NewAspectW(NewWindow *nwindow, const char *text, int x, int y);
317         int handle_event();
318         NewWindow *nwindow;
319 };
320
321 class NewAspectH : public BC_TextBox
322 {
323 public:
324         NewAspectH(NewWindow *nwindow, const char *text, int x, int y);
325         int handle_event();
326         NewWindow *nwindow;
327 };
328
329 class AspectPulldown : public BC_ListBox
330 {
331 public:
332         AspectPulldown(MWindow *mwindow,
333                 BC_TextBox *output_w,
334                 BC_TextBox *output_h,
335                 int x,
336                 int y);
337         int handle_event();
338         MWindow *mwindow;
339         BC_TextBox *output_w;
340         BC_TextBox *output_h;
341 };
342
343 class ColormodelItem : public BC_ListBoxItem
344 {
345 public:
346         ColormodelItem(const char *text, int value);
347         int value;
348 };
349
350 class ColormodelPulldown : public BC_ListBox
351 {
352 public:
353         ColormodelPulldown(MWindow *mwindow,
354                 BC_TextBox *output_text,
355                 int *output_value,
356                 int x,
357                 int y);
358         int handle_event();
359         const char* colormodel_to_text();
360         void update_value(int value);
361         MWindow *mwindow;
362         BC_TextBox *output_text;
363         int *output_value;
364 };
365
366 class InterlacemodeItem : public BC_ListBoxItem
367 {
368 public:
369         InterlacemodeItem(const char *text, int value);
370         int value;
371 };
372
373 class InterlacemodePulldown : public BC_ListBox
374 {
375 public:
376         InterlacemodePulldown(MWindow *mwindow,
377                                 BC_TextBox *output_text,
378                                 int *output_value,
379                                 ArrayList<BC_ListBoxItem*> *data,
380                                 int x,
381                                 int y);
382         int handle_event();
383         const char* interlacemode_to_text();
384         int update(int value);
385         MWindow *mwindow;
386         BC_TextBox *output_text;
387         int *output_value;
388 private:
389         char string[BCTEXTLEN];
390 };
391
392 class InterlacefixmethodItem : public BC_ListBoxItem
393 {
394 public:
395         InterlacefixmethodItem(const char *text, int value);
396         int value;
397 };
398
399 class InterlacefixmethodPulldown : public BC_ListBox
400 {
401 public:
402         InterlacefixmethodPulldown(MWindow *mwindow,
403                                    BC_TextBox *output_text,
404                                    int *output_value,
405                                    ArrayList<BC_ListBoxItem*> *data,
406                                    int x,
407                                    int y);
408         int handle_event();
409         const char* interlacefixmethod_to_text();
410         MWindow *mwindow;
411         BC_TextBox *output_text;
412         int *output_value;
413 private:
414         char string[BCTEXTLEN];
415 };
416
417
418 #endif