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
21 #ifndef __DVDCREATE_H__
22 #define __DVDCREATE_H__
24 #include "arraylist.h"
25 #include "batchrender.h"
26 #include "bcwindowbase.h"
29 #include "bclistboxitem.inc"
30 #include "bcmenuitem.h"
31 #include "bctextbox.h"
32 #include "browsebutton.h"
36 #include "dvdcreate.inc"
38 class CreateDVD_MenuItem : public BC_MenuItem
41 CreateDVD_MenuItem(MWindow *mwindow);
46 class DVD_BatchRenderJob : public BatchRenderJob
52 DVD_BatchRenderJob(Preferences *preferences,
53 int labeled, int farmed, int standard, int muxed);
54 void copy_from(DVD_BatchRenderJob *src);
55 DVD_BatchRenderJob *copy();
56 void load(FileXML *file);
57 void save(FileXML *file);
58 char *create_script(EDL *edl, ArrayList<Indexable *> *idxbls);
59 void create_chapter(double pos);
65 class CreateDVD_Thread : public BC_DialogThread
67 static const int64_t DVD_SIZE;
68 static const int DVD_STREAMS, DVD_WIDTH, DVD_HEIGHT;
69 static const double DVD_ASPECT_WIDTH, DVD_ASPECT_HEIGHT;
70 static const double DVD_WIDE_ASPECT_WIDTH, DVD_WIDE_ASPECT_HEIGHT;
71 static const int DVD_MAX_BITRATE, DVD_CHANNELS, DVD_WIDE_CHANNELS;
72 static const double DVD_FRAMERATE, DVD_SAMPLERATE, DVD_KAUDIO_RATE;
74 CreateDVD_Thread(MWindow *mwindow);
76 void handle_close_event(int result);
79 void create_chapter(FILE *fp, double pos);
80 static int create_dvd_script(BatchRenderJob *job);
81 int create_dvd_jobs(ArrayList<BatchRenderJob*> *jobs, const char *asset_path);
82 int insert_video_plugin(const char *title, KeyFrame *default_keyframe);
87 char asset_title[BCTEXTLEN];
88 char tmp_path[BCTEXTLEN];
89 int use_deinterlace, use_inverse_telecine;
90 int use_scale, use_resize_tracks;
91 int use_wide_audio, use_farmed;
92 int use_histogram, use_labeled;
93 int use_ffmpeg, use_standard;
98 double dvd_aspect_width;
99 double dvd_aspect_height;
100 double dvd_framerate;
103 double dvd_kaudio_rate;
107 class CreateDVD_OK : public BC_OKButton
110 CreateDVD_OK(CreateDVD_GUI *gui, int x, int y);
112 int button_press_event();
113 int keypress_event();
118 class CreateDVD_Cancel : public BC_CancelButton
121 CreateDVD_Cancel(CreateDVD_GUI *gui, int x, int y);
123 int button_press_event();
129 class CreateDVD_DiskSpace : public BC_Title
132 CreateDVD_DiskSpace(CreateDVD_GUI *gui, int x, int y);
133 ~CreateDVD_DiskSpace();
134 int64_t tmp_path_space();
140 class CreateDVD_TmpPath : public BC_TextBox
143 CreateDVD_TmpPath(CreateDVD_GUI *gui, int x, int y, int w);
144 ~CreateDVD_TmpPath();
151 class CreateDVD_AssetTitle : public BC_TextBox
154 CreateDVD_AssetTitle(CreateDVD_GUI *gui, int x, int y, int w);
155 ~CreateDVD_AssetTitle();
161 class CreateDVD_Deinterlace : public BC_CheckBox
164 CreateDVD_Deinterlace(CreateDVD_GUI *gui, int x, int y);
165 ~CreateDVD_Deinterlace();
171 class CreateDVD_InverseTelecine : public BC_CheckBox
174 CreateDVD_InverseTelecine(CreateDVD_GUI *gui, int x, int y);
175 ~CreateDVD_InverseTelecine();
181 class CreateDVD_ResizeTracks : public BC_CheckBox
184 CreateDVD_ResizeTracks(CreateDVD_GUI *gui, int x, int y);
185 ~CreateDVD_ResizeTracks();
190 class CreateDVD_Histogram : public BC_CheckBox
193 CreateDVD_Histogram(CreateDVD_GUI *gui, int x, int y);
194 ~CreateDVD_Histogram();
199 class CreateDVD_LabelChapters : public BC_CheckBox
202 CreateDVD_LabelChapters(CreateDVD_GUI *gui, int x, int y);
203 ~CreateDVD_LabelChapters();
208 class CreateDVD_UseRenderFarm : public BC_CheckBox
211 CreateDVD_UseRenderFarm(CreateDVD_GUI *gui, int x, int y);
212 ~CreateDVD_UseRenderFarm();
217 class CreateDVD_WideAudio : public BC_CheckBox
220 CreateDVD_WideAudio(CreateDVD_GUI *gui, int x, int y);
221 ~CreateDVD_WideAudio();
226 class CreateDVD_UseFFMpeg : public BC_CheckBox
229 CreateDVD_UseFFMpeg(CreateDVD_GUI *gui, int x, int y);
230 ~CreateDVD_UseFFMpeg();
235 class CreateDVD_GUI : public BC_Window
238 CreateDVD_GUI(CreateDVD_Thread *thread,
239 int x, int y, int w, int h);
242 void create_objects();
243 int resize_event(int w, int h);
244 int translation_event();
248 CreateDVD_Thread *thread;
250 CreateDVD_AssetTitle *asset_title;
252 CreateDVD_TmpPath *tmp_path;
253 BrowseButton *btmp_path;
254 CreateDVD_DiskSpace *disk_space;
255 CreateDVD_Format *standard;
256 CreateDVD_Scale *scale;
257 ArrayList<BC_ListBoxItem *> media_sizes;
258 CreateDVD_MediaSize *media_size;
259 CreateDVD_Deinterlace *need_deinterlace;
260 CreateDVD_InverseTelecine *need_inverse_telecine;
261 CreateDVD_UseFFMpeg *need_use_ffmpeg;
262 CreateDVD_ResizeTracks *need_resize_tracks;
263 CreateDVD_Histogram *need_histogram;
264 CreateDVD_WideAudio *need_wide_audio;
265 CreateDVD_LabelChapters *need_labeled;
266 CreateDVD_UseRenderFarm *need_farmed;
267 int ok_x, ok_y, ok_w, ok_h;
269 int cancel_x, cancel_y, cancel_w, cancel_h;
270 CreateDVD_Cancel *cancel;
273 class CreateDVD_FormatItem : public BC_MenuItem
277 CreateDVD_FormatItem(CreateDVD_Format *popup, int standard, const char *text);
278 ~CreateDVD_FormatItem();
280 CreateDVD_Format *popup;
284 class CreateDVD_Format : public BC_PopupMenu
287 void create_objects();
289 CreateDVD_Format(CreateDVD_GUI *gui, int x, int y);
291 void set_value(int v) { set_text(get_item(v)->get_text()); }
296 class CreateDVD_ScaleItem : public BC_MenuItem
300 CreateDVD_ScaleItem(CreateDVD_Scale *popup, int scale, const char *text);
301 ~CreateDVD_ScaleItem();
303 CreateDVD_Scale *popup;
307 class CreateDVD_Scale : public BC_PopupMenu
310 void create_objects();
312 CreateDVD_Scale(CreateDVD_GUI *gui, int x, int y);
316 void set_value(int v) { set_text(Rescale::scale_types[v]); }
319 class CreateDVD_MediaSize : public BC_PopupTextBox
322 CreateDVD_MediaSize(CreateDVD_GUI *gui, int x, int y);
323 ~CreateDVD_MediaSize();