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);
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 // Suggestions for the textbox
120 ArrayList<BC_ListBoxItem*> *file_entries;
121 ArrayList<PluginServer*> *plugindb;
123 const char *locked_compressor;
129 int prompt_audio_channels;
131 int prompt_video_compression;
134 // Determines what the configuration buttons do.
140 class FormatPathText : public BC_TextBox
143 FormatPathText(int x, int y, FormatTools *format);
152 class FormatFormat : public FormatPopup
155 FormatFormat(int x, int y, FormatTools *format);
162 class FormatFFMPEG : public FFMPEGPopup
165 FormatFFMPEG(int x, int y, FormatTools *format);
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);