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;
49 FormatTools(MWindow *mwindow,
50 BC_WindowBase *window,
52 virtual ~FormatTools();
54 void create_objects(int &init_x,
56 int do_audio, // Include tools for audio
57 int do_video, // Include tools for video
58 int prompt_audio, // Include checkbox for audio
59 int prompt_video, // Include checkbox for video
60 int prompt_audio_channels,
61 int prompt_video_compression,
62 char *locked_compressor, // Select compressors to be offered
63 int recording, // Change captions for recording
64 int *strategy, // If nonzero, prompt for insertion strategy
65 int brender); // Supply file formats for background rendering
66 // In recording preferences, aspects of the format are locked
67 // depending on the driver used.
68 void update_driver(int driver);
72 void reposition_window(int &init_x, int &init_y);
73 // Put new asset's parameters in and change asset.
74 void update(Asset *asset, int *strategy);
75 // Update filename extension when format is changed.
76 void update_extension();
77 void close_format_windows();
80 // Handle change in path text. Used in BatchRender.
81 virtual int handle_event();
83 int set_audio_options();
84 int set_video_options();
88 BC_WindowBase *window;
91 FormatAParams *aparams_button;
92 FormatVParams *vparams_button;
93 FormatAThread *aparams_thread;
94 FormatVThread *vparams_thread;
95 BrowseButton *path_button;
96 FormatPathText *path_textbox;
97 BC_Title *format_title;
98 FormatFormat *format_button;
99 BC_TextBox *format_text;
100 BC_ITumbler *channels_tumbler;
102 BC_Title *audio_title;
103 BC_Title *channels_title;
104 FormatChannels *channels_button;
105 FormatAudio *audio_switch;
107 BC_Title *video_title;
108 FormatVideo *video_switch;
110 FormatMultiple *multiple_files;
112 // Suggestions for the textbox
113 ArrayList<BC_ListBoxItem*> *file_entries;
114 ArrayList<PluginServer*> *plugindb;
116 char *locked_compressor;
122 int prompt_audio_channels;
124 int prompt_video_compression;
127 // Determines what the configuration buttons do.
133 class FormatPathText : public BC_TextBox
136 FormatPathText(int x, int y, FormatTools *format);
145 class FormatFormat : public FormatPopup
148 FormatFormat(int x, int y, FormatTools *format);
155 class FormatAParams : public BC_Button
158 FormatAParams(MWindow *mwindow, FormatTools *format, int x, int y);
164 class FormatVParams : public BC_Button
167 FormatVParams(MWindow *mwindow, FormatTools *format, int x, int y);
174 class FormatAThread : public Thread
177 FormatAThread(FormatTools *format);
182 void join() { if( !joined ) { joined = 1; Thread::join(); } }
189 class FormatVThread : public Thread
192 FormatVThread(FormatTools *format);
197 void join() { if( !joined ) { joined = 1; Thread::join(); } }
204 class FormatAudio : public BC_CheckBox
207 FormatAudio(int x, int y, FormatTools *format, int default_);
213 class FormatVideo : public BC_CheckBox
216 FormatVideo(int x, int y, FormatTools *format, int default_);
223 class FormatChannels : public BC_TextBox
226 FormatChannels(int x, int y, FormatTools *format);
232 class FormatToTracks : public BC_CheckBox
235 FormatToTracks(int x, int y, int *output);
241 class FormatMultiple : public BC_CheckBox
244 FormatMultiple(MWindow *mwindow, int x, int y, int *output);
247 void update(int *output);