From f1e120ba7ea514fbf8c916e7608f9f165fb84135 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 14 Feb 2006 11:36:19 +0100 Subject: [PATCH] msvfw32: Disable datarate, keyframe and quality controls to not confuse users by a not implemented functionality. Add support for About codec control. --- dlls/msvideo/msvideo_main.c | 55 +++++++++++++++++++++++++++++----- dlls/msvideo/msvideo_private.h | 9 ++++++ 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/dlls/msvideo/msvideo_main.c b/dlls/msvideo/msvideo_main.c index 1e1962ae0a9..647124d2f0c 100644 --- a/dlls/msvideo/msvideo_main.c +++ b/dlls/msvideo/msvideo_main.c @@ -772,17 +772,34 @@ static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARA WCHAR buf[128]; struct choose_compressor *choose_comp = (struct choose_compressor *)lparam; + SetWindowLongPtrW(hdlg, DWLP_USER, lparam); + + /* FIXME */ + choose_comp->flags &= ~(ICMF_CHOOSE_DATARATE | ICMF_CHOOSE_KEYFRAME); + if (choose_comp->title) SetWindowTextA(hdlg, choose_comp->title); if (!(choose_comp->flags & ICMF_CHOOSE_DATARATE)) - EnableWindow(GetDlgItem(hdlg, IDC_DATARATE), FALSE); + { + ShowWindow(GetDlgItem(hdlg, IDC_DATARATE_CHECKBOX), SW_HIDE); + ShowWindow(GetDlgItem(hdlg, IDC_DATARATE), SW_HIDE); + ShowWindow(GetDlgItem(hdlg, IDC_DATARATE_KB), SW_HIDE); + } if (!(choose_comp->flags & ICMF_CHOOSE_KEYFRAME)) - EnableWindow(GetDlgItem(hdlg, IDC_KEYFRAME), FALSE); + { + ShowWindow(GetDlgItem(hdlg, IDC_KEYFRAME_CHECKBOX), SW_HIDE); + ShowWindow(GetDlgItem(hdlg, IDC_KEYFRAME), SW_HIDE); + ShowWindow(GetDlgItem(hdlg, IDC_KEYFRAME_FRAMES), SW_HIDE); + } + + /* FIXME */ + EnableWindow(GetDlgItem(hdlg, IDC_QUALITY_SCROLL), FALSE); + EnableWindow(GetDlgItem(hdlg, IDC_QUALITY_TXT), FALSE); /*if (!(choose_comp->flags & ICMF_CHOOSE_PREVIEW)) - EnableWindow(GetDlgItem(hdlg, IDC_PREVIEW), FALSE);*/ + ShowWindow(GetDlgItem(hdlg, IDC_PREVIEW), SW_HIDE);*/ LoadStringW(MSVFW32_hModule, IDS_FULLFRAMES, buf, 128); SendDlgItemMessageW(hdlg, IDC_COMP_LIST, CB_ADDSTRING, 0, (LPARAM)buf); @@ -809,24 +826,41 @@ static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARA { INT cur_sel; struct codec_info *ic; - BOOL enable = FALSE; + BOOL can_configure = FALSE, can_about = FALSE; + struct choose_compressor *choose_comp; - if (HIWORD(wparam) != CBN_SELCHANGE) + if (HIWORD(wparam) != CBN_SELCHANGE && HIWORD(wparam) != CBN_SETFOCUS) break; + choose_comp = (struct choose_compressor *)GetWindowLongPtrW(hdlg, DWLP_USER); + cur_sel = SendMessageW((HWND)lparam, CB_GETCURSEL, 0, 0); ic = (struct codec_info *)SendMessageW((HWND)lparam, CB_GETITEMDATA, cur_sel, 0); if (ic && ic->hic) { if (ICQueryConfigure(ic->hic) == DRVCNF_OK) - enable = TRUE; + can_configure = TRUE; + if (ICQueryAbout(ic->hic) == DRVCNF_OK) + can_about = TRUE; } - EnableWindow(GetDlgItem(hdlg, IDC_CONFIGURE), enable); + EnableWindow(GetDlgItem(hdlg, IDC_CONFIGURE), can_configure); + EnableWindow(GetDlgItem(hdlg, IDC_ABOUT), can_about); + + if (choose_comp->flags & ICMF_CHOOSE_DATARATE) + { + /* FIXME */ + } + if (choose_comp->flags & ICMF_CHOOSE_KEYFRAME) + { + /* FIXME */ + } + break; } case IDC_CONFIGURE: + case IDC_ABOUT: { HWND list = GetDlgItem(hdlg, IDC_COMP_LIST); INT cur_sel; @@ -839,7 +873,12 @@ static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARA ic = (struct codec_info *)SendMessageW(list, CB_GETITEMDATA, cur_sel, 0); if (ic && ic->hic) - ICConfigure(ic->hic, hdlg); + { + if (LOWORD(wparam) == IDC_CONFIGURE) + ICConfigure(ic->hic, hdlg); + else + ICAbout(ic->hic, hdlg); + } break; } diff --git a/dlls/msvideo/msvideo_private.h b/dlls/msvideo/msvideo_private.h index 6631ef856e6..264bd27a11d 100644 --- a/dlls/msvideo/msvideo_private.h +++ b/dlls/msvideo/msvideo_private.h @@ -58,7 +58,16 @@ extern LRESULT (CALLBACK *pFnCallTo16)(HDRVR, HIC, UINT, LPARAM, LPARAM); #define HIC_16(h32) (LOWORD(h32)) #define IDC_CONFIGURE 882 +#define IDC_ABOUT 883 + +#define IDC_QUALITY_SCROLL 884 +#define IDC_QUALITY_TXT 886 + +#define IDC_KEYFRAME_CHECKBOX 887 #define IDC_KEYFRAME 888 +#define IDC_KEYFRAME_FRAMES 889 +#define IDC_DATARATE_CHECKBOX 894 #define IDC_DATARATE 895 +#define IDC_DATARATE_KB 896 #endif /* __WINE_MSVIDEO_PRIVATE_H */