[svn] / trunk / vfw / src / config.c Repository:
ViewVC logotype

Annotation of /trunk/vfw/src/config.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 109 - (view) (download)

1 : Isibaar 3 /**************************************************************************
2 :     *
3 :     * XVID VFW FRONTEND
4 :     * config
5 :     *
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.
10 :     *
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.
15 :     *
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., 675 Mass Ave, Cambridge, MA 02139, USA.
19 :     *
20 :     *************************************************************************/
21 :    
22 :     /**************************************************************************
23 :     *
24 :     * History:
25 :     *
26 : h 109 * 07.04.2002 min keyframe interval checkbox
27 :     * 2-pass max bitrate and overflow customization
28 : h 102 * 04.04.2002 interlacing support
29 :     * hinted ME support
30 : h 64 * 24.03.2002 daniel smith <danielsmith@astroboymail.com>
31 :     * added Foxer's new CBR engine
32 :     * - cbr_buffer is being used as reaction delay (quick hack)
33 : h 61 * 23.03.2002 daniel smith <danielsmith@astroboymail.com>
34 :     * added load defaults button
35 :     * merged foxer's alternative 2-pass code (2-pass alt tab)
36 :     * added proper tooltips
37 :     * moved registry data into reg_ints/reg_strs arrays
38 :     * added DEBUGERR output on errors instead of returning
39 : h 30 * 16.03.2002 daniel smith <danielsmith@astroboymail.com>
40 :     * rewrote/restructured most of file
41 :     * added tooltips (kind of - dirty message hook method)
42 :     * split tabs into a main dialog / advanced prop sheet
43 :     * advanced controls are now enabled/disabled by mode
44 :     * added modulated quantization, DX50 fourcc
45 :     * 11.03.2002 Min Chen <chenm001@163.com>
46 :     * now get Core Version use xvid_init()
47 :     * 05.03.2002 Min Chen <chenm001@163.com>
48 :     * Add Core version display to about box
49 : Isibaar 3 * 01.12.2001 inital version; (c)2001 peter ross <suxen_drol@hotmail.com>
50 :     *
51 :     *************************************************************************/
52 :    
53 :    
54 :     #include <windows.h>
55 : h 30 #include <commctrl.h>
56 : Isibaar 3 #include <shlobj.h>
57 :     #include <prsht.h>
58 :    
59 :     #include "codec.h"
60 :     #include "config.h"
61 : h 30 #include "xvid.h" // cpu masks
62 : Isibaar 3 #include "resource.h"
63 :    
64 : h 30
65 : h 61 /* registry info structs */
66 :    
67 :     CONFIG reg;
68 :    
69 :     REG_INT const reg_ints[] = {
70 :     {"mode", &reg.mode, DLG_MODE_CBR},
71 :     {"bitrate", &reg.bitrate, 900000},
72 :     {"quality", &reg.quality, 85},
73 :     {"quant", &reg.quant, 5},
74 : h 64 {"rc_buffersize", &reg.rc_buffersize, 16},
75 : h 61
76 :     {"motion_search", &reg.motion_search, 5},
77 :     {"quant_type", &reg.quant_type, 0},
78 :     {"fourcc_used", &reg.fourcc_used, 0},
79 :     {"max_key_interval", &reg.max_key_interval, 300},
80 : h 109 {"min_key_interval", &reg.min_key_interval, 1},
81 : h 61 {"lum_masking", &reg.lum_masking, 0},
82 : h 102 {"interlacing", &reg.interlacing, 0},
83 : h 61
84 :     {"min_iquant", &reg.min_iquant, 1},
85 :     {"max_iquant", &reg.max_iquant, 31},
86 :     {"min_pquant", &reg.min_pquant, 1},
87 :     {"max_pquant", &reg.max_pquant, 31},
88 :    
89 :     {"desired_size", &reg.desired_size, 570000},
90 :     {"keyframe_boost", &reg.keyframe_boost, 20},
91 :     {"discard1pass", &reg.discard1pass, 1},
92 :     {"dummy2pass", &reg.dummy2pass, 0},
93 :     {"curve_compression_high", &reg.curve_compression_high, 25},
94 :     {"curve_compression_low", &reg.curve_compression_low, 10},
95 :     {"use_alt_curve", &reg.use_alt_curve, 0},
96 :     {"alt_curve_use_auto", &reg.alt_curve_use_auto, 1},
97 :     {"alt_curve_auto_str", &reg.alt_curve_auto_str, 50},
98 :     {"alt_curve_use_auto_bonus_bias", &reg.alt_curve_use_auto_bonus_bias, 1},
99 :     {"alt_curve_bonus_bias", &reg.alt_curve_bonus_bias, 50},
100 :     {"alt_curve_type", &reg.alt_curve_type, 1},
101 :     {"alt_curve_high_dist", &reg.alt_curve_high_dist, 300},
102 :     {"alt_curve_low_dist", &reg.alt_curve_low_dist, 300},
103 :     {"alt_curve_min_rel_qual", &reg.alt_curve_min_rel_qual, 50},
104 :     {"bitrate_payback_delay", &reg.bitrate_payback_delay, 240},
105 :     {"bitrate_payback_method", &reg.bitrate_payback_method, 0},
106 : h 109 {"twopass_max_bitrate", &reg.twopass_max_bitrate, 10000 * CONFIG_KBPS},
107 :     {"twopass_max_overflow_improvement", &reg.twopass_max_overflow_improvement, 60},
108 :     {"twopass_max_overflow_degradation", &reg.twopass_max_overflow_degradation, 60},
109 : h 102 {"hinted_me", &reg.hinted_me, 0},
110 : h 61
111 :     {"credits_start", &reg.credits_start, 0},
112 :     {"credits_start_begin", &reg.credits_start_begin, 0},
113 :     {"credits_start_end", &reg.credits_start_end, 0},
114 :     {"credits_end", &reg.credits_end, 0},
115 :     {"credits_end_begin", &reg.credits_end_begin, 0},
116 :     {"credits_end_end", &reg.credits_end_end, 0},
117 :    
118 :     {"credits_mode", &reg.credits_mode, 0},
119 :     {"credits_rate", &reg.credits_rate, 20},
120 :     {"credits_quant_i", &reg.credits_quant_i, 20},
121 :     {"credits_quant_p", &reg.credits_quant_p, 20},
122 :     {"credits_start_size", &reg.credits_start_size, 10000},
123 :     {"credits_end_size", &reg.credits_end_size, 10000}
124 :     };
125 :    
126 :     REG_STR const reg_strs[] = {
127 : h 102 {"hintfile", reg.hintfile, CONFIG_HINTFILE},
128 : h 61 {"stats1", reg.stats1, CONFIG_2PASS_1_FILE},
129 :     {"stats2", reg.stats2, CONFIG_2PASS_2_FILE}
130 :     // {"build", reg.build, XVID_BUILD}
131 :     };
132 :    
133 : Isibaar 3 /* get config settings from registry */
134 :    
135 :     #define REG_GET_B(X, Y, Z) size=sizeof((Z));if(RegQueryValueEx(hKey, X, 0, 0, Y, &size) != ERROR_SUCCESS) {memcpy(Y, Z, sizeof((Z)));}
136 :    
137 :     void config_reg_get(CONFIG * config)
138 :     {
139 :     HKEY hKey;
140 :     DWORD size;
141 :     XVID_INIT_PARAM init_param;
142 : h 61 int i;
143 : Isibaar 3
144 :     init_param.cpu_flags = 0;
145 :     xvid_init(0, 0, &init_param, NULL);
146 :     config->cpu = init_param.cpu_flags;
147 :    
148 : h 30 RegOpenKeyEx(XVID_REG_KEY, XVID_REG_PARENT "\\" XVID_REG_CHILD, 0, KEY_READ, &hKey);
149 : Isibaar 3
150 : h 61 for (i=0 ; i<sizeof(reg_ints)/sizeof(REG_INT) ; ++i)
151 :     {
152 :     size = sizeof(int);
153 : Isibaar 3
154 : h 61 if (RegQueryValueEx(hKey, reg_ints[i].reg_value, 0, 0, (LPBYTE)reg_ints[i].config_int, &size) != ERROR_SUCCESS)
155 :     {
156 :     *reg_ints[i].config_int = reg_ints[i].def;
157 :     }
158 :     }
159 : Isibaar 3
160 : h 61 for (i=0 ; i<sizeof(reg_strs)/sizeof(REG_STR) ; ++i)
161 :     {
162 :     size = MAX_PATH;
163 : Isibaar 3
164 : h 61 if (RegQueryValueEx(hKey, reg_strs[i].reg_value, 0, 0, (LPBYTE)reg_strs[i].config_str, &size) != ERROR_SUCCESS)
165 :     {
166 :     memcpy(reg_strs[i].config_str, reg_strs[i].def, MAX_PATH);
167 :     }
168 :     }
169 : Isibaar 3
170 :     {
171 :     BYTE default_qmatrix_intra[] = {
172 :     8, 17,18,19,21,23,25,27,
173 :     17,18,19,21,23,25,27,28,
174 :     20,21,22,23,24,26,28,30,
175 :     21,22,23,24,26,28,30,32,
176 :     22,23,24,26,28,30,32,35,
177 :     23,24,26,28,30,32,35,38,
178 :     25,26,28,30,32,35,38,41,
179 :     27,28,30,32,35,38,41,45
180 :     };
181 :    
182 :     BYTE default_qmatrix_inter[] = {
183 :     16,17,18,19,20,21,22,23,
184 :     17,18,19,20,21,22,23,24,
185 :     18,19,20,21,22,23,24,25,
186 :     19,20,21,22,23,24,26,27,
187 :     20,21,22,23,25,26,27,28,
188 :     21,22,23,24,26,27,28,30,
189 :     22,23,24,26,27,28,30,31,
190 :     23,24,25,27,28,30,31,33
191 :     };
192 :    
193 : h 61 REG_GET_B("qmatrix_intra", reg.qmatrix_intra, default_qmatrix_intra);
194 :     REG_GET_B("qmatrix_inter", reg.qmatrix_inter, default_qmatrix_inter);
195 : Isibaar 3 }
196 :    
197 : h 61 memcpy(config, &reg, sizeof(CONFIG));
198 :    
199 : Isibaar 3 RegCloseKey(hKey);
200 :     }
201 :    
202 :    
203 :     /* put config settings in registry */
204 :    
205 :     #define REG_SET_B(X, Y) RegSetValueEx(hKey, X, 0, REG_BINARY, Y, sizeof((Y)))
206 :    
207 :     void config_reg_set(CONFIG * config)
208 :     {
209 :     HKEY hKey;
210 :     DWORD dispo;
211 : h 61 int i;
212 : Isibaar 3
213 :     if (RegCreateKeyEx(
214 :     XVID_REG_KEY,
215 : h 30 XVID_REG_PARENT "\\" XVID_REG_CHILD,
216 : Isibaar 3 0,
217 :     XVID_REG_CLASS,
218 :     REG_OPTION_NON_VOLATILE,
219 :     KEY_WRITE,
220 :     0,
221 :     &hKey,
222 :     &dispo) != ERROR_SUCCESS)
223 :     {
224 :     DEBUG1("Couldn't create XVID_REG_SUBKEY - ", GetLastError());
225 :     return;
226 :     }
227 :    
228 : h 61 memcpy(&reg, config, sizeof(CONFIG));
229 : Isibaar 3
230 : h 61 for (i=0 ; i<sizeof(reg_ints)/sizeof(REG_INT) ; ++i)
231 :     {
232 :     RegSetValueEx(hKey, reg_ints[i].reg_value, 0, REG_DWORD, (LPBYTE)reg_ints[i].config_int, sizeof(int));
233 :     }
234 : Isibaar 3
235 : h 61 for (i=0 ; i<sizeof(reg_strs)/sizeof(REG_STR) ; ++i)
236 :     {
237 :     RegSetValueEx(hKey, reg_strs[i].reg_value, 0, REG_SZ, reg_strs[i].config_str, lstrlen(reg_strs[i].config_str)+1);
238 :     }
239 : Isibaar 3
240 : h 61 REG_SET_B("qmatrix_intra", reg.qmatrix_intra);
241 :     REG_SET_B("qmatrix_inter", reg.qmatrix_inter);
242 : Isibaar 3
243 :     RegCloseKey(hKey);
244 :     }
245 :    
246 :    
247 : h 30 /* clear XviD registry key, load defaults */
248 : Isibaar 3
249 : h 30 void config_reg_default(CONFIG * config)
250 : Isibaar 3 {
251 : h 30 HKEY hKey;
252 : Isibaar 3
253 : h 30 if (RegOpenKeyEx(XVID_REG_KEY, XVID_REG_PARENT, 0, KEY_ALL_ACCESS, &hKey))
254 : Isibaar 3 {
255 : h 30 DEBUG1("Couldn't open registry key for deletion - ", GetLastError());
256 :     return;
257 : Isibaar 3 }
258 :    
259 : h 61 if (RegDeleteKey(hKey, XVID_REG_CHILD))
260 : Isibaar 3 {
261 : h 30 DEBUG1("Couldn't delete registry key - ", GetLastError());
262 :     return;
263 : Isibaar 3 }
264 :    
265 : h 61 RegCloseKey(hKey);
266 : h 30 config_reg_get(config);
267 : h 61 config_reg_set(config);
268 : h 30 }
269 : Isibaar 3
270 :    
271 : h 30 /* leaves current config value if dialog item is empty */
272 : Isibaar 3
273 : h 30 int config_get_int(HWND hDlg, UINT item, int config)
274 :     {
275 :     BOOL success = FALSE;
276 : Isibaar 3
277 : h 30 int tmp = GetDlgItemInt(hDlg, item, &success, FALSE);
278 : Isibaar 3
279 : h 30 return (success) ? tmp : config;
280 : Isibaar 3 }
281 :    
282 :    
283 : h 30 /* downloads data from main dialog */
284 : Isibaar 3
285 : h 30 void main_download(HWND hDlg, CONFIG * config)
286 : Isibaar 3 {
287 : h 30 switch(config->mode)
288 : Isibaar 3 {
289 : h 30 default :
290 :     case DLG_MODE_CBR :
291 :     config->bitrate = config_get_int(hDlg, IDC_VALUE, config->bitrate) * CONFIG_KBPS;
292 : Isibaar 3 break;
293 :    
294 : h 30 case DLG_MODE_VBR_QUAL :
295 :     config->quality = config_get_int(hDlg, IDC_VALUE, config->quality);
296 : Isibaar 3 break;
297 :    
298 : h 30 case DLG_MODE_VBR_QUANT :
299 :     config->quant = config_get_int(hDlg, IDC_VALUE, config->quant);
300 : Isibaar 3 break;
301 :    
302 : h 30 case DLG_MODE_2PASS_2_INT :
303 :     config->desired_size = config_get_int(hDlg, IDC_VALUE, config->desired_size);
304 : Isibaar 3 break;
305 :     }
306 : h 30
307 :     config->mode = SendDlgItemMessage(hDlg, IDC_MODE, CB_GETCURSEL, 0, 0);
308 :     config->rc_buffersize = config_get_int(hDlg, IDC_CBRBUFFER, config->rc_buffersize);
309 : Isibaar 3 }
310 :    
311 :    
312 : h 30 /* updates the edit box */
313 : Isibaar 3
314 : h 30 void main_value(HWND hDlg, CONFIG* config)
315 : Isibaar 3 {
316 : h 30 char* text;
317 : Isibaar 3 int value;
318 : h 30 int enabled = TRUE;
319 : Isibaar 3
320 : h 30 switch (config->mode)
321 : Isibaar 3 {
322 : h 30 default :
323 :     enabled = FALSE;
324 : Isibaar 3
325 : h 30 case DLG_MODE_CBR :
326 :     text = "Bitrate (Kbps):";
327 :     value = config->bitrate / CONFIG_KBPS;
328 : Isibaar 3 break;
329 :    
330 : h 30 case DLG_MODE_VBR_QUAL :
331 :     text = "Quality:";
332 :     value = config->quality;
333 : Isibaar 3 break;
334 :    
335 : h 30 case DLG_MODE_VBR_QUANT :
336 :     text = "Quantizer:";
337 :     value = config->quant;
338 : Isibaar 3 break;
339 :    
340 : h 30 case DLG_MODE_2PASS_2_INT :
341 :     text = "Desired size (Kbtyes):";
342 :     value = config->desired_size;
343 : Isibaar 3 break;
344 :     }
345 : h 30
346 :     SetDlgItemText(hDlg, IDC_VALUE_STATIC, text);
347 :     SetDlgItemInt(hDlg, IDC_VALUE, value, FALSE);
348 :    
349 :     EnableWindow(GetDlgItem(hDlg, IDC_VALUE_STATIC), enabled);
350 :     EnableWindow(GetDlgItem(hDlg, IDC_VALUE), enabled);
351 :     EnableWindow(GetDlgItem(hDlg, IDC_CBRBUFFER_STATIC), (config->mode == DLG_MODE_CBR));
352 :     EnableWindow(GetDlgItem(hDlg, IDC_CBRBUFFER), (config->mode == DLG_MODE_CBR));
353 : Isibaar 3 }
354 :    
355 :    
356 :     /* updates the slider */
357 :    
358 : h 30 void main_slider(HWND hDlg, CONFIG * config)
359 : Isibaar 3 {
360 :     char* text;
361 :     long range;
362 :     int pos;
363 : h 30 int enabled = TRUE;
364 : Isibaar 3
365 :     switch (config->mode)
366 :     {
367 :     default :
368 : h 30 enabled = FALSE;
369 :    
370 : Isibaar 3 case DLG_MODE_CBR :
371 :     text = "Bitrate (Kbps):";
372 :     range = MAKELONG(0,10000);
373 :     pos = config->bitrate / CONFIG_KBPS;
374 :     break;
375 :    
376 :     case DLG_MODE_VBR_QUAL :
377 :     text = "Quality:";
378 :     range = MAKELONG(0,100);
379 :     pos = config->quality;
380 :     break;
381 :    
382 :     case DLG_MODE_VBR_QUANT :
383 :     text = "Quantizer:";
384 :     range = MAKELONG(1,31);
385 :     pos = config->quant;
386 :     break;
387 :     }
388 :    
389 :     SetDlgItemText(hDlg, IDC_SLIDER_STATIC, text);
390 :     SendDlgItemMessage(hDlg, IDC_SLIDER, TBM_SETRANGE, TRUE, range);
391 :     SendDlgItemMessage(hDlg, IDC_SLIDER, TBM_SETPOS, TRUE, pos);
392 : h 30
393 :     EnableWindow(GetDlgItem(hDlg, IDC_SLIDER_STATIC), enabled);
394 :     EnableWindow(GetDlgItem(hDlg, IDC_SLIDER), enabled);
395 : Isibaar 3 }
396 :    
397 :    
398 : h 30 /* load advanced options property sheet */
399 : Isibaar 3
400 : h 30 void adv_dialog(HWND hParent, CONFIG * config)
401 : Isibaar 3 {
402 : h 30 PROPSHEETINFO psi[DLG_COUNT];
403 :     PROPSHEETPAGE psp[DLG_COUNT];
404 :     PROPSHEETHEADER psh;
405 :     CONFIG temp;
406 :     int i;
407 : Isibaar 3
408 : h 30 config->save = FALSE;
409 :     memcpy(&temp, config, sizeof(CONFIG));
410 :    
411 :     for (i=0 ; i<DLG_COUNT ; ++i)
412 : Isibaar 3 {
413 : h 30 psp[i].dwSize = sizeof(PROPSHEETPAGE);
414 :     psp[i].dwFlags = 0;
415 :     psp[i].hInstance = hInst;
416 :     psp[i].pfnDlgProc = adv_proc;
417 :     psp[i].lParam = (LPARAM)&psi[i];
418 :     psp[i].pfnCallback = NULL;
419 : Isibaar 3
420 : h 30 psi[i].page = i;
421 :     psi[i].config = &temp;
422 :     }
423 : Isibaar 3
424 : h 30 psp[DLG_GLOBAL].pszTemplate = MAKEINTRESOURCE(IDD_GLOBAL);
425 :     psp[DLG_QUANT].pszTemplate = MAKEINTRESOURCE(IDD_QUANT);
426 :     psp[DLG_2PASS].pszTemplate = MAKEINTRESOURCE(IDD_2PASS);
427 : h 61 psp[DLG_2PASSALT].pszTemplate = MAKEINTRESOURCE(IDD_2PASSALT);
428 : h 30 psp[DLG_CREDITS].pszTemplate = MAKEINTRESOURCE(IDD_CREDITS);
429 :     psp[DLG_CPU].pszTemplate = MAKEINTRESOURCE(IDD_CPU);
430 :    
431 :     psh.dwSize = sizeof(PROPSHEETHEADER);
432 :     psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW;
433 :     psh.hwndParent = hParent;
434 :     psh.hInstance = hInst;
435 :     psh.pszCaption = (LPSTR) "XviD Configuration";
436 :     psh.nPages = DLG_COUNT;
437 :     psh.nStartPage = DLG_GLOBAL;
438 :     psh.ppsp = (LPCPROPSHEETPAGE)&psp;
439 :     psh.pfnCallback = NULL;
440 :    
441 :     PropertySheet(&psh);
442 :    
443 :     if (temp.save)
444 :     {
445 :     memcpy(config, &temp, sizeof(CONFIG));
446 : Isibaar 3 }
447 : h 30 }
448 : Isibaar 3
449 : h 30
450 :     /* enable/disable advanced controls based on encoder mode */
451 :    
452 :     #define CONTROLDLG(X,Y) EnableWindow(GetDlgItem(hDlg, (X)), (Y))
453 :     #define ISDLGSET(X) (IsDlgButtonChecked(hDlg, (X)) == BST_CHECKED)
454 :    
455 : h 61 #define MOD_CBR
456 :    
457 : h 30 void adv_mode(HWND hDlg, int mode)
458 :     {
459 :     // create arrays of controls to be disabled for each mode
460 :     const int cbr_disable[] = {
461 : h 109 IDC_KFBOOST, IDC_DISCARD1PASS, IDC_DUMMY2PASS,
462 : h 30 IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP,
463 :     IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE,
464 :     IDC_CREDITS_START, IDC_CREDITS_END, IDC_CREDITS_START_BEGIN, IDC_CREDITS_START_END,
465 :     IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO,
466 :     IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO,
467 :     IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP,
468 :     IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE,
469 :     };
470 :    
471 :     const int qual_disable[] = {
472 : h 109 IDC_KFBOOST, IDC_DISCARD1PASS, IDC_DUMMY2PASS,
473 : h 30 IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP,
474 :     IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE,
475 :     IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE
476 :     };
477 :    
478 :     const int quant_disable[] = {
479 :     IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT,
480 : h 109 IDC_KFBOOST, IDC_DISCARD1PASS, IDC_DUMMY2PASS,
481 : h 30 IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP,
482 :     IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE,
483 :     IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE
484 :     };
485 :    
486 :     const int twopass1_disable[] = {
487 :     IDC_LUMMASK, IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT,
488 :     IDC_KFBOOST, IDC_DUMMY2PASS,
489 :     IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP,
490 :     IDC_STATS2, IDC_STATS2_BROWSE,
491 :     IDC_CREDITS_RATE_RADIO, IDC_CREDITS_RATE, IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC,
492 :     IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE
493 :     };
494 :    
495 :     const int twopass2_ext_disable[] = {
496 :     IDC_CREDITS_RATE_RADIO, IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC,
497 :     IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE,
498 :     IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE
499 :     };
500 :    
501 :     const int twopass2_int_disable[] = {
502 :     IDC_STATS2, IDC_STATS2_BROWSE
503 :     };
504 :    
505 :     // store pointers in order so we can lookup using config->mode
506 :     const int* modes[] = {
507 :     cbr_disable, qual_disable, quant_disable,
508 :     twopass1_disable, twopass2_ext_disable, twopass2_int_disable
509 :     };
510 :    
511 :     // ditto modes[]
512 :     const int lengths[] = {
513 :     sizeof(cbr_disable)/sizeof(int), sizeof(qual_disable)/sizeof(int),
514 :     sizeof(quant_disable)/sizeof(int), sizeof(twopass1_disable)/sizeof(int),
515 :     sizeof(twopass2_ext_disable)/sizeof(int), sizeof(twopass2_int_disable)/sizeof(int)
516 :     };
517 :    
518 :     int i;
519 :    
520 :     // first perform checkbox-based enable/disable
521 : h 102 CONTROLDLG(IDC_HINTFILE, ISDLGSET(IDC_HINTEDME));
522 :     CONTROLDLG(IDC_HINT_BROWSE, ISDLGSET(IDC_HINTEDME));
523 :    
524 : h 61 CONTROLDLG(IDC_USEAUTO, ISDLGSET(IDC_USEALT));
525 :     CONTROLDLG(IDC_AUTOSTR, ISDLGSET(IDC_USEALT) && ISDLGSET(IDC_USEAUTO));
526 :     CONTROLDLG(IDC_USEAUTOBONUS, ISDLGSET(IDC_USEALT));
527 :     CONTROLDLG(IDC_BONUSBIAS, (ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTOBONUS))));
528 :     CONTROLDLG(IDC_CURVETYPE, ISDLGSET(IDC_USEALT));
529 :     CONTROLDLG(IDC_ALTCURVEHIGH, ISDLGSET(IDC_USEALT));
530 :     CONTROLDLG(IDC_ALTCURVELOW, ISDLGSET(IDC_USEALT));
531 :     CONTROLDLG(IDC_MINQUAL, ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTO)));
532 :    
533 : h 30 CONTROLDLG(IDC_CREDITS_START_BEGIN, ISDLGSET(IDC_CREDITS_START));
534 :     CONTROLDLG(IDC_CREDITS_START_END, ISDLGSET(IDC_CREDITS_START));
535 :    
536 :     CONTROLDLG(IDC_CREDITS_END_BEGIN, ISDLGSET(IDC_CREDITS_END));
537 :     CONTROLDLG(IDC_CREDITS_END_END, ISDLGSET(IDC_CREDITS_END));
538 :    
539 :     CONTROLDLG(IDC_CREDITS_RATE, ISDLGSET(IDC_CREDITS_RATE_RADIO));
540 :     CONTROLDLG(IDC_CREDITS_QUANTI, ISDLGSET(IDC_CREDITS_QUANT_RADIO));
541 :     CONTROLDLG(IDC_CREDITS_QUANTP, ISDLGSET(IDC_CREDITS_QUANT_RADIO));
542 :     CONTROLDLG(IDC_CREDITS_START_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO));
543 :     CONTROLDLG(IDC_CREDITS_END_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO));
544 :    
545 :     CONTROLDLG(IDC_CPU_MMX, ISDLGSET(IDC_CPU_FORCE));
546 :     CONTROLDLG(IDC_CPU_MMXEXT, ISDLGSET(IDC_CPU_FORCE));
547 :     CONTROLDLG(IDC_CPU_SSE, ISDLGSET(IDC_CPU_FORCE));
548 :     CONTROLDLG(IDC_CPU_SSE2, ISDLGSET(IDC_CPU_FORCE));
549 :     CONTROLDLG(IDC_CPU_3DNOW, ISDLGSET(IDC_CPU_FORCE));
550 :     CONTROLDLG(IDC_CPU_3DNOWEXT, ISDLGSET(IDC_CPU_FORCE));
551 :    
552 :     // now perform codec mode enable/disable
553 :     for (i=0 ; i<lengths[mode] ; ++i)
554 :     {
555 :     EnableWindow(GetDlgItem(hDlg, modes[mode][i]), FALSE);
556 :     }
557 : Isibaar 3 }
558 :    
559 :    
560 : h 30 /* upload config data into dialog */
561 : Isibaar 3
562 : h 30 void adv_upload(HWND hDlg, int page, CONFIG * config)
563 : Isibaar 3 {
564 : h 30 switch (page)
565 :     {
566 :     case DLG_GLOBAL :
567 :     SendDlgItemMessage(hDlg, IDC_MOTION, CB_SETCURSEL, config->motion_search, 0);
568 :     SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0);
569 :     SendDlgItemMessage(hDlg, IDC_FOURCC, CB_SETCURSEL, config->fourcc_used, 0);
570 :     SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE);
571 : h 109 SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE);
572 : h 30 CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED);
573 : h 102 CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED);
574 : h 30 break;
575 : Isibaar 3
576 : h 30 case DLG_QUANT :
577 :     SetDlgItemInt(hDlg, IDC_MINIQUANT, config->min_iquant, FALSE);
578 :     SetDlgItemInt(hDlg, IDC_MAXIQUANT, config->max_iquant, FALSE);
579 :     SetDlgItemInt(hDlg, IDC_MINPQUANT, config->min_pquant, FALSE);
580 :     SetDlgItemInt(hDlg, IDC_MAXPQUANT, config->max_pquant, FALSE);
581 :     break;
582 : Isibaar 3
583 : h 30 case DLG_2PASS :
584 :     SetDlgItemInt(hDlg, IDC_KFBOOST, config->keyframe_boost, FALSE);
585 :     CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED);
586 :     CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED);
587 :    
588 :     SetDlgItemInt(hDlg, IDC_CURVECOMPH, config->curve_compression_high, FALSE);
589 :     SetDlgItemInt(hDlg, IDC_CURVECOMPL, config->curve_compression_low, FALSE);
590 :     SetDlgItemInt(hDlg, IDC_PAYBACK, config->bitrate_payback_delay, FALSE);
591 :     CheckDlgButton(hDlg, IDC_PAYBACKBIAS, (config->bitrate_payback_method == 0));
592 :     CheckDlgButton(hDlg, IDC_PAYBACKPROP, (config->bitrate_payback_method == 1));
593 :    
594 : h 102 CheckDlgButton(hDlg, IDC_HINTEDME, config->hinted_me ? BST_CHECKED : BST_UNCHECKED);
595 :     SetDlgItemText(hDlg, IDC_HINTFILE, config->hintfile);
596 : h 30 SetDlgItemText(hDlg, IDC_STATS1, config->stats1);
597 :     SetDlgItemText(hDlg, IDC_STATS2, config->stats2);
598 :     break;
599 :    
600 : h 61 case DLG_2PASSALT :
601 :     CheckDlgButton(hDlg, IDC_USEALT, config->use_alt_curve ? BST_CHECKED : BST_UNCHECKED);
602 :    
603 :     SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_SETCURSEL, config->alt_curve_type, 0);
604 :     SetDlgItemInt(hDlg, IDC_ALTCURVEHIGH, config->alt_curve_high_dist, FALSE);
605 :     SetDlgItemInt(hDlg, IDC_ALTCURVELOW, config->alt_curve_low_dist, FALSE);
606 :     SetDlgItemInt(hDlg, IDC_MINQUAL, config->alt_curve_min_rel_qual, FALSE);
607 :    
608 :     CheckDlgButton(hDlg, IDC_USEAUTO, config->alt_curve_use_auto ? BST_CHECKED : BST_UNCHECKED);
609 :     SetDlgItemInt(hDlg, IDC_AUTOSTR, config->alt_curve_auto_str, FALSE);
610 :    
611 :     CheckDlgButton(hDlg, IDC_USEAUTOBONUS, config->alt_curve_use_auto_bonus_bias ? BST_CHECKED : BST_UNCHECKED);
612 :     SetDlgItemInt(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias, FALSE);
613 : h 109
614 :     SetDlgItemInt(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate / CONFIG_KBPS, FALSE);
615 :     SetDlgItemInt(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement, FALSE);
616 :     SetDlgItemInt(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation, FALSE);
617 : h 61 break;
618 :    
619 : h 30 case DLG_CREDITS :
620 :     CheckDlgButton(hDlg, IDC_CREDITS_START, config->credits_start ? BST_CHECKED : BST_UNCHECKED);
621 :     SetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, config->credits_start_begin, FALSE);
622 :     SetDlgItemInt(hDlg, IDC_CREDITS_START_END, config->credits_start_end, FALSE);
623 :     CheckDlgButton(hDlg, IDC_CREDITS_END, config->credits_end ? BST_CHECKED : BST_UNCHECKED);
624 :     SetDlgItemInt(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin, FALSE);
625 :     SetDlgItemInt(hDlg, IDC_CREDITS_END_END, config->credits_end_end, FALSE);
626 :    
627 :     SetDlgItemInt(hDlg, IDC_CREDITS_RATE, config->credits_rate, FALSE);
628 :     SetDlgItemInt(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i, FALSE);
629 :     SetDlgItemInt(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p, FALSE);
630 :     SetDlgItemInt(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size, FALSE);
631 :     SetDlgItemInt(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size, FALSE);
632 :    
633 :     if (config->credits_mode == CREDITS_MODE_RATE)
634 :     {
635 :     CheckDlgButton(hDlg, IDC_CREDITS_RATE_RADIO, BST_CHECKED);
636 :     }
637 :     else if (config->credits_mode == CREDITS_MODE_QUANT)
638 :     {
639 :     CheckDlgButton(hDlg, IDC_CREDITS_QUANT_RADIO, BST_CHECKED);
640 :     }
641 :     else // CREDITS_MODE_SIZE
642 :     {
643 :     CheckDlgButton(hDlg, IDC_CREDITS_SIZE_RADIO, BST_CHECKED);
644 :     }
645 :     break;
646 :    
647 :     case DLG_CPU :
648 :     CheckDlgButton(hDlg, IDC_CPU_MMX, (config->cpu & XVID_CPU_MMX) ? BST_CHECKED : BST_UNCHECKED);
649 :     CheckDlgButton(hDlg, IDC_CPU_MMXEXT, (config->cpu & XVID_CPU_MMXEXT) ? BST_CHECKED : BST_UNCHECKED);
650 :     CheckDlgButton(hDlg, IDC_CPU_SSE, (config->cpu & XVID_CPU_SSE) ? BST_CHECKED : BST_UNCHECKED);
651 :     CheckDlgButton(hDlg, IDC_CPU_SSE2, (config->cpu & XVID_CPU_SSE2) ? BST_CHECKED : BST_UNCHECKED);
652 :     CheckDlgButton(hDlg, IDC_CPU_3DNOW, (config->cpu & XVID_CPU_3DNOW) ? BST_CHECKED : BST_UNCHECKED);
653 :     CheckDlgButton(hDlg, IDC_CPU_3DNOWEXT, (config->cpu & XVID_CPU_3DNOWEXT) ? BST_CHECKED : BST_UNCHECKED);
654 :    
655 :     CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE,
656 :     config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO );
657 :     break;
658 : Isibaar 3 }
659 :     }
660 :    
661 :    
662 : h 30 /* download config data from dialog
663 :     replaces invalid values instead of alerting user for now
664 :     */
665 : Isibaar 3
666 : h 30 #define CONSTRAINVAL(X,Y,Z) if((X)<(Y)) X=Y; if((X)>(Z)) X=Z;
667 :    
668 :     void adv_download(HWND hDlg, int page, CONFIG * config)
669 : Isibaar 3 {
670 : h 30 switch (page)
671 :     {
672 :     case DLG_GLOBAL :
673 :     config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0);
674 :     config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0);
675 :     config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0);
676 :     config->max_key_interval = config_get_int(hDlg, IDC_MAXKEY, config->max_key_interval);
677 : h 109 config->min_key_interval = config_get_int(hDlg, IDC_MINKEY, config->min_key_interval);
678 : h 30 config->lum_masking = ISDLGSET(IDC_LUMMASK);
679 : h 102 config->interlacing = ISDLGSET(IDC_INTERLACING);
680 : h 30 break;
681 : Isibaar 3
682 : h 30 case DLG_QUANT :
683 :     config->min_iquant = config_get_int(hDlg, IDC_MINIQUANT, config->min_iquant);
684 :     config->max_iquant = config_get_int(hDlg, IDC_MAXIQUANT, config->max_iquant);
685 :     config->min_pquant = config_get_int(hDlg, IDC_MINPQUANT, config->min_pquant);
686 :     config->max_pquant = config_get_int(hDlg, IDC_MAXPQUANT, config->max_pquant);
687 : Isibaar 3
688 : h 30 CONSTRAINVAL(config->min_iquant, 1, 31);
689 :     CONSTRAINVAL(config->max_iquant, config->min_iquant, 31);
690 :     CONSTRAINVAL(config->min_pquant, 1, 31);
691 :     CONSTRAINVAL(config->max_pquant, config->min_pquant, 31);
692 :     break;
693 :    
694 :     case DLG_2PASS :
695 :     config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE);
696 :     config->discard1pass = ISDLGSET(IDC_DISCARD1PASS);
697 :     config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS);
698 :     config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE);
699 :     config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE);
700 :     config->bitrate_payback_delay = config_get_int(hDlg, IDC_PAYBACK, config->bitrate_payback_delay);
701 :     config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP);
702 : h 102 config->hinted_me = ISDLGSET(IDC_HINTEDME);
703 : h 30
704 : h 102 if (GetDlgItemText(hDlg, IDC_HINTFILE, config->hintfile, MAX_PATH) == 0)
705 :     {
706 :     lstrcpy(config->hintfile, CONFIG_HINTFILE);
707 :     }
708 : h 30 if (GetDlgItemText(hDlg, IDC_STATS1, config->stats1, MAX_PATH) == 0)
709 :     {
710 :     lstrcpy(config->stats1, CONFIG_2PASS_1_FILE);
711 :     }
712 :     if (GetDlgItemText(hDlg, IDC_STATS2, config->stats2, MAX_PATH) == 0)
713 :     {
714 :     lstrcpy(config->stats2, CONFIG_2PASS_2_FILE);
715 :     }
716 :    
717 :     CONSTRAINVAL(config->bitrate_payback_delay, 1, 10000);
718 :     CONSTRAINVAL(config->keyframe_boost, 0, 1000);
719 :     CONSTRAINVAL(config->curve_compression_high, 0, 100);
720 :     CONSTRAINVAL(config->curve_compression_low, 0, 100);
721 :     break;
722 :    
723 : h 61 case DLG_2PASSALT :
724 :     config->use_alt_curve = ISDLGSET(IDC_USEALT);
725 :    
726 :     config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO);
727 :     config->alt_curve_auto_str = config_get_int(hDlg, IDC_AUTOSTR, config->alt_curve_auto_str);
728 :    
729 :     config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS);
730 :     config->alt_curve_bonus_bias = config_get_int(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias);
731 :    
732 :     config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0);
733 :     config->alt_curve_high_dist = config_get_int(hDlg, IDC_ALTCURVEHIGH, config->alt_curve_high_dist);
734 :     config->alt_curve_low_dist = config_get_int(hDlg, IDC_ALTCURVELOW, config->alt_curve_low_dist);
735 :     config->alt_curve_min_rel_qual = config_get_int(hDlg, IDC_MINQUAL, config->alt_curve_min_rel_qual);
736 : h 109
737 :     config->twopass_max_bitrate /= CONFIG_KBPS;
738 :     config->twopass_max_bitrate = config_get_int(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate);
739 :     config->twopass_max_bitrate *= CONFIG_KBPS;
740 :     config->twopass_max_overflow_improvement = config_get_int(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement);
741 :     config->twopass_max_overflow_degradation = config_get_int(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation);
742 :    
743 :     CONSTRAINVAL(config->twopass_max_overflow_improvement, 1, 80);
744 :     CONSTRAINVAL(config->twopass_max_overflow_degradation, 1, 80);
745 : h 61 break;
746 :    
747 : h 30 case DLG_CREDITS :
748 :     config->credits_start = ISDLGSET(IDC_CREDITS_START);
749 :     config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE);
750 :     config->credits_start_end = config_get_int(hDlg, IDC_CREDITS_START_END, config->credits_start_end);
751 :     config->credits_end = ISDLGSET(IDC_CREDITS_END);
752 :     config->credits_end_begin = config_get_int(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin);
753 :     config->credits_end_end = config_get_int(hDlg, IDC_CREDITS_END_END, config->credits_end_end);
754 :    
755 :     config->credits_rate = config_get_int(hDlg, IDC_CREDITS_RATE, config->credits_rate);
756 :     config->credits_quant_i = config_get_int(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i);
757 :     config->credits_quant_p = config_get_int(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p);
758 :     config->credits_start_size = config_get_int(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size);
759 :     config->credits_end_size = config_get_int(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size);
760 :    
761 :     config->credits_mode = 0;
762 :     config->credits_mode = ISDLGSET(IDC_CREDITS_RATE_RADIO) ? CREDITS_MODE_RATE : config->credits_mode;
763 :     config->credits_mode = ISDLGSET(IDC_CREDITS_QUANT_RADIO) ? CREDITS_MODE_QUANT : config->credits_mode;
764 :     config->credits_mode = ISDLGSET(IDC_CREDITS_SIZE_RADIO) ? CREDITS_MODE_SIZE : config->credits_mode;
765 :    
766 :     CONSTRAINVAL(config->credits_rate, 1, 100);
767 :     CONSTRAINVAL(config->credits_quant_i, 1, 31);
768 :     CONSTRAINVAL(config->credits_quant_p, 1, 31);
769 :    
770 :     if (config->credits_start_begin > config->credits_start_end)
771 :     {
772 :     config->credits_start_begin = config->credits_start_end;
773 :     config->credits_start = 0;
774 :     }
775 :     if (config->credits_end_begin > config->credits_end_end)
776 :     {
777 :     config->credits_end_begin = config->credits_end_end;
778 :     config->credits_end = 0;
779 :     }
780 :     break;
781 :    
782 :     case DLG_CPU :
783 :     config->cpu = 0;
784 :     config->cpu |= ISDLGSET(IDC_CPU_MMX) ? XVID_CPU_MMX : 0;
785 :     config->cpu |= ISDLGSET(IDC_CPU_MMXEXT) ? XVID_CPU_MMXEXT: 0;
786 :     config->cpu |= ISDLGSET(IDC_CPU_SSE) ? XVID_CPU_SSE: 0;
787 :     config->cpu |= ISDLGSET(IDC_CPU_SSE2) ? XVID_CPU_SSE2: 0;
788 :     config->cpu |= ISDLGSET(IDC_CPU_3DNOW) ? XVID_CPU_3DNOW: 0;
789 :     config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0;
790 :     config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0;
791 :     break;
792 :     }
793 : Isibaar 3 }
794 :    
795 :    
796 :     void quant_upload(HWND hDlg, CONFIG* config)
797 :     {
798 :     int i;
799 :    
800 :     for (i=0 ; i<64 ; ++i)
801 :     {
802 :     SetDlgItemInt(hDlg, IDC_QINTRA00 + i, config->qmatrix_intra[i], FALSE);
803 :     SetDlgItemInt(hDlg, IDC_QINTER00 + i, config->qmatrix_inter[i], FALSE);
804 :     }
805 :     }
806 :    
807 :    
808 :     void quant_download(HWND hDlg, CONFIG* config)
809 :     {
810 :     int i;
811 :    
812 :     for (i=0 ; i<64 ; ++i)
813 :     {
814 : h 30 int temp;
815 : Isibaar 3
816 : h 30 temp = config_get_int(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]);
817 :     CONSTRAINVAL(temp, 1, 255);
818 :     temp = config->qmatrix_intra[i];
819 :    
820 :     temp = config_get_int(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]);
821 :     CONSTRAINVAL(temp, 1, 255);
822 :     temp = config->qmatrix_inter[i];
823 : Isibaar 3 }
824 :     }
825 :    
826 :    
827 : h 61 /* enumerates child windows, assigns tooltips */
828 : Isibaar 3
829 : h 61 BOOL CALLBACK enum_tooltips(HWND hWnd, LPARAM lParam)
830 : Isibaar 3 {
831 : h 61 char help[500];
832 : Isibaar 3
833 : h 61 if (LoadString(hInst, GetDlgCtrlID(hWnd), help, 500))
834 : Isibaar 3 {
835 : h 61 TOOLINFO ti;
836 : Isibaar 3
837 : h 61 ti.cbSize = sizeof(TOOLINFO);
838 :     ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
839 :     ti.hwnd = GetParent(hWnd);
840 :     ti.uId = (LPARAM)hWnd;
841 :     ti.lpszText = help;
842 : Isibaar 3
843 : h 61 SendMessage(hTooltip, TTM_ADDTOOL, 0, (LPARAM)&ti);
844 : h 30 }
845 : Isibaar 3
846 : h 61 return TRUE;
847 : h 30 }
848 : Isibaar 3
849 :    
850 : h 30 /* main dialog proc */
851 : Isibaar 3
852 : h 30 BOOL CALLBACK main_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
853 :     {
854 :     CONFIG* config = (CONFIG*)GetWindowLong(hDlg, GWL_USERDATA);
855 :    
856 :     switch (uMsg)
857 :     {
858 :     case WM_INITDIALOG :
859 :     SetWindowLong(hDlg, GWL_USERDATA, lParam);
860 :    
861 :     config = (CONFIG*)lParam;
862 :    
863 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"1 Pass - CBR");
864 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"1 Pass - quality");
865 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"1 Pass - quantizer");
866 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"2 Pass - 1st pass");
867 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"2 Pass - 2nd pass Ext.");
868 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"2 Pass - 2nd pass Int.");
869 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"Null - test speed");
870 :    
871 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_SETCURSEL, config->mode, 0);
872 :     SetDlgItemInt(hDlg, IDC_CBRBUFFER, config->rc_buffersize, FALSE);
873 :    
874 : h 61 InitCommonControls();
875 : h 30
876 : h 61 if (hTooltip = CreateWindow(TOOLTIPS_CLASS, NULL, TTS_ALWAYSTIP,
877 :     CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
878 :     NULL, NULL, hInst, NULL))
879 :     {
880 :     SetWindowPos(hTooltip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
881 :     SendMessage(hTooltip, TTM_SETDELAYTIME, TTDT_AUTOMATIC, MAKELONG(1500, 0));
882 :     SendMessage(hTooltip, TTM_SETMAXTIPWIDTH, 0, 400);
883 : h 30
884 : h 61 EnumChildWindows(hDlg, enum_tooltips, 0);
885 : Isibaar 3 }
886 :    
887 : h 61 main_slider(hDlg, config);
888 :     main_value(hDlg, config);
889 : Isibaar 3 break;
890 :    
891 : h 30 case WM_HSCROLL :
892 :     if((HWND)lParam == GetDlgItem(hDlg, IDC_SLIDER))
893 : Isibaar 3 {
894 : h 30 SetDlgItemInt(hDlg, IDC_VALUE, SendMessage((HWND)lParam, TBM_GETPOS, 0, 0), FALSE);
895 : Isibaar 3 }
896 : h 30 else
897 :     {
898 :     return 0;
899 :     }
900 :     break;
901 : Isibaar 3
902 :     case WM_COMMAND :
903 :     if (LOWORD(wParam) == IDC_MODE && HIWORD(wParam) == LBN_SELCHANGE)
904 :     {
905 : h 30 main_download(hDlg, config);
906 :     main_slider(hDlg, config);
907 :     main_value(hDlg, config);
908 : Isibaar 3 }
909 : h 30 else if (LOWORD(wParam) == IDC_ADVANCED && HIWORD(wParam) == BN_CLICKED)
910 : Isibaar 3 {
911 : h 30 adv_dialog(hDlg, config);
912 :    
913 :     if (config->save)
914 :     {
915 :     config_reg_set(config);
916 :     }
917 : Isibaar 3 }
918 : h 61 else if (LOWORD(wParam) == IDC_DEFAULTS && HIWORD(wParam) == BN_CLICKED)
919 :     {
920 :     config_reg_default(config);
921 :    
922 :     SendDlgItemMessage(hDlg, IDC_MODE, CB_SETCURSEL, config->mode, 0);
923 :     SetDlgItemInt(hDlg, IDC_CBRBUFFER, config->rc_buffersize, FALSE);
924 :    
925 :     main_slider(hDlg, config);
926 :     main_value(hDlg, config);
927 :     }
928 : Isibaar 3 else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE)
929 :     {
930 :     int value = config_get_int(hDlg, IDC_VALUE, 1);
931 :     int max = 1;
932 :    
933 : h 30 max = (config->mode == DLG_MODE_CBR) ? 10000 :
934 :     ((config->mode == DLG_MODE_VBR_QUAL) ? 100 :
935 :     ((config->mode == DLG_MODE_VBR_QUANT) ? 31 : 1<<30));
936 : Isibaar 3
937 :     if (value < 1)
938 :     {
939 :     value = 1;
940 :     }
941 :     if (value > max)
942 :     {
943 :     value = max;
944 :     SetDlgItemInt(hDlg, IDC_VALUE, value, FALSE);
945 :     }
946 :    
947 : h 30 if (config->mode != DLG_MODE_2PASS_2_INT)
948 : Isibaar 3 {
949 : h 30 SendDlgItemMessage(hDlg, IDC_SLIDER, TBM_SETPOS, TRUE, value);
950 : Isibaar 3 }
951 :     }
952 : h 30 else if (LOWORD(wParam) == IDOK && HIWORD(wParam) == BN_CLICKED)
953 : Isibaar 3 {
954 : h 30 main_download(hDlg, config);
955 :     config->save = TRUE;
956 :     EndDialog(hDlg, IDOK);
957 : Isibaar 3 }
958 : h 30 else if (LOWORD(wParam) == IDCANCEL)
959 : Isibaar 3 {
960 : h 30 config->save = FALSE;
961 :     EndDialog(hDlg, IDCANCEL);
962 : Isibaar 3 }
963 :     break;
964 :    
965 :     default :
966 :     return 0;
967 :     }
968 :    
969 :     return 1;
970 :     }
971 :    
972 :    
973 : h 30 /* advanced dialog proc */
974 : Isibaar 3
975 : h 30 BOOL CALLBACK adv_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
976 : Isibaar 3 {
977 : h 30 PROPSHEETINFO *psi;
978 : Isibaar 3
979 : h 30 psi = (PROPSHEETINFO*)GetWindowLong(hDlg, GWL_USERDATA);
980 :    
981 : Isibaar 3 switch (uMsg)
982 :     {
983 :     case WM_INITDIALOG :
984 : h 30 psi = (PROPSHEETINFO*) ((LPPROPSHEETPAGE)lParam)->lParam;
985 : Isibaar 3
986 : h 30 SetWindowLong(hDlg, GWL_USERDATA, (LPARAM)psi);
987 : Isibaar 3
988 : h 30 if (psi->page == DLG_GLOBAL)
989 : Isibaar 3 {
990 : h 30 SendDlgItemMessage(hDlg, IDC_MOTION, CB_ADDSTRING, 0, (LPARAM)"0 - None");
991 :     SendDlgItemMessage(hDlg, IDC_MOTION, CB_ADDSTRING, 0, (LPARAM)"1 - Very Low");
992 :     SendDlgItemMessage(hDlg, IDC_MOTION, CB_ADDSTRING, 0, (LPARAM)"2 - Low");
993 :     SendDlgItemMessage(hDlg, IDC_MOTION, CB_ADDSTRING, 0, (LPARAM)"3 - Medium");
994 :     SendDlgItemMessage(hDlg, IDC_MOTION, CB_ADDSTRING, 0, (LPARAM)"4 - High");
995 :     SendDlgItemMessage(hDlg, IDC_MOTION, CB_ADDSTRING, 0, (LPARAM)"5 - Very High");
996 :     SendDlgItemMessage(hDlg, IDC_MOTION, CB_ADDSTRING, 0, (LPARAM)"6 - Ultra High");
997 : Isibaar 3
998 : h 30 SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"H.263");
999 :     SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG");
1000 :     SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG-Custom");
1001 :     SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"Modulated");
1002 : Isibaar 3
1003 : h 30 SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID");
1004 :     SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX");
1005 :     SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50");
1006 : Isibaar 3 }
1007 : h 61 else if (psi->page == DLG_2PASSALT)
1008 :     {
1009 :     SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Low");
1010 :     SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium");
1011 :     SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High");
1012 :     }
1013 : Isibaar 3
1014 : h 61 if (hTooltip)
1015 :     {
1016 :     EnumChildWindows(hDlg, enum_tooltips, 0);
1017 :     }
1018 :    
1019 : h 30 adv_upload(hDlg, psi->page, psi->config);
1020 :     adv_mode(hDlg, psi->config->mode);
1021 : Isibaar 3 break;
1022 :    
1023 :     case WM_COMMAND :
1024 : h 30 if (HIWORD(wParam) == BN_CLICKED)
1025 : Isibaar 3 {
1026 :     switch (LOWORD(wParam))
1027 :     {
1028 : h 102 case IDC_HINTEDME :
1029 : h 61 case IDC_USEALT :
1030 :     case IDC_USEAUTO :
1031 :     case IDC_USEAUTOBONUS :
1032 : Isibaar 3 case IDC_CREDITS_START :
1033 :     case IDC_CREDITS_END :
1034 :     case IDC_CREDITS_RATE_RADIO :
1035 :     case IDC_CREDITS_QUANT_RADIO :
1036 :     case IDC_CREDITS_SIZE_RADIO :
1037 : h 30 case IDC_CPU_AUTO :
1038 :     case IDC_CPU_FORCE :
1039 :     adv_mode(hDlg, psi->config->mode);
1040 : Isibaar 3 break;
1041 : h 30 }
1042 :     }
1043 : h 102 if ((LOWORD(wParam) == IDC_HINT_BROWSE || LOWORD(wParam) == IDC_STATS1_BROWSE || LOWORD(wParam) == IDC_STATS2_BROWSE) && HIWORD(wParam) == BN_CLICKED)
1044 : h 30 {
1045 :     OPENFILENAME ofn;
1046 :     char tmp[MAX_PATH];
1047 :     int hComponent = (LOWORD(wParam) == IDC_STATS1_BROWSE ? IDC_STATS1 : IDC_STATS2);
1048 : Isibaar 3
1049 : h 30 GetDlgItemText(hDlg, hComponent, tmp, MAX_PATH);
1050 : Isibaar 3
1051 : h 30 memset(&ofn, 0, sizeof(OPENFILENAME));
1052 :     ofn.lStructSize = sizeof(OPENFILENAME);
1053 : Isibaar 3
1054 : h 30 ofn.hwndOwner = hDlg;
1055 :     ofn.lpstrFilter = "bitrate curve (*.stats)\0*.stats\0All files (*.*)\0*.*\0\0";
1056 :     ofn.lpstrFile = tmp;
1057 :     ofn.nMaxFile = MAX_PATH;
1058 :     ofn.Flags = OFN_PATHMUSTEXIST;
1059 : Isibaar 3
1060 : h 102 if (LOWORD(wParam) == IDC_HINT_BROWSE)
1061 :     {
1062 :     ofn.lpstrFilter = "motion hints (*.mvh)\0*.mvh\0All files (*.*)\0*.*\0\0";
1063 :     if (GetOpenFileName(&ofn))
1064 :     {
1065 :     SetDlgItemText(hDlg, IDC_HINTFILE, tmp);
1066 :     }
1067 :     }
1068 :     else if (LOWORD(wParam) == IDC_STATS1_BROWSE &&
1069 : h 30 psi->config->mode == DLG_MODE_2PASS_1)
1070 :     {
1071 :     ofn.Flags |= OFN_OVERWRITEPROMPT;
1072 :     if (GetSaveFileName(&ofn))
1073 : Isibaar 3 {
1074 : h 30 SetDlgItemText(hDlg, hComponent, tmp);
1075 : Isibaar 3 }
1076 : h 30 }
1077 :     else
1078 :     {
1079 :     ofn.Flags |= OFN_FILEMUSTEXIST;
1080 :     if (GetOpenFileName(&ofn)) {
1081 :     SetDlgItemText(hDlg, hComponent, tmp);
1082 : Isibaar 3 }
1083 :     }
1084 :     }
1085 : h 30 else if (LOWORD(wParam) == IDC_QUANTMATRIX && HIWORD(wParam) == BN_CLICKED)
1086 :     {
1087 :     DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_QUANTMATRIX), hDlg, quantmatrix_proc, (LPARAM)psi->config);
1088 :     }
1089 : Isibaar 3 break;
1090 :    
1091 : h 30 case WM_NOTIFY :
1092 :     switch (((NMHDR *)lParam)->code)
1093 : Isibaar 3 {
1094 : h 30 case PSN_KILLACTIVE :
1095 :     /* validate */
1096 :     adv_download(hDlg, psi->page, psi->config);
1097 :     SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
1098 :     break;
1099 : Isibaar 3
1100 : h 30 case PSN_APPLY :
1101 :     /* apply */
1102 :     adv_download(hDlg, psi->page, psi->config);
1103 :     SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
1104 :     psi->config->save = TRUE;
1105 :     break;
1106 : Isibaar 3 }
1107 :     break;
1108 :    
1109 :     default :
1110 :     return 0;
1111 :     }
1112 :    
1113 :     return 1;
1114 :     }
1115 :    
1116 :    
1117 :     /* quantization matrix dialog proc */
1118 :    
1119 :     BOOL CALLBACK quantmatrix_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
1120 :     {
1121 :     CONFIG* config = (CONFIG*)GetWindowLong(hDlg, GWL_USERDATA);
1122 :    
1123 :     switch (uMsg)
1124 :     {
1125 :     case WM_INITDIALOG :
1126 :     SetWindowLong(hDlg, GWL_USERDATA, lParam);
1127 :     config = (CONFIG*)lParam;
1128 :     quant_upload(hDlg, config);
1129 :    
1130 : h 61 if (hTooltip)
1131 : h 30 {
1132 : h 61 EnumChildWindows(hDlg, enum_tooltips, 0);
1133 : h 30 }
1134 : h 61 break;
1135 : h 30
1136 : Isibaar 3 case WM_COMMAND :
1137 :     if (LOWORD(wParam) == IDOK && HIWORD(wParam) == BN_CLICKED)
1138 :     {
1139 :     quant_download(hDlg, config);
1140 :     EndDialog(hDlg, IDOK);
1141 :     }
1142 :     else if (LOWORD(wParam) == IDCANCEL)
1143 :     {
1144 :     EndDialog(hDlg, IDCANCEL);
1145 :     }
1146 :     else if ((LOWORD(wParam) == IDC_LOAD || LOWORD(wParam) == IDC_SAVE) && HIWORD(wParam) == BN_CLICKED)
1147 :     {
1148 :     OPENFILENAME ofn;
1149 :     char file[MAX_PATH];
1150 :    
1151 :     HANDLE hFile;
1152 :     DWORD read=128, wrote=0;
1153 :     BYTE quant_data[128];
1154 :    
1155 :     strcpy(file, "\\matrix");
1156 :     memset(&ofn, 0, sizeof(OPENFILENAME));
1157 :     ofn.lStructSize = sizeof(OPENFILENAME);
1158 :    
1159 :     ofn.hwndOwner = hDlg;
1160 :     ofn.lpstrFilter = "All files (*.*)\0*.*\0\0";
1161 :     ofn.lpstrFile = file;
1162 :     ofn.nMaxFile = MAX_PATH;
1163 :     ofn.Flags = OFN_PATHMUSTEXIST;
1164 :    
1165 :     if (LOWORD(wParam) == IDC_SAVE)
1166 :     {
1167 :     ofn.Flags |= OFN_OVERWRITEPROMPT;
1168 :     if (GetSaveFileName(&ofn))
1169 :     {
1170 :     hFile = CreateFile(file, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
1171 :    
1172 :     quant_download(hDlg, config);
1173 :     memcpy(quant_data, config->qmatrix_intra, 64);
1174 :     memcpy(quant_data+64, config->qmatrix_inter, 64);
1175 :    
1176 :     if (hFile == INVALID_HANDLE_VALUE)
1177 :     {
1178 : h 61 DEBUGERR("Couldn't save quant matrix");
1179 : Isibaar 3 }
1180 :     else
1181 :     {
1182 :     if (!WriteFile(hFile, quant_data, 128, &wrote, 0))
1183 :     {
1184 : h 61 DEBUGERR("Couldnt write quant matrix");
1185 : Isibaar 3 }
1186 :     }
1187 :    
1188 :     CloseHandle(hFile);
1189 :     }
1190 :     }
1191 :     else
1192 :     {
1193 :     ofn.Flags |= OFN_FILEMUSTEXIST;
1194 :     if (GetOpenFileName(&ofn))
1195 :     {
1196 :     hFile = CreateFile(file, GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
1197 :    
1198 :     if (hFile == INVALID_HANDLE_VALUE)
1199 :     {
1200 : h 61 DEBUGERR("Couldn't load quant matrix");
1201 : Isibaar 3 }
1202 :     else
1203 :     {
1204 :     if (!ReadFile(hFile, quant_data, 128, &read, 0))
1205 :     {
1206 : h 61 DEBUGERR("Couldnt read quant matrix");
1207 : Isibaar 3 }
1208 :     else
1209 :     {
1210 :     memcpy(config->qmatrix_intra, quant_data, 64);
1211 :     memcpy(config->qmatrix_inter, quant_data+64, 64);
1212 :     quant_upload(hDlg, config);
1213 :     }
1214 :     }
1215 :    
1216 :     CloseHandle(hFile);
1217 :     }
1218 :     }
1219 :     }
1220 :     break;
1221 :    
1222 :     default :
1223 :     return 0;
1224 :     }
1225 :    
1226 :     return 1;
1227 :     }
1228 : h 30
1229 :    
1230 :     /* about dialog proc */
1231 :    
1232 :     BOOL CALLBACK about_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
1233 :     {
1234 :     switch (uMsg)
1235 :     {
1236 :     case WM_INITDIALOG :
1237 :     {
1238 :     XVID_INIT_PARAM init_param;
1239 :     char core[100];
1240 :     HFONT hFont;
1241 :     LOGFONT lfData;
1242 :    
1243 : h 61 SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD);
1244 : h 30
1245 :     xvid_init(NULL, 0, &init_param, 0);
1246 :     wsprintf(core, "Core Version %d.%d", (init_param.api_version>>16),(init_param.api_version&0xFFFFU));
1247 :     SetDlgItemText(hDlg, IDC_CORE, core);
1248 :    
1249 :     hFont = (HFONT)SendDlgItemMessage(hDlg, IDC_WEBSITE, WM_GETFONT, 0, 0L);
1250 :    
1251 :     if (GetObject(hFont, sizeof(LOGFONT), &lfData))
1252 :     {
1253 :     lfData.lfUnderline = 1;
1254 :    
1255 :     hFont = CreateFontIndirect(&lfData);
1256 :     if (hFont)
1257 :     {
1258 :     SendDlgItemMessage(hDlg, IDC_WEBSITE, WM_SETFONT, (WPARAM)hFont, 1L);
1259 :     }
1260 :     }
1261 :    
1262 :     SetClassLong(GetDlgItem(hDlg, IDC_WEBSITE), GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_HAND));
1263 :     SetDlgItemText(hDlg, IDC_WEBSITE, XVID_WEBSITE);
1264 :     }
1265 :     break;
1266 :    
1267 :     case WM_CTLCOLORSTATIC :
1268 :     if ((HWND)lParam == GetDlgItem(hDlg, IDC_WEBSITE))
1269 :     {
1270 :     SetBkMode((HDC)wParam, TRANSPARENT) ;
1271 :     SetTextColor((HDC)wParam, RGB(0x00,0x00,0xc0));
1272 :     return (BOOL)GetStockObject(NULL_BRUSH);
1273 :     }
1274 :     return 0;
1275 :    
1276 :     case WM_COMMAND :
1277 :     if (LOWORD(wParam) == IDC_WEBSITE && HIWORD(wParam) == STN_CLICKED)
1278 :     {
1279 :     ShellExecute(hDlg, "open", XVID_WEBSITE, NULL, NULL, SW_SHOWNORMAL);
1280 :     }
1281 :     else if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
1282 :     {
1283 :     EndDialog(hDlg, LOWORD(wParam));
1284 :     }
1285 :     break;
1286 :    
1287 :     default :
1288 :     return 0;
1289 :     }
1290 :    
1291 :     return 1;
1292 :     }

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4