2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
22 // PPageDVD.cpp : implementation file
37 {0x0436, "Afrikaans"},
39 {0x0401, "Arabic (Saudi Arabia)"},
40 {0x0801, "Arabic (Iraq)"},
41 {0x0c01, "Arabic (Egypt)"},
42 {0x1001, "Arabic (Libya)"},
43 {0x1401, "Arabic (Algeria)"},
44 {0x1801, "Arabic (Morocco)"},
45 {0x1c01, "Arabic (Tunisia)"},
46 {0x2001, "Arabic (Oman)"},
47 {0x2401, "Arabic (Yemen)"},
48 {0x2801, "Arabic (Syria)"},
49 {0x2c01, "Arabic (Jordan)"},
50 {0x3001, "Arabic (Lebanon)"},
51 {0x3401, "Arabic (Kuwait)"},
52 {0x3801, "Arabic (U.A.E.)"},
53 {0x3c01, "Arabic (Bahrain)"},
54 {0x4001, "Arabic (Qatar)"},
56 {0x042c, "Azeri (Latin)"},
57 {0x082c, "Azeri (Cyrillic)"},
59 {0x0423, "Belarusian"},
60 {0x0402, "Bulgarian"},
63 {0x0404, "Chinese (Taiwan)"},
64 {0x0804, "Chinese (PRC)"},
65 {0x0c04, "Chinese (Hong Kong SAR, PRC)"},
66 {0x1004, "Chinese (Singapore)"},
67 {0x1404, "Chinese (Macau SAR)"},
72 {0x0413, "Dutch (Netherlands)"},
73 {0x0813, "Dutch (Belgium)"},
74 {0x0409, "English (United States)"},
75 {0x0809, "English (United Kingdom)"},
76 {0x0c09, "English (Australian)"},
77 {0x1009, "English (Canadian)"},
78 {0x1409, "English (New Zealand)"},
79 {0x1809, "English (Ireland)"},
80 {0x1c09, "English (South Africa)"},
81 {0x2009, "English (Jamaica)"},
82 {0x2409, "English (Caribbean)"},
83 {0x2809, "English (Belize)"},
84 {0x2c09, "English (Trinidad)"},
85 {0x3009, "English (Zimbabwe)"},
86 {0x3409, "English (Philippines)"},
91 {0x040c, "French (Standard)"},
92 {0x080c, "French (Belgian)"},
93 {0x0c0c, "French (Canadian)"},
94 {0x100c, "French (Switzerland)"},
95 {0x140c, "French (Luxembourg)"},
96 {0x180c, "French (Monaco)"},
99 {0x0407, "German (Standard)"},
100 {0x0807, "German (Switzerland)"},
101 {0x0c07, "German (Austria)"},
102 {0x1007, "German (Luxembourg)"},
103 {0x1407, "German (Liechtenstein)"},
105 {0x0447, "Gujarati"},
108 {0x040e, "Hungarian"},
109 {0x040f, "Icelandic"},
110 {0x0421, "Indonesian"},
111 {0x0410, "Italian (Standard)"},
112 {0x0810, "Italian (Switzerland)"},
113 {0x0411, "Japanese"},
117 {0x0812, "Korean (Johab)"},
120 {0x0427, "Lithuanian"},
121 {0x0827, "Lithuanian (Classic)"},
122 {0x042f, "FYRO Macedonian"},
123 {0x043e, "Malay (Malaysian)"},
124 {0x083e, "Malay (Brunei Darussalam)"},
126 {0x0450, "Mongolian"},
127 {0x0414, "Norwegian (Bokmal)"},
128 {0x0814, "Norwegian (Nynorsk)"},
130 {0x0416, "Portuguese (Brazil)"},
131 {0x0816, "Portuguese (Portugal)"},
133 {0x0418, "Romanian"},
135 {0x044f, "Sanskrit"},
136 {0x0c1a, "Serbian (Cyrillic)"},
137 {0x081a, "Serbian (Latin)"},
139 {0x0424, "Slovenian"},
140 {0x040a, "Spanish (Spain, Traditional Sort)"},
141 {0x080a, "Spanish (Mexican)"},
142 {0x0c0a, "Spanish (Spain, International Sort)"},
143 {0x100a, "Spanish (Guatemala)"},
144 {0x140a, "Spanish (Costa Rica)"},
145 {0x180a, "Spanish (Panama)"},
146 {0x1c0a, "Spanish (Dominican Republic)"},
147 {0x200a, "Spanish (Venezuela)"},
148 {0x240a, "Spanish (Colombia)"},
149 {0x280a, "Spanish (Peru)"},
150 {0x2c0a, "Spanish (Argentina)"},
151 {0x300a, "Spanish (Ecuador)"},
152 {0x340a, "Spanish (Chile)"},
153 {0x380a, "Spanish (Uruguay)"},
154 {0x3c0a, "Spanish (Paraguay)"},
155 {0x400a, "Spanish (Bolivia)"},
156 {0x440a, "Spanish (El Salvador)"},
157 {0x480a, "Spanish (Honduras)"},
158 {0x4c0a, "Spanish (Nicaragua)"},
159 {0x500a, "Spanish (Puerto Rico)"},
161 {0x0441, "Swahili (Kenya)"},
163 {0x081d, "Swedish (Finland)"},
166 {0x0444, "Tatar (Tatarstan)"},
170 {0x0422, "Ukrainian"},
171 {0x0420, "Urdu (Pakistan)"},
172 {0x0820, "Urdu (India)"},
173 {0x0443, "Uzbek (Latin)"},
174 {0x0843, "Uzbek (Cyrillic)"},
175 {0x042a, "Vietnamese"}
181 IMPLEMENT_DYNAMIC(CPPageDVD
, CPPageBase
)
182 CPPageDVD::CPPageDVD()
183 : CPPageBase(CPPageDVD::IDD
, CPPageDVD::IDD
)
187 , m_fAutoSpeakerConf(FALSE
)
191 CPPageDVD::~CPPageDVD()
195 void CPPageDVD::DoDataExchange(CDataExchange
* pDX
)
197 __super::DoDataExchange(pDX
);
198 DDX_Radio(pDX
, IDC_RADIO1
, m_iDVDLocation
);
199 DDX_Radio(pDX
, IDC_RADIO3
, m_iDVDLangType
);
200 DDX_Control(pDX
, IDC_LIST1
, m_lcids
);
201 DDX_Text(pDX
, IDC_DVDPATH
, m_dvdpath
);
202 DDX_Control(pDX
, IDC_DVDPATH
, m_dvdpathctrl
);
203 DDX_Control(pDX
, IDC_BUTTON1
, m_dvdpathselctrl
);
204 DDX_Check(pDX
, IDC_CHECK1
, m_fAutoSpeakerConf
);
207 void CPPageDVD::UpdateLCIDList()
211 LCID lcid
= m_iDVDLangType
== 0 ? m_idMenuLang
212 : m_iDVDLangType
== 1 ? m_idAudioLang
215 for(int i
= 0; i
< m_lcids
.GetCount(); i
++)
217 if(m_lcids
.GetItemData(i
) == lcid
)
219 m_lcids
.SetCurSel(i
);
220 m_lcids
.SetTopIndex(i
);
226 BEGIN_MESSAGE_MAP(CPPageDVD
, CPPageBase
)
227 ON_BN_CLICKED(IDC_BUTTON1
, OnBnClickedButton1
)
228 ON_CONTROL_RANGE(BN_CLICKED
, IDC_RADIO3
, IDC_RADIO5
, OnBnClickedLangradio123
)
229 ON_LBN_SELCHANGE(IDC_LIST1
, OnLbnSelchangeList1
)
230 ON_UPDATE_COMMAND_UI(IDC_DVDPATH
, OnUpdateDVDPath
)
231 ON_UPDATE_COMMAND_UI(IDC_BUTTON1
, OnUpdateDVDPath
)
235 // CPPageDVD message handlers
237 BOOL
CPPageDVD::OnInitDialog()
239 __super::OnInitDialog();
241 AppSettings
& s
= AfxGetAppSettings();
243 m_iDVDLocation
= s
.fUseDVDPath
? 1 : 0;
244 m_dvdpath
= s
.sDVDPath
;
247 m_idMenuLang
= s
.idMenuLang
;
248 m_idAudioLang
= s
.idAudioLang
;
249 m_idSubtitlesLang
= s
.idSubtitlesLang
;
250 m_fAutoSpeakerConf
= s
.fAutoSpeakerConf
;
254 for(int i
= 0; i
< countof(LCIDNameList
); i
++)
256 m_lcids
.AddString(CString(LCIDNameList
[i
].name
));
257 m_lcids
.SetItemData(i
, LCIDNameList
[i
].lcid
);
262 return TRUE
; // return TRUE unless you set the focus to a control
263 // EXCEPTION: OCX Property Pages should return FALSE
266 BOOL
CPPageDVD::OnApply()
270 AppSettings
& s
= AfxGetAppSettings();
272 s
.sDVDPath
= m_dvdpath
;
273 s
.fUseDVDPath
= (m_iDVDLocation
== 1);
274 s
.idMenuLang
= m_idMenuLang
;
275 s
.idAudioLang
= m_idAudioLang
;
276 s
.idSubtitlesLang
= m_idSubtitlesLang
;
277 s
.fAutoSpeakerConf
= !!m_fAutoSpeakerConf
;
279 return __super::OnApply();
282 void CPPageDVD::OnBnClickedButton1()
284 TCHAR path
[MAX_PATH
];
287 bi
.hwndOwner
= m_hWnd
;
289 bi
.pszDisplayName
= path
;
290 bi
.lpszTitle
= _T("Select the path for the DVD:");
291 bi
.ulFlags
= BIF_RETURNONLYFSDIRS
| BIF_VALIDATE
| BIF_USENEWUI
| BIF_NONEWFOLDERBUTTON
;
297 if(iil
= SHBrowseForFolder(&bi
))
299 SHGetPathFromIDList(iil
, path
);
308 void CPPageDVD::OnBnClickedLangradio123(UINT nID
)
313 void CPPageDVD::OnLbnSelchangeList1()
315 LCID
& lcid
= m_iDVDLangType
== 0 ? m_idMenuLang
316 : m_iDVDLangType
== 1 ? m_idAudioLang
319 lcid
= m_lcids
.GetItemData(m_lcids
.GetCurSel());
324 void CPPageDVD::OnUpdateDVDPath(CCmdUI
* pCmdUI
)
328 pCmdUI
->Enable(m_iDVDLocation
== 1);