3 * Copyright (C) 2016-2020 William Morrow
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 #ifndef __BDCREATE_H__
23 #define __BDCREATE_H__
25 #include "arraylist.h"
26 #include "batchrender.h"
27 #include "bcwindowbase.h"
30 #include "bclistboxitem.inc"
31 #include "bcmenuitem.h"
32 #include "bctextbox.h"
33 #include "browsebutton.h"
37 #include "bdcreate.inc"
40 class CreateBD_MenuItem : public BC_MenuItem
43 CreateBD_MenuItem(MWindow *mwindow);
48 class BD_BatchRenderJob : public BatchRenderJob
51 static int get_udfs_mount(char *udfs, char *mopts, char *mntpt);
52 BD_BatchRenderJob(Preferences *preferences, int labeled, int farmed);
53 char *create_script(EDL *edl, ArrayList<Indexable *> *idxbls);
58 class CreateBD_Thread : public BC_DialogThread
60 static const int64_t BD_SIZE;
61 static const int BD_STREAMS, BD_WIDTH, BD_HEIGHT;
62 static const double BD_ASPECT_WIDTH, BD_ASPECT_HEIGHT;
63 static const double BD_WIDE_ASPECT_WIDTH, BD_WIDE_ASPECT_HEIGHT;
64 static const int BD_MAX_BITRATE, BD_CHANNELS, BD_WIDE_CHANNELS;
65 static const double BD_FRAMERATE, BD_SAMPLERATE, BD_KAUDIO_RATE;
66 static const int BD_INTERLACE_MODE;
68 CreateBD_Thread(MWindow *mwindow);
70 void handle_close_event(int result);
73 int create_bd_script(const char *path, EDL *edl);
74 int create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char *asset_dir);
75 int insert_video_plugin(const char *title, KeyFrame *default_keyframe);
80 char asset_title[BCTEXTLEN];
81 char tmp_path[BCTEXTLEN];
82 char use_profile[BCTEXTLEN];
83 int use_deinterlace, use_inverse_telecine;
84 int use_scale, use_resize_tracks;
85 int use_wide_audio, use_farmed;
86 int use_histogram, use_labeled;
93 double bd_aspect_width;
94 double bd_aspect_height;
98 double bd_kaudio_rate;
99 int bd_interlace_mode;
102 BD_BatchRenderJob *batchrender;
105 class CreateBD_OK : public BC_OKButton
108 CreateBD_OK(CreateBD_GUI *gui, int x, int y);
110 int button_press_event();
111 int keypress_event();
116 class CreateBD_Cancel : public BC_CancelButton
119 CreateBD_Cancel(CreateBD_GUI *gui, int x, int y);
121 int button_press_event();
127 class CreateBD_DiskSpace : public BC_Title
130 CreateBD_DiskSpace(CreateBD_GUI *gui, int x, int y);
131 ~CreateBD_DiskSpace();
132 int64_t tmp_path_space();
138 class CreateBD_TmpPath : public BC_TextBox
141 CreateBD_TmpPath(CreateBD_GUI *gui, int x, int y, int w);
149 class CreateBD_AssetTitle : public BC_TextBox
152 CreateBD_AssetTitle(CreateBD_GUI *gui, int x, int y, int w);
153 ~CreateBD_AssetTitle();
159 class CreateBD_Deinterlace : public BC_CheckBox
162 CreateBD_Deinterlace(CreateBD_GUI *gui, int x, int y);
163 ~CreateBD_Deinterlace();
169 class CreateBD_InverseTelecine : public BC_CheckBox
172 CreateBD_InverseTelecine(CreateBD_GUI *gui, int x, int y);
173 ~CreateBD_InverseTelecine();
179 class CreateBD_ResizeTracks : public BC_CheckBox
182 CreateBD_ResizeTracks(CreateBD_GUI *gui, int x, int y);
183 ~CreateBD_ResizeTracks();
188 class CreateBD_Histogram : public BC_CheckBox
191 CreateBD_Histogram(CreateBD_GUI *gui, int x, int y);
192 ~CreateBD_Histogram();
197 class CreateBD_LabelChapters : public BC_CheckBox
200 CreateBD_LabelChapters(CreateBD_GUI *gui, int x, int y);
201 ~CreateBD_LabelChapters();
206 class CreateBD_UseRenderFarm : public BC_CheckBox
209 CreateBD_UseRenderFarm(CreateBD_GUI *gui, int x, int y);
210 ~CreateBD_UseRenderFarm();
216 class CreateBD_WideAudio : public BC_CheckBox
219 CreateBD_WideAudio(CreateBD_GUI *gui, int x, int y);
220 ~CreateBD_WideAudio();
226 class CreateBD_UseTsmuxer : public BC_CheckBox
229 CreateBD_UseTsmuxer(CreateBD_GUI *gui, int x, int y);
230 ~CreateBD_UseTsmuxer();
236 class CreateBD_GUI : public BC_Window
239 CreateBD_GUI(CreateBD_Thread *thread,
240 int x, int y, int w, int h);
243 void create_objects();
244 int resize_event(int w, int h);
245 int translation_event();
249 CreateBD_Thread *thread;
251 CreateBD_AssetTitle *asset_title;
253 CreateBD_TmpPath *tmp_path;
254 BrowseButton *btmp_path;
255 CreateBD_DiskSpace *disk_space;
256 CreateBD_Format *standard;
257 CreateBD_Scale *scale;
258 ArrayList<BC_ListBoxItem *> media_sizes;
259 CreateBD_MediaSize *media_size;
260 CreateBD_Deinterlace *need_deinterlace;
261 CreateBD_InverseTelecine *need_inverse_telecine;
262 CreateBD_ResizeTracks *need_resize_tracks;
263 CreateBD_Histogram *need_histogram;
264 CreateBD_UseTsmuxer *need_tsmuxer;
265 BC_Title *non_standard;
266 CreateBD_WideAudio *need_wide_audio;
267 CreateBD_LabelChapters *need_labeled;
268 CreateBD_UseRenderFarm *need_farmed;
269 int ok_x, ok_y, ok_w, ok_h;
271 int cancel_x, cancel_y, cancel_w, cancel_h;
272 CreateBD_Cancel *cancel;
273 ArrayList<BC_ListBoxItem *> profiles;
274 CreateBD_Profile *profile;
277 class CreateBD_FormatItem : public BC_MenuItem
281 CreateBD_FormatItem(CreateBD_Format *popup, int standard, const char *name);
282 ~CreateBD_FormatItem();
284 CreateBD_Format *popup;
288 class CreateBD_Format : public BC_PopupMenu
291 void create_objects();
293 CreateBD_Format(CreateBD_GUI *gui, int x, int y);
295 void set_value(int v) { set_text(get_item(v)->get_text()); }
300 class CreateBD_ScaleItem : public BC_MenuItem
304 CreateBD_ScaleItem(CreateBD_Scale *popup, int scale, const char *text);
305 ~CreateBD_ScaleItem();
307 CreateBD_Scale *popup;
311 class CreateBD_Scale : public BC_PopupMenu
314 void create_objects();
316 CreateBD_Scale(CreateBD_GUI *gui, int x, int y);
320 void set_value(int v) { set_text(Rescale::scale_types[v]); }
323 class CreateBD_MediaSize : public BC_PopupTextBox
326 CreateBD_MediaSize(CreateBD_GUI *gui, int x, int y);
327 ~CreateBD_MediaSize();
333 class CreateBD_Profile : public BC_PopupTextBox
336 CreateBD_Profile(CreateBD_GUI *gui, int x, int y);