3 #include "formatwindow.h"
7 FormatAWindow::FormatAWindow(Asset_GC asset, int *dither)
8 : BC_Window(PROGRAM_NAME ": File format", 410,
9 (asset->format == FILE_WAV || asset->format == FILE_MOV) ? 115 : 185,
11 { this->asset = asset; this->dither = dither; }
13 FormatAWindow::~FormatAWindow()
17 int FormatAWindow::create_objects()
25 add_subwindow(new BC_Title(x, y, _("Set parameters for this audio format:")));
27 add_subwindow(new BC_Title(x, y, _("Bits:")));
29 add_subwindow(new FormatBits(x, y, asset));
31 add_subwindow(new FormatDither(x, y, this->dither));
33 if(asset->format == FILE_PCM || asset->format == FILE_MOV)
36 add_subwindow(new FormatSigned(x, y, asset));
41 if(asset->format == FILE_PCM)
43 add_subwindow(new BC_Title(x, y, _("Byte order:")));
45 add_subwindow(new BC_Title(x, y, _("HiLo:"), SMALLFONT));
46 add_subwindow(hilo_button = new FormatHILO(x + 30, y, asset));
48 add_subwindow(new BC_Title(x, y, _("LoHi:"), SMALLFONT));
49 add_subwindow(lohi_button = new FormatLOHI(x + 30, y, hilo_button, asset));
50 hilo_button->lohi = lohi_button;
56 add_subwindow(new BC_OKButton(x + 170, y));
60 int FormatAWindow::close_event()
68 FormatVWindow::FormatVWindow(Asset_GC asset, int recording)
69 : BC_Window(PROGRAM_NAME ": File format", 410, 115, 0, 0)
70 { this->asset = asset; this->recording = recording; }
72 FormatVWindow::~FormatVWindow()
76 int FormatVWindow::create_objects()
83 if(asset->format == FILE_MOV)
85 add_subwindow(new BC_Title(x, y, _("Set parameters for this video format:")));
87 add_subwindow(new BC_Title(x, y, _("Compression:")));
89 add_subwindow(new FormatCompress(x, y, recording, asset, asset->compression));
91 add_subwindow(new BC_Title(x, y, _("Quality:")));
93 add_subwindow(new FormatQuality(x, y, asset, asset->quality));
98 if(asset->format == FILE_JPEG_LIST)
100 add_subwindow(new BC_Title(x, y, _("Set parameters for this video format:")));
102 add_subwindow(new BC_Title(x, y, _("Quality:")));
104 add_subwindow(new FormatQuality(x, y, asset, asset->quality));
110 add_subwindow(new BC_Title(x, y, _("Video is not supported in this format.")));
114 add_subwindow(new BC_OKButton(x + 170, y));
117 int FormatVWindow::close_event()
128 FormatCompress::FormatCompress(int x, int y, int recording, Asset_GC asset, char* default_)
129 : CompressPopup(x, y, recording, default_)
133 FormatCompress::~FormatCompress()
136 int FormatCompress::handle_event()
138 strcpy(asset->compression, get_compression());
141 FormatQuality::FormatQuality(int x, int y, Asset_GC asset, int default_)
154 FormatQuality::~FormatQuality()
157 int FormatQuality::handle_event()
159 asset->quality = get_value();
164 FormatBits::FormatBits(int x, int y, Asset_GC asset)
165 : BitsPopup(x, y, asset)
166 { this->asset = asset; }
167 FormatBits::~FormatBits() {}
168 int FormatBits::handle_event()
170 asset->bits = get_bits();
175 FormatDither::FormatDither(int x, int y, int *dither)
176 : BC_CheckBox(x, y, *dither, _("Dither"))
177 { this->dither = dither; }
178 FormatDither::~FormatDither() {}
179 int FormatDither::handle_event()
181 *dither = get_value();
187 FormatSigned::FormatSigned(int x, int y, Asset_GC asset)
188 : BC_CheckBox(x, y, asset->signed_, _("Signed"))
189 { this->asset = asset; }
190 FormatSigned::~FormatSigned() {}
191 int FormatSigned::handle_event()
193 asset->signed_ = get_value();
201 FormatHILO::FormatHILO(int x, int y, Asset_GC asset)
202 : BC_Radial(x, y, asset->byte_order ^ 1)
206 FormatHILO::~FormatHILO() {}
208 int FormatHILO::handle_event()
210 asset->byte_order = get_value() ^ 1;
211 lohi->update(get_value() ^ 1);
214 FormatLOHI::FormatLOHI(int x, int y, FormatHILO *hilo, Asset_GC asset)
215 : BC_Radial(x, y, asset->byte_order)
220 FormatLOHI::~FormatLOHI() {}
222 int FormatLOHI::handle_event()
224 asset->byte_order = get_value();
225 hilo->update(get_value() ^ 1);
231 // c-file-style: "linux"