4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "bitspopup.h"
28 #include "browsebutton.h"
29 #include "compresspopup.h"
32 #include "formatpopup.h"
33 #include "formattools.inc"
34 #include "mwindow.inc"
39 FormatTools(MWindow *mwindow,
40 BC_WindowBase *window,
42 virtual ~FormatTools();
44 void create_objects(int &init_x,
46 int do_audio, // Include tools for audio
47 int do_video, // Include tools for video
48 int prompt_audio, // Include checkbox for audio
49 int prompt_video, // Include checkbox for video
50 int prompt_audio_channels,
51 int prompt_video_compression,
52 const char *locked_compressor, // Select compressors to be offered
53 int recording, // Change captions for recording
54 int *file_per_label, // prompt if nonzero
55 int brender, // Supply file formats for background rendering
56 int horizontal_layout = 0);
57 // In recording preferences, aspects of the format are locked
58 // depending on the driver used.
59 void update_driver(int driver);
60 virtual void update_format();
63 void reposition_window(int &init_x, int &init_y);
64 // Put new asset's parameters in and change asset.
65 void update(Asset *asset, int *file_per_label);
66 // Update filename extension when format is changed.
67 void update_extension();
68 void close_format_windows();
71 // Handle change in path text. Used in BatchRender.
72 virtual int handle_event();
74 int set_audio_options();
75 int set_video_options();
79 BC_WindowBase *window;
82 FormatAParams *aparams_button;
83 FormatVParams *vparams_button;
84 FormatAThread *aparams_thread;
85 FormatVThread *vparams_thread;
86 BrowseButton *path_button;
87 FormatPathText *path_textbox;
88 BC_RecentList *path_recent;
89 BC_Title *format_title;
90 FormatFormat *format_button;
91 BC_TextBox *format_text;
92 FormatFFMPEG *format_ffmpeg;
93 FFMpegType *ffmpeg_type;
95 BC_Title *audio_title;
96 FormatAudio *audio_switch;
98 BC_Title *video_title;
99 FormatVideo *video_switch;
101 FormatFilePerLabel *labeled_files;
103 ArrayList<PluginServer*> *plugindb;
105 const char *locked_compressor;
111 int prompt_audio_channels;
113 int prompt_video_compression;
116 // Determines what the configuration buttons do.
122 class FormatPathText : public BC_TextBox
125 FormatPathText(int x, int y, FormatTools *format);
134 class FormatFormat : public FormatPopup
137 FormatFormat(int x, int y, FormatTools *format);
144 class FormatFFMPEG : public FFMPEGPopup
147 FormatFFMPEG(int x, int y, FormatTools *format);
153 // squash show/hide window
154 int show_window(int flush=1) { return 0; }
155 int hide_window(int flush=1) { return 0; }
156 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
157 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
160 class FFMpegType : public BC_TextBox
163 FFMpegType(int x, int y, int w, int h, const char *text)
164 : BC_TextBox(x, y, w, h, text) {}
166 // squash show/hide window
167 int show_window(int flush=1) { return 0; }
168 int hide_window(int flush=1) { return 0; }
169 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
170 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
173 class FormatAParams : public BC_Button
176 FormatAParams(MWindow *mwindow, FormatTools *format, int x, int y);
182 class FormatVParams : public BC_Button
185 FormatVParams(MWindow *mwindow, FormatTools *format, int x, int y);
192 class FormatAThread : public Thread
195 FormatAThread(FormatTools *format);
200 void join() { if( !joined ) { joined = 1; Thread::join(); } }
207 class FormatVThread : public Thread
210 FormatVThread(FormatTools *format);
215 void join() { if( !joined ) { joined = 1; Thread::join(); } }
222 class FormatAudio : public BC_CheckBox
225 FormatAudio(int x, int y, FormatTools *format, int default_);
231 class FormatVideo : public BC_CheckBox
234 FormatVideo(int x, int y, FormatTools *format, int default_);
241 class FormatFilePerLabel : public BC_CheckBox
244 FormatFilePerLabel(FormatTools *format, int x, int y, int *output);
245 ~FormatFilePerLabel();
247 void update(int *output);