Credit Andrew R for finding the direct copy mods for exr and ppm sequences
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / dvdcreate.h
1 #ifndef __DVDCREATE_H__
2 #define __DVDCREATE_H__
3
4 #include "arraylist.h"
5 #include "batchrender.h"
6 #include "bcwindowbase.h"
7 #include "bcbutton.h"
8 #include "bcdialog.h"
9 #include "bclistboxitem.inc"
10 #include "bcmenuitem.h"
11 #include "bctextbox.h"
12 #include "browsebutton.h"
13 #include "mwindow.h"
14 #include "rescale.h"
15
16 #include "dvdcreate.inc"
17
18 class CreateDVD_MenuItem : public BC_MenuItem
19 {
20 public:
21         CreateDVD_MenuItem(MWindow *mwindow);
22         int handle_event();
23         MWindow *mwindow;
24 };
25
26 class DVD_BatchRenderJob : public BatchRenderJob
27 {
28         int chapter;
29         FILE *fp;
30         EDL *edl;
31 public:
32         DVD_BatchRenderJob(Preferences *preferences,
33                 int labeled, int farmed, int standard, int muxed);
34         void copy_from(DVD_BatchRenderJob *src);
35         DVD_BatchRenderJob *copy();
36         void load(FileXML *file);
37         void save(FileXML *file);
38         char *create_script(EDL *edl, ArrayList<Indexable *> *idxbls);
39         void create_chapter(double pos);
40
41         int standard;
42         int muxed;
43 };
44
45 class CreateDVD_Thread : public BC_DialogThread
46 {
47         static const int64_t DVD_SIZE;
48         static const int DVD_STREAMS, DVD_WIDTH, DVD_HEIGHT;
49         static const double DVD_ASPECT_WIDTH, DVD_ASPECT_HEIGHT;
50         static const double DVD_WIDE_ASPECT_WIDTH, DVD_WIDE_ASPECT_HEIGHT;
51         static const int DVD_MAX_BITRATE, DVD_CHANNELS, DVD_WIDE_CHANNELS;
52         static const double DVD_FRAMERATE, DVD_SAMPLERATE, DVD_KAUDIO_RATE;
53 public:
54         CreateDVD_Thread(MWindow *mwindow);
55         ~CreateDVD_Thread();
56         void handle_close_event(int result);
57         BC_Window* new_gui();
58         int option_presets();
59         void create_chapter(FILE *fp, double pos);
60         static int create_dvd_script(BatchRenderJob *job);
61         int create_dvd_jobs(ArrayList<BatchRenderJob*> *jobs, const char *asset_path);
62         int insert_video_plugin(const char *title, KeyFrame *default_keyframe);
63         int resize_tracks();
64
65         MWindow *mwindow;
66         CreateDVD_GUI *gui;
67         char asset_title[BCTEXTLEN];
68         char tmp_path[BCTEXTLEN];
69         int use_deinterlace, use_inverse_telecine;
70         int use_scale, use_resize_tracks;
71         int use_wide_audio, use_farmed;
72         int use_histogram, use_labeled;
73         int use_ffmpeg, use_standard;
74
75         int64_t dvd_size;
76         int dvd_width;
77         int dvd_height;
78         double dvd_aspect_width;
79         double dvd_aspect_height;
80         double dvd_framerate;
81         int dvd_samplerate;
82         int dvd_max_bitrate;
83         double dvd_kaudio_rate;
84         int max_w, max_h;
85 };
86
87 class CreateDVD_OK : public BC_OKButton
88 {
89 public:
90         CreateDVD_OK(CreateDVD_GUI *gui, int x, int y);
91         ~CreateDVD_OK();
92         int button_press_event();
93         int keypress_event();
94
95         CreateDVD_GUI *gui;
96 };
97
98 class CreateDVD_Cancel : public BC_CancelButton
99 {
100 public:
101         CreateDVD_Cancel(CreateDVD_GUI *gui, int x, int y);
102         ~CreateDVD_Cancel();
103         int button_press_event();
104
105         CreateDVD_GUI *gui;
106 };
107
108
109 class CreateDVD_DiskSpace : public BC_Title
110 {
111 public:
112         CreateDVD_DiskSpace(CreateDVD_GUI *gui, int x, int y);
113         ~CreateDVD_DiskSpace();
114         int64_t tmp_path_space();
115         void update();
116
117         CreateDVD_GUI *gui;
118 };
119
120 class CreateDVD_TmpPath : public BC_TextBox
121 {
122 public:
123         CreateDVD_TmpPath(CreateDVD_GUI *gui, int x, int y, int w);
124         ~CreateDVD_TmpPath();
125         int handle_event();
126
127         CreateDVD_GUI *gui;
128 };
129
130
131 class CreateDVD_AssetTitle : public BC_TextBox
132 {
133 public:
134         CreateDVD_AssetTitle(CreateDVD_GUI *gui, int x, int y, int w);
135         ~CreateDVD_AssetTitle();
136         int handle_event();
137
138         CreateDVD_GUI *gui;
139 };
140
141 class CreateDVD_Deinterlace : public BC_CheckBox
142 {
143 public:
144         CreateDVD_Deinterlace(CreateDVD_GUI *gui, int x, int y);
145         ~CreateDVD_Deinterlace();
146         int handle_event();
147
148         CreateDVD_GUI *gui;
149 };
150
151 class CreateDVD_InverseTelecine : public BC_CheckBox
152 {
153 public:
154         CreateDVD_InverseTelecine(CreateDVD_GUI *gui, int x, int y);
155         ~CreateDVD_InverseTelecine();
156         int handle_event();
157
158         CreateDVD_GUI *gui;
159 };
160
161 class CreateDVD_ResizeTracks : public BC_CheckBox
162 {
163 public:
164         CreateDVD_ResizeTracks(CreateDVD_GUI *gui, int x, int y);
165         ~CreateDVD_ResizeTracks();
166
167         CreateDVD_GUI *gui;
168 };
169
170 class CreateDVD_Histogram : public BC_CheckBox
171 {
172 public:
173         CreateDVD_Histogram(CreateDVD_GUI *gui, int x, int y);
174         ~CreateDVD_Histogram();
175
176         CreateDVD_GUI *gui;
177 };
178
179 class CreateDVD_LabelChapters : public BC_CheckBox
180 {
181 public:
182         CreateDVD_LabelChapters(CreateDVD_GUI *gui, int x, int y);
183         ~CreateDVD_LabelChapters();
184
185         CreateDVD_GUI *gui;
186 };
187
188 class CreateDVD_UseRenderFarm : public BC_CheckBox
189 {
190 public:
191         CreateDVD_UseRenderFarm(CreateDVD_GUI *gui, int x, int y);
192         ~CreateDVD_UseRenderFarm();
193
194         CreateDVD_GUI *gui;
195 };
196
197 class CreateDVD_WideAudio : public BC_CheckBox
198 {
199 public:
200         CreateDVD_WideAudio(CreateDVD_GUI *gui, int x, int y);
201         ~CreateDVD_WideAudio();
202
203         CreateDVD_GUI *gui;
204 };
205
206 class CreateDVD_UseFFMpeg : public BC_CheckBox
207 {
208 public:
209         CreateDVD_UseFFMpeg(CreateDVD_GUI *gui, int x, int y);
210         ~CreateDVD_UseFFMpeg();
211
212         CreateDVD_GUI *gui;
213 };
214
215 class CreateDVD_GUI : public BC_Window
216 {
217 public:
218         CreateDVD_GUI(CreateDVD_Thread *thread,
219                 int x, int y, int w, int h);
220         ~CreateDVD_GUI();
221
222         void create_objects();
223         int resize_event(int w, int h);
224         int translation_event();
225         int close_event();
226         void update();
227
228         CreateDVD_Thread *thread;
229         int at_x, at_y;
230         CreateDVD_AssetTitle *asset_title;
231         int tmp_x, tmp_y;
232         CreateDVD_TmpPath *tmp_path;
233         BrowseButton *btmp_path;
234         CreateDVD_DiskSpace *disk_space;
235         CreateDVD_Format *standard;
236         CreateDVD_Scale *scale;
237         ArrayList<BC_ListBoxItem *> media_sizes;
238         CreateDVD_MediaSize *media_size;
239         CreateDVD_Deinterlace *need_deinterlace;
240         CreateDVD_InverseTelecine *need_inverse_telecine;
241         CreateDVD_UseFFMpeg *need_use_ffmpeg;
242         CreateDVD_ResizeTracks *need_resize_tracks;
243         CreateDVD_Histogram *need_histogram;
244         CreateDVD_WideAudio *need_wide_audio;
245         CreateDVD_LabelChapters *need_labeled;
246         CreateDVD_UseRenderFarm *need_farmed;
247         int ok_x, ok_y, ok_w, ok_h;
248         CreateDVD_OK *ok;
249         int cancel_x, cancel_y, cancel_w, cancel_h;
250         CreateDVD_Cancel *cancel;
251 };
252
253 class CreateDVD_FormatItem : public BC_MenuItem
254 {
255 public:
256         int handle_event();
257         CreateDVD_FormatItem(CreateDVD_Format *popup, int standard, const char *text);
258         ~CreateDVD_FormatItem();
259
260         CreateDVD_Format *popup;
261         int standard;
262 };
263
264 class CreateDVD_Format : public BC_PopupMenu
265 {
266 public:
267         void create_objects();
268         int handle_event();
269         CreateDVD_Format(CreateDVD_GUI *gui, int x, int y);
270         ~CreateDVD_Format();
271         void set_value(int v) { set_text(get_item(v)->get_text()); }
272
273         CreateDVD_GUI *gui;
274 };
275
276 class CreateDVD_ScaleItem : public BC_MenuItem
277 {
278 public:
279         int handle_event();
280         CreateDVD_ScaleItem(CreateDVD_Scale *popup, int scale, const char *text);
281         ~CreateDVD_ScaleItem();
282
283         CreateDVD_Scale *popup;
284         int scale;
285 };
286
287 class CreateDVD_Scale : public BC_PopupMenu
288 {
289 public:
290         void create_objects();
291         int handle_event();
292         CreateDVD_Scale(CreateDVD_GUI *gui, int x, int y);
293         ~CreateDVD_Scale();
294
295         CreateDVD_GUI *gui;
296         void set_value(int v) { set_text(Rescale::scale_types[v]); }
297 };
298
299 class CreateDVD_MediaSize : public BC_PopupTextBox
300 {
301 public:
302         CreateDVD_MediaSize(CreateDVD_GUI *gui, int x, int y);
303         ~CreateDVD_MediaSize();
304         int handle_event();
305
306         CreateDVD_GUI *gui;
307 };
308
309 #endif