1 |
/***************************************************************************** |
/***************************************************************************** |
2 |
* |
* |
3 |
* XVID MPEG-4 VIDEO CODEC - DShow Front End |
* XVID MPEG-4 VIDEO CODEC - DShow Front End |
4 |
* - About Window - |
* - About Property Page - |
5 |
* |
* |
6 |
* Copyright(C) 2002-2003 Peter Ross <pross@xvid.org> |
* Copyright(C) 2002-2004 Peter Ross <pross@xvid.org> |
7 |
* |
* |
8 |
* This program is free software ; you can redistribute it and/or modify |
* This program is free software ; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
25 |
|
|
26 |
/**************************************************************************** |
/**************************************************************************** |
27 |
* |
* |
28 |
|
* 2004/02/01 - Move configuration processing code into config.c |
29 |
* 2003/12/11 - added some additional options, mainly to make the deblocking |
* 2003/12/11 - added some additional options, mainly to make the deblocking |
30 |
* code from xvidcore available. Most of the new code is taken |
* code from xvidcore available. Most of the new code is taken |
31 |
* from Nic's dshow filter, (C) Nic, http://nic.dnsalias.com |
* from Nic's dshow filter, (C) Nic, http://nic.dnsalias.com |
32 |
* |
* |
33 |
****************************************************************************/ |
****************************************************************************/ |
34 |
|
#include <windows.h> |
|
#include "CAbout.h" |
|
|
#include "resource.h" |
|
|
#include <commdlg.h> |
|
35 |
#include <commctrl.h> |
#include <commctrl.h> |
36 |
|
#include "CAbout.h" |
37 |
#include "CXvidDecoder.h" |
#include "CXvidDecoder.h" |
38 |
|
#include "resource.h" |
39 |
|
#include "config.h" |
40 |
|
|
|
void SaveRegistryInfo() |
|
|
{ |
|
|
HKEY hKey; |
|
|
DWORD dispo; |
|
|
|
|
|
if (RegCreateKeyEx( |
|
|
XVID_REG_KEY, |
|
|
XVID_REG_SUBKEY, |
|
|
0, |
|
|
XVID_REG_CLASS, |
|
|
REG_OPTION_NON_VOLATILE, |
|
|
KEY_WRITE, |
|
|
0, |
|
|
&hKey, |
|
|
&dispo) != ERROR_SUCCESS) |
|
|
{ |
|
|
OutputDebugString("Couldn't create XVID_REG_SUBKEY"); |
|
|
return; |
|
|
} |
|
41 |
|
|
|
REG_SET_N("Brightness", PPSettings.nBrightness); |
|
|
REG_SET_N("Deblock_Y", PPSettings.bDeblock_Y); |
|
|
REG_SET_N("Deblock_UV", PPSettings.bDeblock_UV); |
|
|
REG_SET_N("Dering", PPSettings.bDering); |
|
|
REG_SET_N("FilmEffect", PPSettings.bFilmEffect); |
|
|
REG_SET_N("ForceColorspace", PPSettings.nForceColorspace); |
|
|
|
|
|
RegCloseKey(hKey); |
|
|
} |
|
42 |
|
|
43 |
CUnknown * WINAPI CAbout::CreateInstance(LPUNKNOWN punk, HRESULT *phr) |
CUnknown * WINAPI CAbout::CreateInstance(LPUNKNOWN punk, HRESULT *phr) |
44 |
{ |
{ |
65 |
|
|
66 |
BOOL CAbout::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
BOOL CAbout::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
67 |
{ |
{ |
68 |
HWND hBrightness; |
if (adv_proc(hwnd, uMsg, wParam, lParam) == FALSE) { |
|
switch ( uMsg ) |
|
|
{ |
|
|
case WM_DESTROY: |
|
|
int nForceColorspace; |
|
|
nForceColorspace = SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_GETCURSEL, 0, 0); |
|
|
if ( PPSettings.nForceColorspace != nForceColorspace ) |
|
|
{ |
|
|
MessageBox(0, "You have changed the output colorspace.\r\nClose the movie and open it for the new colorspace to take effect.", "XviD DShow", 0); |
|
|
} |
|
|
PPSettings.nForceColorspace = nForceColorspace; |
|
|
SaveRegistryInfo(); |
|
|
break; |
|
|
|
|
|
case WM_INITDIALOG: |
|
|
|
|
|
// Load Force Colorspace Box |
|
|
SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"No Force"); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YV12"); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YUY2"); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB24"); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB32"); |
|
|
|
|
|
// Select Colorspace |
|
|
SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, PPSettings.nForceColorspace, 0); |
|
|
|
|
|
hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); |
|
|
SendMessage(hBrightness, TBM_SETRANGE, (WPARAM) (BOOL) TRUE, (LPARAM) MAKELONG(0, 50)); |
|
|
SendMessage(hBrightness, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM) PPSettings.nBrightness); |
|
|
|
|
|
// Load Buttons |
|
|
SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, (BOOL)PPSettings.bDeblock_Y, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, (BOOL)PPSettings.bDeblock_UV, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_DERING), BM_SETCHECK, (BOOL)PPSettings.bDering, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, (BOOL)PPSettings.bFilmEffect, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, (BOOL)PPSettings.bFlipVideo, 0); |
|
|
|
|
|
// Set Date & Time of Compilation |
|
|
DPRINTF("(%s %s)", __DATE__, __TIME__); |
|
|
break; |
|
|
|
|
|
case WM_COMMAND: |
|
|
switch ( wParam ) |
|
|
{ |
|
|
case IDC_RESET: |
|
|
ZeroMemory(&PPSettings, sizeof(PostProcessing_Settings)); |
|
|
PPSettings.nBrightness = 25; |
|
|
hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); |
|
|
SendMessage(hBrightness, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM) PPSettings.nBrightness); |
|
|
// Load Buttons |
|
|
SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, (BOOL)PPSettings.bDeblock_Y, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, (BOOL)PPSettings.bDeblock_UV, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_DERING), BM_SETCHECK, (BOOL)PPSettings.bDering, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, (BOOL)PPSettings.bFilmEffect, 0); |
|
|
SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, (BOOL)PPSettings.bFlipVideo, 0); |
|
|
PPSettings.nForceColorspace = 0; |
|
|
SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, PPSettings.nForceColorspace, 0); |
|
|
SaveRegistryInfo(); |
|
|
|
|
|
break; |
|
|
case IDC_DEBLOCK_Y: |
|
|
PPSettings.bDeblock_Y = !PPSettings.bDeblock_Y; |
|
|
SaveRegistryInfo(); |
|
|
break; |
|
|
case IDC_DEBLOCK_UV: |
|
|
PPSettings.bDeblock_UV = !PPSettings.bDeblock_UV; |
|
|
SaveRegistryInfo(); |
|
|
break; |
|
|
case IDC_DERING: |
|
|
PPSettings.bDering = !PPSettings.bDering; |
|
|
SaveRegistryInfo(); |
|
|
break; |
|
|
case IDC_FILMEFFECT: |
|
|
PPSettings.bFilmEffect = !PPSettings.bFilmEffect; |
|
|
SaveRegistryInfo(); |
|
|
break; |
|
|
case IDC_FLIPVIDEO: |
|
|
PPSettings.bFlipVideo = !PPSettings.bFlipVideo; |
|
|
SaveRegistryInfo(); |
|
|
break; |
|
|
} |
|
|
break; |
|
|
case WM_NOTIFY: |
|
|
hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); |
|
|
PPSettings.nBrightness = SendMessage(hBrightness, TBM_GETPOS, NULL, NULL); |
|
|
SaveRegistryInfo(); |
|
|
break; |
|
|
} |
|
69 |
return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam); |
return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam); |
70 |
} |
} |
71 |
|
return TRUE; |
72 |
|
} |
73 |
|
|