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