[svn] / branches / dev-api-4 / xvidcore / dshow / src / CAbout.cpp Repository:
ViewVC logotype

Annotation of /branches/dev-api-4/xvidcore/dshow/src/CAbout.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1341 - (view) (download)

1 : edgomez 1054 /*****************************************************************************
2 : suxen_drol 888 *
3 : edgomez 1054 * XVID MPEG-4 VIDEO CODEC - DShow Front End
4 :     * - About Window -
5 : suxen_drol 888 *
6 : edgomez 1054 * Copyright(C) 2002-2003 Peter Ross <pross@xvid.org>
7 : suxen_drol 888 *
8 : edgomez 1054 * 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
10 :     * the Free Software Foundation ; either version 2 of the License, or
11 :     * (at your option) any later version.
12 : suxen_drol 888 *
13 : edgomez 1054 * This program is distributed in the hope that it will be useful,
14 :     * but WITHOUT ANY WARRANTY ; without even the implied warranty of
15 :     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 :     * GNU General Public License for more details.
17 : suxen_drol 888 *
18 : edgomez 1054 * You should have received a copy of the GNU General Public License
19 :     * along with this program ; if not, write to the Free Software
20 :     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 :     *
22 : syskin 1341 * $Id: CAbout.cpp,v 1.1.2.7 2004-01-30 03:21:20 syskin Exp $
23 : edgomez 1054 *
24 :     ****************************************************************************/
25 : suxen_drol 888
26 : Isibaar 1260 /****************************************************************************
27 :     *
28 :     * 2003/12/11 - added some additional options, mainly to make the deblocking
29 :     * code from xvidcore available. Most of the new code is taken
30 :     * from Nic's dshow filter, (C) Nic, http://nic.dnsalias.com
31 :     *
32 :     ****************************************************************************/
33 :    
34 : suxen_drol 888 #include "CAbout.h"
35 :     #include "resource.h"
36 : Isibaar 1260 #include <commdlg.h>
37 :     #include <commctrl.h>
38 :     #include "CXvidDecoder.h"
39 : suxen_drol 888
40 : Isibaar 1260 void SaveRegistryInfo()
41 :     {
42 :     HKEY hKey;
43 :     DWORD dispo;
44 :    
45 :     if (RegCreateKeyEx(
46 :     XVID_REG_KEY,
47 :     XVID_REG_SUBKEY,
48 :     0,
49 :     XVID_REG_CLASS,
50 :     REG_OPTION_NON_VOLATILE,
51 :     KEY_WRITE,
52 :     0,
53 :     &hKey,
54 :     &dispo) != ERROR_SUCCESS)
55 :     {
56 :     OutputDebugString("Couldn't create XVID_REG_SUBKEY");
57 :     return;
58 :     }
59 :    
60 :     REG_SET_N("Brightness", PPSettings.nBrightness);
61 : syskin 1334 REG_SET_N("Deblock_Y", PPSettings.nDeblock_Y);
62 :     REG_SET_N("Deblock_UV", PPSettings.nDeblock_UV);
63 :     REG_SET_N("Dering", PPSettings.nDering);
64 :     REG_SET_N("FilmEffect", PPSettings.nFilmEffect);
65 : Isibaar 1260 REG_SET_N("ForceColorspace", PPSettings.nForceColorspace);
66 : syskin 1334 REG_SET_N("FlipVideo", PPSettings.nFlipVideo);
67 : syskin 1341 REG_SET_N("Supported_4CC", supported_4cc);
68 : Isibaar 1260
69 :     RegCloseKey(hKey);
70 :     }
71 :    
72 : suxen_drol 888 CUnknown * WINAPI CAbout::CreateInstance(LPUNKNOWN punk, HRESULT *phr)
73 :     {
74 :     CAbout * pNewObject = new CAbout(punk, phr);
75 :     if (pNewObject == NULL)
76 :     {
77 :     *phr = E_OUTOFMEMORY;
78 :     }
79 :     return pNewObject;
80 :     }
81 :    
82 :    
83 :     CAbout::CAbout(LPUNKNOWN pUnk, HRESULT * phr) :
84 :     CBasePropertyPage(NAME("CAbout"), pUnk, IDD_ABOUT, IDS_ABOUT)
85 :     {
86 :     ASSERT(phr);
87 :     }
88 :    
89 :    
90 :     CAbout::~CAbout()
91 :     {
92 :     }
93 :    
94 :    
95 :     BOOL CAbout::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
96 :     {
97 : Isibaar 1260 HWND hBrightness;
98 :     switch ( uMsg )
99 :     {
100 :     case WM_DESTROY:
101 :     int nForceColorspace;
102 :     nForceColorspace = SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_GETCURSEL, 0, 0);
103 :     if ( PPSettings.nForceColorspace != nForceColorspace )
104 :     {
105 :     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);
106 :     }
107 :     PPSettings.nForceColorspace = nForceColorspace;
108 :     SaveRegistryInfo();
109 :     break;
110 :    
111 :     case WM_INITDIALOG:
112 :    
113 :     // Load Force Colorspace Box
114 :     SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"No Force");
115 :     SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YV12");
116 :     SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YUY2");
117 :     SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB24");
118 :     SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB32");
119 :    
120 :     // Select Colorspace
121 :     SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, PPSettings.nForceColorspace, 0);
122 :    
123 :     hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS);
124 :     SendMessage(hBrightness, TBM_SETRANGE, (WPARAM) (BOOL) TRUE, (LPARAM) MAKELONG(0, 50));
125 :     SendMessage(hBrightness, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM) PPSettings.nBrightness);
126 :    
127 :     // Load Buttons
128 : syskin 1334 SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, PPSettings.nDeblock_Y, 0);
129 :     SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, PPSettings.nDeblock_UV, 0);
130 :     SendMessage(GetDlgItem(hwnd, IDC_DERING), BM_SETCHECK, PPSettings.nDering, 0);
131 :     SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, PPSettings.nFilmEffect, 0);
132 :     SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, PPSettings.nFlipVideo, 0);
133 : Isibaar 1260
134 : syskin 1341 // 4CC checkbuttons
135 :     SendMessage(GetDlgItem(hwnd, IDC_DIVX), BM_SETCHECK, supported_4cc & SUPPORT_DIVX, 0);
136 :     SendMessage(GetDlgItem(hwnd, IDC_DX50), BM_SETCHECK, supported_4cc & SUPPORT_DX50, 0);
137 :     SendMessage(GetDlgItem(hwnd, IDC_MP4V), BM_SETCHECK, supported_4cc & SUPPORT_MP4V, 0);
138 :    
139 : Isibaar 1260 // Set Date & Time of Compilation
140 :     DPRINTF("(%s %s)", __DATE__, __TIME__);
141 :     break;
142 :    
143 :     case WM_COMMAND:
144 :     switch ( wParam )
145 :     {
146 :     case IDC_RESET:
147 :     ZeroMemory(&PPSettings, sizeof(PostProcessing_Settings));
148 :     PPSettings.nBrightness = 25;
149 :     hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS);
150 :     SendMessage(hBrightness, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM) PPSettings.nBrightness);
151 :     // Load Buttons
152 : syskin 1334 SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, PPSettings.nDeblock_Y, 0);
153 :     SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, PPSettings.nDeblock_UV, 0);
154 :     SendMessage(GetDlgItem(hwnd, IDC_DERING), BM_SETCHECK, PPSettings.nDering, 0);
155 :     SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, PPSettings.nFilmEffect, 0);
156 :     SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, PPSettings.nFlipVideo, 0);
157 : Isibaar 1260 PPSettings.nForceColorspace = 0;
158 :     SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, PPSettings.nForceColorspace, 0);
159 :     SaveRegistryInfo();
160 :    
161 :     break;
162 :     case IDC_DEBLOCK_Y:
163 : syskin 1334 PPSettings.nDeblock_Y = !PPSettings.nDeblock_Y;
164 : Isibaar 1260 SaveRegistryInfo();
165 :     break;
166 :     case IDC_DEBLOCK_UV:
167 : syskin 1334 PPSettings.nDeblock_UV = !PPSettings.nDeblock_UV;
168 : Isibaar 1260 SaveRegistryInfo();
169 :     break;
170 : Isibaar 1271 case IDC_DERING:
171 : syskin 1334 PPSettings.nDering = !PPSettings.nDering;
172 : Isibaar 1271 SaveRegistryInfo();
173 :     break;
174 :     case IDC_FILMEFFECT:
175 : syskin 1334 PPSettings.nFilmEffect = !PPSettings.nFilmEffect;
176 : Isibaar 1271 SaveRegistryInfo();
177 :     break;
178 : Isibaar 1260 case IDC_FLIPVIDEO:
179 : syskin 1334 PPSettings.nFlipVideo = !PPSettings.nFlipVideo;
180 : Isibaar 1260 SaveRegistryInfo();
181 :     break;
182 : syskin 1341 case IDC_DIVX:
183 :     supported_4cc ^= SUPPORT_DIVX;
184 :     SaveRegistryInfo();
185 :     break;
186 :     case IDC_DX50:
187 :     supported_4cc ^= SUPPORT_DX50;
188 :     SaveRegistryInfo();
189 :     break;
190 :     case IDC_MP4V:
191 :     supported_4cc ^= SUPPORT_MP4V;
192 :     SaveRegistryInfo();
193 :     break;
194 : Isibaar 1260 }
195 :     break;
196 :     case WM_NOTIFY:
197 :     hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS);
198 :     PPSettings.nBrightness = SendMessage(hBrightness, TBM_GETPOS, NULL, NULL);
199 :     SaveRegistryInfo();
200 :     break;
201 :     }
202 : suxen_drol 888 return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
203 : edgomez 1276 }
204 : syskin 1341

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