Support unrar64.dll
[xy_vsfilter.git] / src / apps / mplayerc / PPageDVD.cpp
blobb154935991b7800960d9f7f24b468a9896e4d8c6
1 /*
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)
8 * any later version.
9 *
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
25 #include "stdafx.h"
26 #include "mplayerc.h"
27 #include "PPageDVD.h"
29 struct
31 LCID lcid;
32 LPCSTR name;
34 LCIDNameList[] =
36 {0x0000, "Default"},
37 {0x0436, "Afrikaans"},
38 {0x041c, "Albanian"},
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)"},
55 {0x042b, "Armenian"},
56 {0x042c, "Azeri (Latin)"},
57 {0x082c, "Azeri (Cyrillic)"},
58 {0x042d, "Basque"},
59 {0x0423, "Belarusian"},
60 {0x0402, "Bulgarian"},
61 {0x0455, "Burmese"},
62 {0x0403, "Catalan"},
63 {0x0404, "Chinese (Taiwan)"},
64 {0x0804, "Chinese (PRC)"},
65 {0x0c04, "Chinese (Hong Kong SAR, PRC)"},
66 {0x1004, "Chinese (Singapore)"},
67 {0x1404, "Chinese (Macau SAR)"},
68 {0x041a, "Croatian"},
69 {0x0405, "Czech"},
70 {0x0406, "Danish"},
71 {0x0465, "Divehi"},
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)"},
87 {0x0425, "Estonian"},
88 {0x0438, "Faeroese"},
89 {0x0429, "Farsi"},
90 {0x040b, "Finnish"},
91 {0x040c, "French (Standard)"},
92 {0x080c, "French (Belgian)"},
93 {0x0c0c, "French (Canadian)"},
94 {0x100c, "French (Switzerland)"},
95 {0x140c, "French (Luxembourg)"},
96 {0x180c, "French (Monaco)"},
97 {0x0456, "Galician"},
98 {0x0437, "Georgian"},
99 {0x0407, "German (Standard)"},
100 {0x0807, "German (Switzerland)"},
101 {0x0c07, "German (Austria)"},
102 {0x1007, "German (Luxembourg)"},
103 {0x1407, "German (Liechtenstein)"},
104 {0x0408, "Greek"},
105 {0x0447, "Gujarati"},
106 {0x040d, "Hebrew"},
107 {0x0439, "Hindi"},
108 {0x040e, "Hungarian"},
109 {0x040f, "Icelandic"},
110 {0x0421, "Indonesian"},
111 {0x0410, "Italian (Standard)"},
112 {0x0810, "Italian (Switzerland)"},
113 {0x0411, "Japanese"},
114 {0x044b, "Kannada"},
115 {0x0457, "Konkani"},
116 {0x0412, "Korean"},
117 {0x0812, "Korean (Johab)"},
118 {0x0440, "Kyrgyz"},
119 {0x0426, "Latvian"},
120 {0x0427, "Lithuanian"},
121 {0x0827, "Lithuanian (Classic)"},
122 {0x042f, "FYRO Macedonian"},
123 {0x043e, "Malay (Malaysian)"},
124 {0x083e, "Malay (Brunei Darussalam)"},
125 {0x044e, "Marathi"},
126 {0x0450, "Mongolian"},
127 {0x0414, "Norwegian (Bokmal)"},
128 {0x0814, "Norwegian (Nynorsk)"},
129 {0x0415, "Polish"},
130 {0x0416, "Portuguese (Brazil)"},
131 {0x0816, "Portuguese (Portugal)"},
132 {0x0446, "Punjabi"},
133 {0x0418, "Romanian"},
134 {0x0419, "Russian"},
135 {0x044f, "Sanskrit"},
136 {0x0c1a, "Serbian (Cyrillic)"},
137 {0x081a, "Serbian (Latin)"},
138 {0x041b, "Slovak"},
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)"},
160 {0x0430, "Sutu"},
161 {0x0441, "Swahili (Kenya)"},
162 {0x041d, "Swedish"},
163 {0x081d, "Swedish (Finland)"},
164 {0x045a, "Syriac"},
165 {0x0449, "Tamil"},
166 {0x0444, "Tatar (Tatarstan)"},
167 {0x044a, "Telugu"},
168 {0x041e, "Thai"},
169 {0x041f, "Turkish"},
170 {0x0422, "Ukrainian"},
171 {0x0420, "Urdu (Pakistan)"},
172 {0x0820, "Urdu (India)"},
173 {0x0443, "Uzbek (Latin)"},
174 {0x0843, "Uzbek (Cyrillic)"},
175 {0x042a, "Vietnamese"}
179 // CPPageDVD dialog
181 IMPLEMENT_DYNAMIC(CPPageDVD, CPPageBase)
182 CPPageDVD::CPPageDVD()
183 : CPPageBase(CPPageDVD::IDD, CPPageDVD::IDD)
184 , m_iDVDLocation(0)
185 , m_iDVDLangType(0)
186 , m_dvdpath(_T(""))
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()
209 UpdateData();
211 LCID lcid = m_iDVDLangType == 0 ? m_idMenuLang
212 : m_iDVDLangType == 1 ? m_idAudioLang
213 : m_idSubtitlesLang;
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);
221 break;
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)
232 END_MESSAGE_MAP()
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;
245 m_iDVDLangType = 0;
247 m_idMenuLang = s.idMenuLang;
248 m_idAudioLang = s.idAudioLang;
249 m_idSubtitlesLang = s.idSubtitlesLang;
250 m_fAutoSpeakerConf = s.fAutoSpeakerConf;
252 UpdateData(FALSE);
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);
260 UpdateLCIDList();
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()
268 UpdateData();
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];
286 BROWSEINFO bi;
287 bi.hwndOwner = m_hWnd;
288 bi.pidlRoot = NULL;
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;
292 bi.lpfn = NULL;
293 bi.lParam = 0;
294 bi.iImage = 0;
296 LPITEMIDLIST iil;
297 if(iil = SHBrowseForFolder(&bi))
299 SHGetPathFromIDList(iil, path);
300 m_dvdpath = path;
302 UpdateData(FALSE);
304 SetModified();
308 void CPPageDVD::OnBnClickedLangradio123(UINT nID)
310 UpdateLCIDList();
313 void CPPageDVD::OnLbnSelchangeList1()
315 LCID& lcid = m_iDVDLangType == 0 ? m_idMenuLang
316 : m_iDVDLangType == 1 ? m_idAudioLang
317 : m_idSubtitlesLang;
319 lcid = m_lcids.GetItemData(m_lcids.GetCurSel());
321 SetModified();
324 void CPPageDVD::OnUpdateDVDPath(CCmdUI* pCmdUI)
326 UpdateData();
328 pCmdUI->Enable(m_iDVDLocation == 1);