1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
/*
* $Id$
*
* (C) 2003-2006 Gabest
* (C) 2006-2010 see AUTHORS
*
* This file is part of mplayerc.
*
* Mplayerc is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Mplayerc is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "mplayerc.h"
#include "PPageTweaks.h"
#include "MainFrm.h"
// CPPageTweaks dialog
IMPLEMENT_DYNAMIC(CPPageTweaks, CPPageBase)
CPPageTweaks::CPPageTweaks()
: CPPageBase(CPPageTweaks::IDD, CPPageTweaks::IDD)
, m_fDisableXPToolbars(FALSE)
, m_fUseWMASFReader(FALSE)
, m_nJumpDistS(0)
, m_nJumpDistM(0)
, m_nJumpDistL(0)
, m_OSD_Size(0)
, m_fNotifyMSN(TRUE)
, m_fNotifyGTSdll(FALSE)
, m_GTSdllLink(_T("http://www.gts-stuff.com/index.php/topic,1664.0.html"))
, m_fPreventMinimize(FALSE)
, m_fUseWin7TaskBar(TRUE)
, m_fDontUseSearchInFolder(FALSE)
{
m_fWMASFReader = SUCCEEDED(CComPtr<IBaseFilter>().CoCreateInstance(
GUIDFromCString(_T("{187463A0-5BB7-11D3-ACBE-0080C75E246E}")))); // WM ASF Reader
}
CPPageTweaks::~CPPageTweaks()
{
}
void CPPageTweaks::DoDataExchange(CDataExchange* pDX)
{
__super::DoDataExchange(pDX);
DDX_Check(pDX, IDC_CHECK3, m_fDisableXPToolbars);
DDX_Control(pDX, IDC_CHECK3, m_fDisableXPToolbarsCtrl);
DDX_Check(pDX, IDC_CHECK2, m_fUseWMASFReader);
DDX_Control(pDX, IDC_CHECK2, m_fUseWMASFReaderCtrl);
DDX_Text(pDX, IDC_EDIT1, m_nJumpDistS);
DDX_Text(pDX, IDC_EDIT2, m_nJumpDistM);
DDX_Text(pDX, IDC_EDIT3, m_nJumpDistL);
DDX_Check(pDX, IDC_CHECK4, m_fNotifyMSN);
DDX_Check(pDX, IDC_CHECK5, m_fNotifyGTSdll);
DDX_Control(pDX, IDC_STATICLINKGTS, m_GTSdllLink);
DDX_Check(pDX, IDC_CHECK6, m_fPreventMinimize);
DDX_Check(pDX, IDC_CHECK_WIN7, m_fUseWin7TaskBar);
DDX_Check(pDX, IDC_CHECK7, m_fDontUseSearchInFolder);
DDX_Control(pDX, IDC_COMBO1, m_FontType);
DDX_Control(pDX, IDC_COMBO2, m_FontSize);
}
int CALLBACK EnumFontProc(ENUMLOGFONT FAR* lf, NEWTEXTMETRIC FAR* tm, int FontType, LPARAM dwData)
{
CAtlArray<CString>* fntl = (CAtlArray<CString>*)dwData;
if(FontType == TRUETYPE_FONTTYPE) {
fntl->Add(lf->elfFullName);
}
return true;
}
BOOL CPPageTweaks::OnInitDialog()
{
__super::OnInitDialog();
SetHandCursor(m_hWnd, IDC_COMBO1);
AppSettings& s = AfxGetAppSettings();
m_fDisableXPToolbars = s.fDisableXPToolbars;
m_fUseWMASFReader = s.fUseWMASFReader;
m_nJumpDistS = s.nJumpDistS;
m_nJumpDistM = s.nJumpDistM;
m_nJumpDistL = s.nJumpDistL;
m_fNotifyMSN = s.fNotifyMSN;
m_fNotifyGTSdll = s.fNotifyGTSdll;
m_fPreventMinimize = s.fPreventMinimize;
m_fUseWin7TaskBar = s.fUseWin7TaskBar;
m_fDontUseSearchInFolder =s.fDontUseSearchInFolder;
m_OSD_Size = s.nOSDSize;
m_OSD_Font = s.strOSDFont;
CString str;
int iSel = 0;
m_FontType.Clear();
m_FontSize.Clear();
HDC dc = CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
CAtlArray<CString> fntl;
EnumFontFamilies(dc, NULL,(FONTENUMPROC)EnumFontProc, (LPARAM)&fntl);
DeleteDC(dc);
for (int i=0; i< fntl.GetCount(); i++) {
if (i>0 && fntl[i-1] == fntl[i]) {
continue;
}
m_FontType.AddString(fntl[i]);
}
for (int i=0; i< m_FontType.GetCount(); i++) {
m_FontType.GetLBText(i,str);
if (m_OSD_Font == str) {
iSel=i;
}
}
m_FontType.SetCurSel(iSel);
for (int i=10; i<26; i++) {
str.Format(_T("%d"), i);
m_FontSize.AddString(str);
if (m_OSD_Size == i) {
iSel=i;
}
}
m_FontSize.SetCurSel(iSel-10);
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CPPageTweaks::OnApply()
{
UpdateData();
AppSettings& s = AfxGetAppSettings();
s.fDisableXPToolbars = !!m_fDisableXPToolbars;
s.fUseWMASFReader = !!m_fUseWMASFReader;
s.nJumpDistS = m_nJumpDistS;
s.nJumpDistM = m_nJumpDistM;
s.nJumpDistL = m_nJumpDistL;
s.fNotifyMSN = !!m_fNotifyMSN;
s.fNotifyGTSdll = !!m_fNotifyGTSdll;
s.fPreventMinimize = m_fPreventMinimize;
s.fUseWin7TaskBar = m_fUseWin7TaskBar;
s.fDontUseSearchInFolder = m_fDontUseSearchInFolder;
s.nOSDSize = m_OSD_Size;
m_FontType.GetLBText(m_FontType.GetCurSel(),s.strOSDFont);
CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
if(m_fUseWin7TaskBar) {
pFrame->CreateThumbnailToolbar();
}
pFrame->UpdateThumbarButton();
return __super::OnApply();
}
BEGIN_MESSAGE_MAP(CPPageTweaks, CPPageBase)
ON_UPDATE_COMMAND_UI(IDC_CHECK3, OnUpdateCheck3)
ON_UPDATE_COMMAND_UI(IDC_CHECK2, OnUpdateCheck2)
ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
ON_CBN_SELCHANGE(IDC_COMBO1, OnChngOSDCombo)
ON_CBN_SELCHANGE(IDC_COMBO2, OnChngOSDCombo)
END_MESSAGE_MAP()
// CPPageTweaks message handlers
void CPPageTweaks::OnUpdateCheck3(CCmdUI* pCmdUI)
{
}
void CPPageTweaks::OnUpdateCheck2(CCmdUI* pCmdUI)
{
pCmdUI->Enable(m_fWMASFReader);
}
void CPPageTweaks::OnBnClickedButton1()
{
m_nJumpDistS = 1000;
m_nJumpDistM = 5000;
m_nJumpDistL = 20000;
UpdateData(FALSE);
}
void CPPageTweaks::OnChngOSDCombo()
{
CString str;
m_OSD_Size = m_FontSize.GetCurSel()+10;
m_FontType.GetLBText(m_FontType.GetCurSel(),str);
((CMainFrame*)AfxGetMainWnd())->m_OSD.DisplayMessage(OSD_TOPLEFT, _T("Test"), 2000, m_OSD_Size, str);
SetModified();
}
|