Credit Andrew - improve in-tree documentation
[goodguy/cinelerra.git] / 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
27 class CreateDVD_Thread : public BC_DialogThread
28 {
29         static const int64_t DVD_SIZE;
30         static const int DVD_STREAMS, DVD_WIDTH, DVD_HEIGHT;
31         static const double DVD_ASPECT_WIDTH, DVD_ASPECT_HEIGHT;
32         static const double DVD_WIDE_ASPECT_WIDTH, DVD_WIDE_ASPECT_HEIGHT;
33         static const int DVD_MAX_BITRATE, DVD_CHANNELS, DVD_WIDE_CHANNELS;
34         static const double DVD_FRAMERATE, DVD_SAMPLERATE, DVD_KAUDIO_RATE;
35 public:
36         CreateDVD_Thread(MWindow *mwindow);
37         ~CreateDVD_Thread();
38         void handle_close_event(int result);
39         BC_Window* new_gui();
40         int option_presets();
41         int create_dvd_jobs(ArrayList<BatchRenderJob*> *jobs, const char *asset_path);
42         int insert_video_plugin(const char *title, KeyFrame *default_keyframe);
43         int resize_tracks();
44
45         MWindow *mwindow;
46         CreateDVD_GUI *gui;
47         char asset_title[BCTEXTLEN];
48         char tmp_path[BCTEXTLEN];
49         int use_deinterlace, use_inverse_telecine;
50         int use_scale, use_resize_tracks;
51         int use_wide_audio;
52         int use_histogram, use_label_chapters;
53         int use_ffmpeg, use_standard;
54
55         int64_t dvd_size;
56         int dvd_width;
57         int dvd_height;
58         double dvd_aspect_width;
59         double dvd_aspect_height;
60         double dvd_framerate;
61         int dvd_samplerate;
62         int dvd_max_bitrate;
63         double dvd_kaudio_rate;
64         int max_w, max_h;
65 };
66
67 class CreateDVD_OK : public BC_OKButton
68 {
69 public:
70         CreateDVD_OK(CreateDVD_GUI *gui, int x, int y);
71         ~CreateDVD_OK();
72         int button_press_event();
73         int keypress_event();
74
75         CreateDVD_GUI *gui;
76 };
77
78 class CreateDVD_Cancel : public BC_CancelButton
79 {
80 public:
81         CreateDVD_Cancel(CreateDVD_GUI *gui, int x, int y);
82         ~CreateDVD_Cancel();
83         int button_press_event();
84
85         CreateDVD_GUI *gui;
86 };
87
88
89 class CreateDVD_DiskSpace : public BC_Title
90 {
91 public:
92         CreateDVD_DiskSpace(CreateDVD_GUI *gui, int x, int y);
93         ~CreateDVD_DiskSpace();
94         int64_t tmp_path_space();
95         void update();
96
97         CreateDVD_GUI *gui;
98 };
99
100 class CreateDVD_TmpPath : public BC_TextBox
101 {
102 public:
103         CreateDVD_TmpPath(CreateDVD_GUI *gui, int x, int y, int w);
104         ~CreateDVD_TmpPath();
105         int handle_event();
106
107         CreateDVD_GUI *gui;
108 };
109
110
111 class CreateDVD_AssetTitle : public BC_TextBox
112 {
113 public:
114         CreateDVD_AssetTitle(CreateDVD_GUI *gui, int x, int y, int w);
115         ~CreateDVD_AssetTitle();
116         int handle_event();
117
118         CreateDVD_GUI *gui;
119 };
120
121 class CreateDVD_Deinterlace : public BC_CheckBox
122 {
123 public:
124         CreateDVD_Deinterlace(CreateDVD_GUI *gui, int x, int y);
125         ~CreateDVD_Deinterlace();
126         int handle_event();
127
128         CreateDVD_GUI *gui;
129 };
130
131 class CreateDVD_InverseTelecine : public BC_CheckBox
132 {
133 public:
134         CreateDVD_InverseTelecine(CreateDVD_GUI *gui, int x, int y);
135         ~CreateDVD_InverseTelecine();
136         int handle_event();
137
138         CreateDVD_GUI *gui;
139 };
140
141 class CreateDVD_ResizeTracks : public BC_CheckBox
142 {
143 public:
144         CreateDVD_ResizeTracks(CreateDVD_GUI *gui, int x, int y);
145         ~CreateDVD_ResizeTracks();
146
147         CreateDVD_GUI *gui;
148 };
149
150 class CreateDVD_Histogram : public BC_CheckBox
151 {
152 public:
153         CreateDVD_Histogram(CreateDVD_GUI *gui, int x, int y);
154         ~CreateDVD_Histogram();
155
156         CreateDVD_GUI *gui;
157 };
158
159 class CreateDVD_LabelChapters : public BC_CheckBox
160 {
161 public:
162         CreateDVD_LabelChapters(CreateDVD_GUI *gui, int x, int y);
163         ~CreateDVD_LabelChapters();
164
165         CreateDVD_GUI *gui;
166 };
167
168 class CreateDVD_WideAudio : public BC_CheckBox
169 {
170 public:
171         CreateDVD_WideAudio(CreateDVD_GUI *gui, int x, int y);
172         ~CreateDVD_WideAudio();
173
174         CreateDVD_GUI *gui;
175 };
176
177 class CreateDVD_UseFFMpeg : public BC_CheckBox
178 {
179 public:
180         CreateDVD_UseFFMpeg(CreateDVD_GUI *gui, int x, int y);
181         ~CreateDVD_UseFFMpeg();
182
183         CreateDVD_GUI *gui;
184 };
185
186 class CreateDVD_GUI : public BC_Window
187 {
188 public:
189         CreateDVD_GUI(CreateDVD_Thread *thread,
190                 int x, int y, int w, int h);
191         ~CreateDVD_GUI();
192
193         void create_objects();
194         int resize_event(int w, int h);
195         int translation_event();
196         int close_event();
197         void update();
198
199         CreateDVD_Thread *thread;
200         int at_x, at_y;
201         CreateDVD_AssetTitle *asset_title;
202         int tmp_x, tmp_y;
203         CreateDVD_TmpPath *tmp_path;
204         BrowseButton *btmp_path;
205         CreateDVD_DiskSpace *disk_space;
206         CreateDVD_Format *standard;
207         CreateDVD_Scale *scale;
208         ArrayList<BC_ListBoxItem *> media_sizes;
209         CreateDVD_MediaSize *media_size;
210         CreateDVD_Deinterlace *need_deinterlace;
211         CreateDVD_InverseTelecine *need_inverse_telecine;
212         CreateDVD_UseFFMpeg *need_use_ffmpeg;
213         CreateDVD_ResizeTracks *need_resize_tracks;
214         CreateDVD_Histogram *need_histogram;
215         CreateDVD_WideAudio *need_wide_audio;
216         CreateDVD_LabelChapters *need_label_chapters;
217         int ok_x, ok_y, ok_w, ok_h;
218         CreateDVD_OK *ok;
219         int cancel_x, cancel_y, cancel_w, cancel_h;
220         CreateDVD_Cancel *cancel;
221 };
222
223 class CreateDVD_FormatItem : public BC_MenuItem
224 {
225 public:
226         int handle_event();
227         CreateDVD_FormatItem(CreateDVD_Format *popup, int standard, const char *text);
228         ~CreateDVD_FormatItem();
229
230         CreateDVD_Format *popup;
231         int standard;
232 };
233
234 class CreateDVD_Format : public BC_PopupMenu
235 {
236 public:
237         void create_objects();
238         int handle_event();
239         CreateDVD_Format(CreateDVD_GUI *gui, int x, int y);
240         ~CreateDVD_Format();
241         void set_value(int v) { set_text(get_item(v)->get_text()); }
242
243         CreateDVD_GUI *gui;
244 };
245
246 class CreateDVD_ScaleItem : public BC_MenuItem
247 {
248 public:
249         int handle_event();
250         CreateDVD_ScaleItem(CreateDVD_Scale *popup, int scale, const char *text);
251         ~CreateDVD_ScaleItem();
252
253         CreateDVD_Scale *popup;
254         int scale;
255 };
256
257 class CreateDVD_Scale : public BC_PopupMenu
258 {
259 public:
260         void create_objects();
261         int handle_event();
262         CreateDVD_Scale(CreateDVD_GUI *gui, int x, int y);
263         ~CreateDVD_Scale();
264
265         CreateDVD_GUI *gui;
266         void set_value(int v) { set_text(Rescale::scale_types[v]); }
267 };
268
269 class CreateDVD_MediaSize : public BC_PopupTextBox
270 {
271 public:
272         CreateDVD_MediaSize(CreateDVD_GUI *gui, int x, int y);
273         ~CreateDVD_MediaSize();
274         int handle_event();
275
276         CreateDVD_GUI *gui;
277 };
278
279 #endif