55 |
LPARAM lParam2) |
LPARAM lParam2) |
56 |
{ |
{ |
57 |
CODEC * codec = (CODEC *)dwDriverId; |
CODEC * codec = (CODEC *)dwDriverId; |
|
CONFIG temp; |
|
58 |
|
|
59 |
switch(uMsg) |
switch(uMsg) |
60 |
{ |
{ |
70 |
{ |
{ |
71 |
ICOPEN * icopen = (ICOPEN *)lParam2; |
ICOPEN * icopen = (ICOPEN *)lParam2; |
72 |
|
|
73 |
if (icopen != NULL && icopen->fccType != ICTYPE_VIDEO) { |
if (icopen != NULL && icopen->fccType != ICTYPE_VIDEO) |
74 |
|
{ |
75 |
return DRV_CANCEL; |
return DRV_CANCEL; |
76 |
} |
} |
77 |
codec = malloc(sizeof(CODEC)); |
codec = malloc(sizeof(CODEC)); |
78 |
if (codec == NULL) |
if (codec == NULL) |
79 |
{ |
{ |
80 |
if (icopen != NULL) { |
if (icopen != NULL) |
81 |
|
{ |
82 |
icopen->dwError = ICERR_MEMORY; |
icopen->dwError = ICERR_MEMORY; |
83 |
} |
} |
84 |
return 0; |
return 0; |
86 |
codec->ehandle = codec->dhandle = NULL; |
codec->ehandle = codec->dhandle = NULL; |
87 |
config_reg_get(&codec->config); |
config_reg_get(&codec->config); |
88 |
|
|
89 |
if (icopen != NULL) { |
if (icopen != NULL) |
90 |
|
{ |
91 |
icopen->dwError = ICERR_OK; |
icopen->dwError = ICERR_OK; |
92 |
} |
} |
93 |
return (LRESULT)codec; |
return (LRESULT)codec; |
136 |
|
|
137 |
return lParam2; /* size of struct */ |
return lParam2; /* size of struct */ |
138 |
} |
} |
139 |
|
DEBUG("ICM_GETINFO end"); |
140 |
|
|
141 |
|
|
142 |
/* state control */ |
/* state control */ |
143 |
|
|
144 |
case ICM_ABOUT : |
case ICM_ABOUT : |
145 |
case ICM_CONFIGURE : |
DEBUG("ICM_ABOUT"); |
146 |
|
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ABOUT), (HWND)lParam1, about_proc, 0); |
147 |
|
return ICERR_OK; |
148 |
|
|
149 |
|
case ICM_CONFIGURE : |
150 |
DEBUG("ICM_CONFIGURE"); |
DEBUG("ICM_CONFIGURE"); |
151 |
|
if (lParam1 != -1) |
152 |
|
{ |
153 |
|
CONFIG temp; |
154 |
|
|
155 |
codec->config.save = FALSE; |
codec->config.save = FALSE; |
156 |
memcpy(&temp, &codec->config, sizeof(CONFIG)); |
memcpy(&temp, &codec->config, sizeof(CONFIG)); |
157 |
|
|
158 |
if (lParam1 != -1) { |
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_MAIN), (HWND)lParam1, main_proc, (LPARAM)&temp); |
|
PROPSHEETINFO psi[DLG_COUNT]; |
|
|
PROPSHEETPAGE psp[DLG_COUNT]; |
|
|
PROPSHEETHEADER psh; |
|
|
|
|
|
psp[DLG_MAIN].dwSize = sizeof(PROPSHEETPAGE); |
|
|
psp[DLG_MAIN].dwFlags = 0; |
|
|
psp[DLG_MAIN].hInstance = hInst; |
|
|
psp[DLG_MAIN].pszTemplate = MAKEINTRESOURCE(IDD_MAIN); |
|
|
psp[DLG_MAIN].pfnDlgProc = config_proc; |
|
|
psi[DLG_MAIN].page = DLG_MAIN; |
|
|
psi[DLG_MAIN].config = &temp; |
|
|
psp[DLG_MAIN].lParam = (LPARAM)&psi[DLG_MAIN]; |
|
|
psp[DLG_MAIN].pfnCallback = NULL; |
|
|
|
|
|
psp[DLG_ADV].dwSize = sizeof(PROPSHEETPAGE); |
|
|
psp[DLG_ADV].dwFlags = 0; |
|
|
psp[DLG_ADV].hInstance = hInst; |
|
|
psp[DLG_ADV].pszTemplate = MAKEINTRESOURCE(IDD_ADV); |
|
|
psp[DLG_ADV].pfnDlgProc = config_proc; |
|
|
psi[DLG_ADV].page = DLG_ADV; |
|
|
psi[DLG_ADV].config = &temp; |
|
|
psp[DLG_ADV].lParam = (LPARAM)&psi[DLG_ADV]; |
|
|
psp[DLG_ADV].pfnCallback = NULL; |
|
|
|
|
|
psp[DLG_DEBUG].dwSize = sizeof(PROPSHEETPAGE); |
|
|
psp[DLG_DEBUG].dwFlags = 0; |
|
|
psp[DLG_DEBUG].hInstance = hInst; |
|
|
psp[DLG_DEBUG].pszTemplate = MAKEINTRESOURCE(IDD_DEBUG); |
|
|
psp[DLG_DEBUG].pfnDlgProc = config_proc; |
|
|
psi[DLG_DEBUG].page = DLG_DEBUG; |
|
|
psi[DLG_DEBUG].config = &temp; |
|
|
psp[DLG_DEBUG].lParam = (LPARAM)&psi[DLG_DEBUG]; |
|
|
psp[DLG_DEBUG].pfnCallback = NULL; |
|
|
|
|
|
psp[DLG_CPU].dwSize = sizeof(PROPSHEETPAGE); |
|
|
psp[DLG_CPU].dwFlags = 0; |
|
|
psp[DLG_CPU].hInstance = hInst; |
|
|
psp[DLG_CPU].pszTemplate = MAKEINTRESOURCE(IDD_CPU); |
|
|
psp[DLG_CPU].pfnDlgProc = config_proc; |
|
|
psi[DLG_CPU].page = DLG_CPU; |
|
|
psi[DLG_CPU].config = &temp; |
|
|
psp[DLG_CPU].lParam = (LPARAM)&psi[DLG_CPU]; |
|
|
psp[DLG_CPU].pfnCallback = NULL; |
|
|
|
|
|
psp[DLG_ABOUT].dwSize = sizeof(PROPSHEETPAGE); |
|
|
psp[DLG_ABOUT].dwFlags = 0; |
|
|
psp[DLG_ABOUT].hInstance = hInst; |
|
|
psp[DLG_ABOUT].pszTemplate = MAKEINTRESOURCE(IDD_ABOUT); |
|
|
psp[DLG_ABOUT].pfnDlgProc = config_proc; |
|
|
psi[DLG_ABOUT].page = DLG_ABOUT; |
|
|
psi[DLG_ABOUT].config = &temp; |
|
|
psp[DLG_ABOUT].lParam = (LPARAM)&psi[DLG_ABOUT]; |
|
|
psp[DLG_ABOUT].pfnCallback = NULL; |
|
|
|
|
|
psh.dwSize = sizeof(PROPSHEETHEADER); |
|
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; |
|
|
psh.hwndParent = (HWND)lParam1; |
|
|
psh.hInstance = hInst; |
|
|
psh.pszCaption = (LPSTR) "XviD Configuration"; |
|
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); |
|
|
psh.nStartPage = (uMsg == ICM_CONFIGURE ? DLG_MAIN : DLG_ABOUT); |
|
|
psh.ppsp = (LPCPROPSHEETPAGE)&psp; |
|
|
psh.pfnCallback = NULL; |
|
|
|
|
|
PropertySheet(&psh); |
|
159 |
|
|
160 |
if(temp.save) { |
if (temp.save) |
161 |
|
{ |
162 |
memcpy(&codec->config, &temp, sizeof(CONFIG)); |
memcpy(&codec->config, &temp, sizeof(CONFIG)); |
163 |
|
config_reg_set(&codec->config); |
164 |
} |
} |
165 |
} |
} |
166 |
return ICERR_OK; |
return ICERR_OK; |
167 |
|
|
168 |
case ICM_GETSTATE : |
case ICM_GETSTATE : |
169 |
DEBUG("ICM_GETSTATE"); |
DEBUG("ICM_GETSTATE"); |
170 |
if ((void*)lParam1 == NULL) { |
if ((void*)lParam1 == NULL) |
171 |
|
{ |
172 |
return sizeof(CONFIG); |
return sizeof(CONFIG); |
173 |
} |
} |
174 |
memcpy((void*)lParam1, &codec->config, sizeof(CONFIG)); |
memcpy((void*)lParam1, &codec->config, sizeof(CONFIG)); |
176 |
|
|
177 |
case ICM_SETSTATE : |
case ICM_SETSTATE : |
178 |
DEBUG("ICM_SETSTATE"); |
DEBUG("ICM_SETSTATE"); |
179 |
if ((void*)lParam1 == NULL) { |
if ((void*)lParam1 == NULL) |
180 |
|
{ |
181 |
DEBUG("ICM_SETSTATE : DEFAULT"); |
DEBUG("ICM_SETSTATE : DEFAULT"); |
182 |
config_reg_get(&codec->config); |
config_reg_get(&codec->config); |
183 |
return 0; |
return 0; |