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