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 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 // In recording preferences, aspects of the format are locked
70 // depending on the driver used.
71 void update_driver(int driver);
75 void reposition_window(int &init_x, int &init_y);
76 // Put new asset's parameters in and change asset.
77 void update(Asset *asset, int *strategy);
78 // Update filename extension when format is changed.
79 void update_extension();
80 void close_format_windows();
83 // Handle change in path text. Used in BatchRender.
84 virtual int handle_event();
86 int set_audio_options();
87 int set_video_options();
91 BC_WindowBase *window;
94 FormatAParams *aparams_button;
95 FormatVParams *vparams_button;
96 FormatAThread *aparams_thread;
97 FormatVThread *vparams_thread;
98 BrowseButton *path_button;
99 FormatPathText *path_textbox;
100 BC_Title *format_title;
101 FormatFormat *format_button;
102 BC_TextBox *format_text;
103 FormatFFMPEG *format_ffmpeg;
104 FFMpegType *ffmpeg_type;
105 BC_ITumbler *channels_tumbler;
107 BC_Title *audio_title;
108 BC_Title *channels_title;
109 FormatChannels *channels_button;
110 FormatAudio *audio_switch;
112 BC_Title *video_title;
113 FormatVideo *video_switch;
115 FormatMultiple *multiple_files;
117 // Suggestions for the textbox
118 ArrayList<BC_ListBoxItem*> *file_entries;
119 ArrayList<PluginServer*> *plugindb;
121 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);
168 static int load_defaults(const char *path, const char *type,
169 char *codec, char *codec_options, int len);
171 // squash show/hide window
172 int show_window(int flush=1) { return 0; }
173 int hide_window(int flush=1) { return 0; }
174 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
175 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
178 class FFMpegType : public BC_TextBox
181 FFMpegType(int x, int y, int w, int h, const char *text)
182 : BC_TextBox(x, y, w, h, text) {}
184 // squash show/hide window
185 int show_window(int flush=1) { return 0; }
186 int hide_window(int flush=1) { return 0; }
187 int show(int flush=1) { return BC_SubWindow::show_window(flush); }
188 int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
191 class FormatAParams : public BC_Button
194 FormatAParams(MWindow *mwindow, FormatTools *format, int x, int y);
200 class FormatVParams : public BC_Button
203 FormatVParams(MWindow *mwindow, FormatTools *format, int x, int y);
210 class FormatAThread : public Thread
213 FormatAThread(FormatTools *format);
218 void join() { if( !joined ) { joined = 1; Thread::join(); } }
225 class FormatVThread : public Thread
228 FormatVThread(FormatTools *format);
233 void join() { if( !joined ) { joined = 1; Thread::join(); } }
240 class FormatAudio : public BC_CheckBox
243 FormatAudio(int x, int y, FormatTools *format, int default_);
249 class FormatVideo : public BC_CheckBox
252 FormatVideo(int x, int y, FormatTools *format, int default_);
259 class FormatChannels : public BC_TextBox
262 FormatChannels(int x, int y, FormatTools *format);
268 class FormatToTracks : public BC_CheckBox
271 FormatToTracks(int x, int y, int *output);
277 class FormatMultiple : public BC_CheckBox
280 FormatMultiple(MWindow *mwindow, int x, int y, int *output);
283 void update(int *output);