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 "mwindow.inc"
40 class FormatPathButton;
52 FormatTools(MWindow *mwindow,
53 BC_WindowBase *window,
55 virtual ~FormatTools();
57 void create_objects(int &init_x,
59 int do_audio, // Include tools for audio
60 int do_video, // Include tools for video
61 int prompt_audio, // Include checkbox for audio
62 int prompt_video, // Include checkbox for video
63 int prompt_audio_channels,
64 int prompt_video_compression,
65 const char *locked_compressor, // Select compressors to be offered
66 int recording, // Change captions for recording
67 int *strategy, // If nonzero, prompt for insertion strategy
68 int brender, // Supply file formats for background rendering
69 int horizontal_layout = 0);
70 // In recording preferences, aspects of the format are locked
71 // depending on the driver used.
72 void update_driver(int driver);
73 virtual void update_format();
76 void reposition_window(int &init_x, int &init_y);
77 // Put new asset's parameters in and change asset.
78 void update(Asset *asset, int *strategy);
79 // Update filename extension when format is changed.
80 void update_extension();
81 void close_format_windows();
84 // Handle change in path text. Used in BatchRender.
85 virtual int handle_event();
87 int set_audio_options();
88 int set_video_options();
92 BC_WindowBase *window;
95 FormatAParams *aparams_button;
96 FormatVParams *vparams_button;
97 FormatAThread *aparams_thread;
98 FormatVThread *vparams_thread;
99 BrowseButton *path_button;
100 FormatPathText *path_textbox;
101 BC_RecentList *path_recent;
102 BC_Title *format_title;
103 FormatFormat *format_button;
104 BC_TextBox *format_text;
105 FormatFFMPEG *format_ffmpeg;
106 FFMpegType *ffmpeg_type;
107 BC_ITumbler *channels_tumbler;
109 BC_Title *audio_title;
110 BC_Title *channels_title;
111 FormatChannels *channels_button;
112 FormatAudio *audio_switch;
114 BC_Title *video_title;
115 FormatVideo *video_switch;
117 FormatMultiple *multiple_files;
119 ArrayList<PluginServer*> *plugindb;
121 const char *locked_compressor;
127 int prompt_audio_channels;
129 int prompt_video_compression;
132 // Determines what the configuration buttons do.
138 class FormatPathText : public BC_TextBox
141 FormatPathText(int x, int y, FormatTools *format);
150 class FormatFormat : public FormatPopup
153 FormatFormat(int x, int y, FormatTools *format);
160 class FormatFFMPEG : public FFMPEGPopup
163 FormatFFMPEG(int x, int y, FormatTools *format);
169 // squash show/hide window
170 int show_window(int flush=1) { return 0; }
171 int hide_window(int flush=1) { return 0; }
172 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
173 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
176 class FFMpegType : public BC_TextBox
179 FFMpegType(int x, int y, int w, int h, const char *text)
180 : BC_TextBox(x, y, w, h, text) {}
182 // squash show/hide window
183 int show_window(int flush=1) { return 0; }
184 int hide_window(int flush=1) { return 0; }
185 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
186 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
189 class FormatAParams : public BC_Button
192 FormatAParams(MWindow *mwindow, FormatTools *format, int x, int y);
198 class FormatVParams : public BC_Button
201 FormatVParams(MWindow *mwindow, FormatTools *format, int x, int y);
208 class FormatAThread : public Thread
211 FormatAThread(FormatTools *format);
216 void join() { if( !joined ) { joined = 1; Thread::join(); } }
223 class FormatVThread : public Thread
226 FormatVThread(FormatTools *format);
231 void join() { if( !joined ) { joined = 1; Thread::join(); } }
238 class FormatAudio : public BC_CheckBox
241 FormatAudio(int x, int y, FormatTools *format, int default_);
247 class FormatVideo : public BC_CheckBox
250 FormatVideo(int x, int y, FormatTools *format, int default_);
257 class FormatChannels : public BC_TextBox
260 FormatChannels(int x, int y, FormatTools *format);
266 class FormatToTracks : public BC_CheckBox
269 FormatToTracks(int x, int y, int *output);
275 class FormatMultiple : public BC_CheckBox
278 FormatMultiple(MWindow *mwindow, int x, int y, int *output);
281 void update(int *output);