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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1054, Mon Jun 9 13:55:56 2003 UTC revision 1260, Fri Dec 12 15:09:01 2003 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: CAbout.cpp,v 1.1.2.2 2003-06-09 13:49:00 edgomez Exp $   * $Id: CAbout.cpp,v 1.1.2.3 2003-12-12 15:09:01 Isibaar Exp $
23     *
24     ****************************************************************************/
25    
26    /****************************************************************************
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  #include "CAbout.h"  #include "CAbout.h"
35  #include "resource.h"  #include "resource.h"
36    #include <commdlg.h>
37    #include <commctrl.h>
38    #include "CXvidDecoder.h"
39    
40    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            REG_SET_N("Deblock_Y",  PPSettings.bDeblock_Y);
62            REG_SET_N("Deblock_UV", PPSettings.bDeblock_UV);
63            REG_SET_N("ForceColorspace", PPSettings.nForceColorspace);
64    
65            RegCloseKey(hKey);
66    }
67    
68  CUnknown * WINAPI CAbout::CreateInstance(LPUNKNOWN punk, HRESULT *phr)  CUnknown * WINAPI CAbout::CreateInstance(LPUNKNOWN punk, HRESULT *phr)
69  {  {
# Line 51  Line 90 
90    
91  BOOL CAbout::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)  BOOL CAbout::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
92  {  {
93            HWND hBrightness;
94            switch ( uMsg )
95            {
96            case WM_DESTROY:
97                    int nForceColorspace;
98                    nForceColorspace = SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_GETCURSEL, 0, 0);
99                    if ( PPSettings.nForceColorspace != nForceColorspace )
100                    {
101                            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);
102                    }
103                    PPSettings.nForceColorspace = nForceColorspace;
104                    SaveRegistryInfo();
105                    break;
106    
107            case WM_INITDIALOG:
108    
109                    // Load Force Colorspace Box
110                    SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"No Force");
111                    SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YV12");
112                    SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YUY2");
113                    SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB24");
114                    SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB32");
115    
116                    // Select Colorspace
117                    SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, PPSettings.nForceColorspace, 0);
118    
119                    hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS);
120                    SendMessage(hBrightness, TBM_SETRANGE, (WPARAM) (BOOL) TRUE, (LPARAM) MAKELONG(0, 50));
121                    SendMessage(hBrightness, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM) PPSettings.nBrightness);
122    
123                    // Load Buttons
124                    SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, (BOOL)PPSettings.bDeblock_Y, 0);
125                    SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, (BOOL)PPSettings.bDeblock_UV, 0);
126                    SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, (BOOL)PPSettings.bFlipVideo, 0);
127    
128                    // Set Date & Time of Compilation
129                    DPRINTF("(%s %s)", __DATE__, __TIME__);
130                    break;
131    
132            case WM_COMMAND:
133                    switch ( wParam )
134                    {
135                    case IDC_RESET:
136                            ZeroMemory(&PPSettings, sizeof(PostProcessing_Settings));
137                            PPSettings.nBrightness = 25;
138                            hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS);
139                            SendMessage(hBrightness, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM) PPSettings.nBrightness);
140                            // Load Buttons
141                            SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, (BOOL)PPSettings.bDeblock_Y, 0);
142                            SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, (BOOL)PPSettings.bDeblock_UV, 0);
143                            SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, (BOOL)PPSettings.bFlipVideo, 0);
144                            PPSettings.nForceColorspace = 0;
145                            SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, PPSettings.nForceColorspace, 0);
146                            SaveRegistryInfo();
147    
148                            break;
149                    case IDC_DEBLOCK_Y:
150                            PPSettings.bDeblock_Y = !PPSettings.bDeblock_Y;
151                            SaveRegistryInfo();
152                            break;
153                    case IDC_DEBLOCK_UV:
154                            PPSettings.bDeblock_UV = !PPSettings.bDeblock_UV;
155                            SaveRegistryInfo();
156                            break;
157                    case IDC_FLIPVIDEO:
158                            PPSettings.bFlipVideo = !PPSettings.bFlipVideo;
159                            SaveRegistryInfo();
160                            break;
161                    }
162                    break;
163            case WM_NOTIFY:
164                    hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS);
165                    PPSettings.nBrightness = SendMessage(hBrightness, TBM_GETPOS, NULL, NULL);
166                    SaveRegistryInfo();
167                    break;
168            }
169          return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);          return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
170  }  }

Legend:
Removed from v.1054  
changed lines
  Added in v.1260

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