4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
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.
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.
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
28 #include "bitspopup.h"
29 #include "browsebutton.h"
30 #include "compresspopup.h"
33 #include "formatpopup.h"
34 #include "formattools.inc"
35 #include "mwindow.inc"
40 FormatTools(MWindow *mwindow, BC_WindowBase *window, Asset *asset);
41 virtual ~FormatTools();
43 void create_objects(int &init_x, int &init_y,
44 int do_audio, int do_video, // Include tools for audio, video
45 int prompt_audio, int prompt_video, // Include checkbox for audio, video
46 int prompt_audio_channels, int prompt_video_compression,
47 const char *locked_compressor, // Select compressors to be offered
48 int recording, // Change captions for recording
49 int *file_per_label, // prompt if nonzero
50 int brender, // Supply file formats for background rendering
51 int horizontal_layout = 0);
52 // In recording preferences, aspects of the format are locked
53 // depending on the driver used.
54 void update_driver(int driver);
55 virtual void update_format();
58 void reposition_window(int &init_x, int &init_y);
59 // Put new asset's parameters in and change asset.
60 void update(Asset *asset, int *file_per_label);
61 // Update filename extension when format is changed.
62 void update_extension();
63 void close_format_windows();
66 // Handle change in path text. Used in BatchRender.
67 virtual int handle_event();
69 int set_audio_options();
70 int set_video_options();
74 BC_WindowBase *window;
77 FormatAParams *aparams_button;
78 FormatVParams *vparams_button;
79 FormatAThread *aparams_thread;
80 FormatVThread *vparams_thread;
81 BrowseButton *path_button;
82 FormatPathText *path_textbox;
83 BC_RecentList *path_recent;
84 BC_Title *format_title;
85 FormatFormat *format_button;
86 BC_TextBox *format_text;
87 FormatFFMPEG *format_ffmpeg;
88 FFMpegType *ffmpeg_type;
90 BC_Title *audio_title;
91 FormatAudio *audio_switch;
93 BC_Title *video_title;
94 FormatVideo *video_switch;
96 FormatFilePerLabel *labeled_files;
99 const char *locked_compressor;
105 int prompt_audio_channels;
107 int prompt_video_compression;
110 // Determines what the configuration buttons do.
116 class FormatPathText : public BC_TextBox
119 FormatPathText(int x, int y, FormatTools *format);
128 class FormatFormat : public FormatPopup
131 FormatFormat(int x, int y, FormatTools *format);
138 class FormatFFMPEG : public FFMPEGPopup
141 FormatFFMPEG(int x, int y, FormatTools *format);
147 // squash show/hide window
148 int show_window(int flush=1) { return 0; }
149 int hide_window(int flush=1) { return 0; }
150 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
151 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
154 class FFMpegType : public BC_TextBox
157 FFMpegType(int x, int y, int w, int h, const char *text)
158 : BC_TextBox(x, y, w, h, text) {}
160 // squash show/hide window
161 int show_window(int flush=1) { return 0; }
162 int hide_window(int flush=1) { return 0; }
163 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
164 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
167 class FormatAParams : public BC_Button
170 FormatAParams(MWindow *mwindow, FormatTools *format, int x, int y);
176 class FormatVParams : public BC_Button
179 FormatVParams(MWindow *mwindow, FormatTools *format, int x, int y);
186 class FormatAThread : public Thread
189 FormatAThread(FormatTools *format);
194 void join() { if( !joined ) { joined = 1; Thread::join(); } }
201 class FormatVThread : public Thread
204 FormatVThread(FormatTools *format);
209 void join() { if( !joined ) { joined = 1; Thread::join(); } }
216 class FormatAudio : public BC_CheckBox
219 FormatAudio(int x, int y, FormatTools *format, int default_);
225 class FormatVideo : public BC_CheckBox
228 FormatVideo(int x, int y, FormatTools *format, int default_);
235 class FormatFilePerLabel : public BC_CheckBox
238 FormatFilePerLabel(FormatTools *format, int x, int y, int *output);
239 ~FormatFilePerLabel();
241 void update(int *output);