500 |
return (success) ? tmp : config; |
return (success) ? tmp : config; |
501 |
} |
} |
502 |
|
|
503 |
|
/* get uint from combobox |
504 |
|
GetDlgItemInt doesnt work properly for cb list items */ |
505 |
|
#define UINT_BUF_SZ 20 |
506 |
|
static int config_get_cbuint(HWND hDlg, UINT item, int def) |
507 |
|
{ |
508 |
|
int sel = SendMessage(GetDlgItem(hDlg, item), CB_GETCURSEL, 0, 0); |
509 |
|
char buf[UINT_BUF_SZ]; |
510 |
|
|
511 |
|
if (sel<0) { |
512 |
|
return config_get_uint(hDlg, item, def); |
513 |
|
} |
514 |
|
|
515 |
|
if (SendMessage(GetDlgItem(hDlg, item), CB_GETLBTEXT, sel, (LPARAM)buf) == CB_ERR) { |
516 |
|
return def; |
517 |
|
} |
518 |
|
|
519 |
|
return atoi(buf); |
520 |
|
} |
521 |
|
|
522 |
|
|
523 |
/* we use "100 base" floats */ |
/* we use "100 base" floats */ |
524 |
|
|
750 |
|
|
751 |
SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"665600"); |
SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"665600"); |
752 |
SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"716800"); |
SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"716800"); |
753 |
|
SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"1331200"); |
754 |
|
SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"1433600"); |
755 |
|
|
756 |
for (i=0; i<sizeof(video_fps_list)/sizeof(named_float_t); i++) |
for (i=0; i<sizeof(video_fps_list)/sizeof(named_float_t); i++) |
757 |
SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_ADDSTRING, 0, (LPARAM)video_fps_list[i].name); |
SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_ADDSTRING, 0, (LPARAM)video_fps_list[i].name); |
770 |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"224"); |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"224"); |
771 |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"256"); |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"256"); |
772 |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"384"); |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"384"); |
773 |
|
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"448"); |
774 |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"512"); |
SendDlgItemMessage(hDlg, IDC_BITRATE_ARATE, CB_ADDSTRING, 0, (LPARAM)"512"); |
775 |
break; |
break; |
776 |
|
|
885 |
case IDD_BITRATE : |
case IDD_BITRATE : |
886 |
{ |
{ |
887 |
int ctype = SendDlgItemMessage(hDlg, IDC_BITRATE_CFORMAT, CB_GETCURSEL, 0, 0); |
int ctype = SendDlgItemMessage(hDlg, IDC_BITRATE_CFORMAT, CB_GETCURSEL, 0, 0); |
888 |
int target_size = config_get_uint(hDlg, IDC_BITRATE_TSIZE, 0); |
int target_size = config_get_cbuint(hDlg, IDC_BITRATE_TSIZE, 0); |
889 |
int subtitle_size = config_get_uint(hDlg, IDC_BITRATE_SSIZE, 0); |
int subtitle_size = config_get_uint(hDlg, IDC_BITRATE_SSIZE, 0); |
890 |
int fps = SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_GETCURSEL, 0, 0); |
int fps = SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_GETCURSEL, 0, 0); |
891 |
|
|
896 |
|
|
897 |
int audio_type = SendDlgItemMessage(hDlg, IDC_BITRATE_AFORMAT, CB_GETCURSEL, 0, 0); |
int audio_type = SendDlgItemMessage(hDlg, IDC_BITRATE_AFORMAT, CB_GETCURSEL, 0, 0); |
898 |
int audio_mode = IsDlgChecked(hDlg, IDC_BITRATE_AMODE_SIZE); |
int audio_mode = IsDlgChecked(hDlg, IDC_BITRATE_AMODE_SIZE); |
899 |
int audio_rate = config_get_uint(hDlg, IDC_BITRATE_ARATE, 0); |
int audio_rate = config_get_cbuint(hDlg, IDC_BITRATE_ARATE, 0); |
900 |
int audio_size = config_get_uint(hDlg, IDC_BITRATE_ASIZE, 0); |
int audio_size = config_get_uint(hDlg, IDC_BITRATE_ASIZE, 0); |
901 |
|
|
902 |
int frames; |
int frames; |
1270 |
int bitrate_compensate = (int)(24 * video_fps_list[config->fps].value) / 125; |
int bitrate_compensate = (int)(24 * video_fps_list[config->fps].value) / 125; |
1271 |
|
|
1272 |
config->desired_size = |
config->desired_size = |
1273 |
config_get_uint(hDlg, IDC_BITRATE_VSIZE, config->desired_size) - frame_compensate; |
config_get_uint(hDlg, IDC_BITRATE_VSIZE, config->desired_size) + frame_compensate; |
1274 |
|
|
1275 |
config->bitrate = |
config->bitrate = |
1276 |
config_get_uint(hDlg, IDC_BITRATE_VRATE, config->bitrate) - bitrate_compensate; |
config_get_uint(hDlg, IDC_BITRATE_VRATE, config->bitrate) + bitrate_compensate; |
1277 |
} |
} |
1278 |
break; |
break; |
1279 |
|
|
1497 |
}else if ((HIWORD(wParam) == CBN_EDITCHANGE || HIWORD(wParam)==CBN_SELCHANGE) && |
}else if ((HIWORD(wParam) == CBN_EDITCHANGE || HIWORD(wParam)==CBN_SELCHANGE) && |
1498 |
(LOWORD(wParam)==IDC_BITRATE_TSIZE || |
(LOWORD(wParam)==IDC_BITRATE_TSIZE || |
1499 |
LOWORD(wParam)==IDC_BITRATE_ARATE )) { |
LOWORD(wParam)==IDC_BITRATE_ARATE )) { |
1500 |
|
|
1501 |
adv_mode(hDlg, psi->idd, psi->config); |
adv_mode(hDlg, psi->idd, psi->config); |
1502 |
|
|
1503 |
}else if (HIWORD(wParam) == LBN_SELCHANGE && |
}else if (HIWORD(wParam) == LBN_SELCHANGE && |
1504 |
(LOWORD(wParam) == IDC_PROFILE_PROFILE || |
(LOWORD(wParam) == IDC_PROFILE_PROFILE || |
1505 |
LOWORD(wParam) == IDC_LEVEL_PROFILE || |
LOWORD(wParam) == IDC_LEVEL_PROFILE || |
1546 |
switch (((NMHDR *)lParam)->code) |
switch (((NMHDR *)lParam)->code) |
1547 |
{ |
{ |
1548 |
case PSN_SETACTIVE : |
case PSN_SETACTIVE : |
1549 |
OutputDebugString("PSN_SET"); |
DPRINTF("PSN_SET"); |
1550 |
adv_upload(hDlg, psi->idd, psi->config); |
adv_upload(hDlg, psi->idd, psi->config); |
1551 |
adv_mode(hDlg, psi->idd, psi->config); |
adv_mode(hDlg, psi->idd, psi->config); |
1552 |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
1553 |
break; |
break; |
1554 |
|
|
1555 |
case PSN_KILLACTIVE : |
case PSN_KILLACTIVE : |
1556 |
OutputDebugString("PSN_KILL"); |
DPRINTF("PSN_KILL"); |
1557 |
adv_download(hDlg, psi->idd, psi->config); |
adv_download(hDlg, psi->idd, psi->config); |
1558 |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
1559 |
break; |
break; |
1560 |
|
|
1561 |
case PSN_APPLY : |
case PSN_APPLY : |
1562 |
OutputDebugString("PSN_APPLY"); |
DPRINTF("PSN_APPLY"); |
1563 |
psi->config->save = TRUE; |
psi->config->save = TRUE; |
1564 |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
1565 |
break; |
break; |
1581 |
or fasle if changes were canceled. |
or fasle if changes were canceled. |
1582 |
|
|
1583 |
*/ |
*/ |
1584 |
|
|
1585 |
|
#ifndef PSH_NOCONTEXTHELP |
1586 |
|
#define PSH_NOCONTEXTHELP 0x02000000 |
1587 |
|
#endif |
1588 |
|
|
1589 |
static BOOL adv_dialog(HWND hParent, CONFIG * config, const int * dlgs, int size) |
static BOOL adv_dialog(HWND hParent, CONFIG * config, const int * dlgs, int size) |
1590 |
{ |
{ |
1591 |
PROPSHEETINFO psi[6]; |
PROPSHEETINFO psi[6]; |
1868 |
break; |
break; |
1869 |
} |
} |
1870 |
|
|
|
if (n->code == NM_RCLICK) { |
|
|
OutputDebugString("Right click"); |
|
|
} |
|
1871 |
break; |
break; |
1872 |
} |
} |
1873 |
|
|