6b53f0c43ba0bb62e170ce05419c71ca74c5e6b5
[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  * Copyright (C) 2003-2016 Cinelerra CV contributors
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #ifndef NEW_H
24 #define NEW_H
25
26 #include "assets.inc"
27 #include "bcdialog.h"
28 #include "edl.inc"
29 #include "file.inc"
30 #include "filexml.inc"
31 #include "guicast.h"
32 #include "bchash.inc"
33 #include "formatpresets.h"
34 #include "mwindow.inc"
35
36 class NewThread;
37 class NewWindow;
38 class NewPresets;
39 class InterlacemodePulldown;
40 class ColormodelPulldown;
41
42 class New
43 {
44 public:
45         New(MWindow *mwindow);
46         ~New();
47
48         virtual void create_objects() = 0;
49         int handle_event();
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
58 class NewProject : public BC_MenuItem, public New
59 {
60 public:
61         NewProject(MWindow *mwindow);
62         ~NewProject();
63
64         void create_objects();
65         int handle_event() { return New::handle_event(); }
66 };
67
68 class AppendTracks : public BC_MenuItem, public New
69 {
70 public:
71         AppendTracks(MWindow *mwindow);
72         ~AppendTracks();
73
74         void create_objects();
75         int handle_event() { return New::handle_event(); }
76 };
77
78 class NewThread : public BC_DialogThread
79 {
80 public:
81         NewThread(MWindow *mwindow, New *new_project, const char *title, int load_mode);
82         ~NewThread();
83
84         BC_Window* new_gui();
85         void handle_done_event(int result);
86         void handle_close_event(int result);
87
88         int load_defaults();
89         int save_defaults();
90         int update_aspect();
91         int auto_aspect;
92         int auto_sizes;
93         NewWindow *nwindow;
94         MWindow *mwindow;
95         New *new_project;
96         const char *title;
97         int load_mode;
98 };
99
100 class NewWindow : public BC_Window
101 {
102 public:
103         NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y);
104         ~NewWindow();
105
106         void create_objects();
107         int update();
108
109         MWindow *mwindow;
110         NewThread *new_thread;
111         EDL *new_edl;
112         BC_TextBox *atracks;
113         BC_TextBox *achannels;
114         BC_TextBox *sample_rate;
115         BC_TextBox *vtracks;
116         BC_TextBox *vchannels;
117         BC_TextBox *frame_rate;
118         BC_TextBox *aspect_w_text, *aspect_h_text;
119         BC_TextBox *output_w_text, *output_h_text;
120         BC_TextBox *folder, *name;
121         BC_RecentList *recent_folder;
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 #endif