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"
31 #include "formatpopup.h"
32 #include "mwindow.inc"
39 class FormatPathButton;
51 FormatTools(MWindow *mwindow,
52 BC_WindowBase *window,
54 virtual ~FormatTools();
56 void create_objects(int &init_x,
58 int do_audio, // Include tools for audio
59 int do_video, // Include tools for video
60 int prompt_audio, // Include checkbox for audio
61 int prompt_video, // Include checkbox for video
62 int prompt_audio_channels,
63 int prompt_video_compression,
64 char *locked_compressor, // Select compressors to be offered
65 int recording, // Change captions for recording
66 int *strategy, // If nonzero, prompt for insertion strategy
67 int brender); // Supply file formats for background rendering
68 // In recording preferences, aspects of the format are locked
69 // depending on the driver used.
70 void update_driver(int driver);
74 void reposition_window(int &init_x, int &init_y);
75 // Put new asset's parameters in and change asset.
76 void update(Asset *asset, int *strategy);
77 // Update filename extension when format is changed.
78 void update_extension();
79 void close_format_windows();
82 // Handle change in path text. Used in BatchRender.
83 virtual int handle_event();
85 int set_audio_options();
86 int set_video_options();
90 BC_WindowBase *window;
93 FormatAParams *aparams_button;
94 FormatVParams *vparams_button;
95 FormatAThread *aparams_thread;
96 FormatVThread *vparams_thread;
97 BrowseButton *path_button;
98 FormatPathText *path_textbox;
99 BC_Title *format_title;
100 FormatFormat *format_button;
101 BC_TextBox *format_text;
102 FormatFFMPEG *format_ffmpeg;
103 FFMpegType *ffmpeg_type;
104 BC_ITumbler *channels_tumbler;
106 BC_Title *audio_title;
107 BC_Title *channels_title;
108 FormatChannels *channels_button;
109 FormatAudio *audio_switch;
111 BC_Title *video_title;
112 FormatVideo *video_switch;
114 FormatMultiple *multiple_files;
116 // Suggestions for the textbox
117 ArrayList<BC_ListBoxItem*> *file_entries;
118 ArrayList<PluginServer*> *plugindb;
120 char *locked_compressor;
126 int prompt_audio_channels;
128 int prompt_video_compression;
131 // Determines what the configuration buttons do.
137 class FormatPathText : public BC_TextBox
140 FormatPathText(int x, int y, FormatTools *format);
149 class FormatFormat : public FormatPopup
152 FormatFormat(int x, int y, FormatTools *format);
159 class FormatFFMPEG : public FFMPEGPopup
162 FormatFFMPEG(int x, int y, FormatTools *format);
167 // squash show/hide window
168 int show_window(int flush=1) { return 0; }
169 int hide_window(int flush=1) { return 0; }
170 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
171 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
174 class FFMpegType : public BC_TextBox
177 FFMpegType(int x, int y, int w, int h, const char *text)
178 : BC_TextBox(x, y, w, h, text) {}
180 // squash show/hide window
181 int show_window(int flush=1) { return 0; }
182 int hide_window(int flush=1) { return 0; }
183 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
184 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
187 class FormatAParams : public BC_Button
190 FormatAParams(MWindow *mwindow, FormatTools *format, int x, int y);
196 class FormatVParams : public BC_Button
199 FormatVParams(MWindow *mwindow, FormatTools *format, int x, int y);
206 class FormatAThread : public Thread
209 FormatAThread(FormatTools *format);
214 void join() { if( !joined ) { joined = 1; Thread::join(); } }
221 class FormatVThread : public Thread
224 FormatVThread(FormatTools *format);
229 void join() { if( !joined ) { joined = 1; Thread::join(); } }
236 class FormatAudio : public BC_CheckBox
239 FormatAudio(int x, int y, FormatTools *format, int default_);
245 class FormatVideo : public BC_CheckBox
248 FormatVideo(int x, int y, FormatTools *format, int default_);
255 class FormatChannels : public BC_TextBox
258 FormatChannels(int x, int y, FormatTools *format);
264 class FormatToTracks : public BC_CheckBox
267 FormatToTracks(int x, int y, int *output);
273 class FormatMultiple : public BC_CheckBox
276 FormatMultiple(MWindow *mwindow, int x, int y, int *output);
279 void update(int *output);