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 // OpenCapDeviceDlg.cpp : implementation file
27 #include "OpenCapDeviceDlg.h"
28 #include "..\..\DSUtil\DSUtil.h"
30 static struct cc_t
{long code
; AnalogVideoStandard standard
; const TCHAR
* str
;} s_countrycodes
[] =
32 {1, AnalogVideo_NTSC_M
, _T("USA")},
33 /* {1, AnalogVideo_NTSC_M, _T("Anguilla")},
34 {1, AnalogVideo_NTSC_M, _T("Antigua")},
35 {1, AnalogVideo_NTSC_M, _T("Bahamas")},
36 {1, AnalogVideo_NTSC_M, _T("Barbados")},
37 {1, AnalogVideo_NTSC_M, _T("Bermuda")},
38 {1, AnalogVideo_NTSC_M, _T("British Virgin Islands")},
39 {1, AnalogVideo_NTSC_M, _T("Canada")},
40 {1, AnalogVideo_NTSC_M, _T("Cayman Islands")},
41 {1, AnalogVideo_NTSC_M, _T("Dominica")},
42 {1, AnalogVideo_NTSC_M, _T("Dominican Republic")},
43 {1, AnalogVideo_NTSC_M, _T("Grenada")},
44 {1, AnalogVideo_NTSC_M, _T("Jamaica")},
45 {1, AnalogVideo_NTSC_M, _T("Montserrat")},
46 {1, AnalogVideo_NTSC_M, _T("Nevis")},
47 {1, AnalogVideo_NTSC_M, _T("St. Kitts")},
48 {1, AnalogVideo_NTSC_M, _T("St. Vincent and the Grenadines")},
49 {1, AnalogVideo_NTSC_M, _T("Trinidad and Tobago")},
50 {1, AnalogVideo_NTSC_M, _T("Turks and Caicos Islands")},
51 {1, AnalogVideo_NTSC_M, _T("Barbuda")},
52 {1, AnalogVideo_NTSC_M, _T("Puerto Rico")},
53 {1, AnalogVideo_NTSC_M, _T("Saint Lucia")},
54 {1, AnalogVideo_NTSC_M, _T("United States Virgin Islands")},
55 */ {2, AnalogVideo_NTSC_M
, _T("Canada")},
56 {7, AnalogVideo_SECAM_D
, _T("Russia")},
57 /* {7, AnalogVideo_SECAM_D, _T("Kazakhstan")},
58 {7, AnalogVideo_SECAM_D, _T("Kyrgyzstan")},
59 {7, AnalogVideo_SECAM_D, _T("Tajikistan")},
60 {7, AnalogVideo_SECAM_D, _T("Turkmenistan")},
61 {7, AnalogVideo_SECAM_D, _T("Uzbekistan")},
62 */ {20, AnalogVideo_SECAM_B
, _T("Egypt")},
63 {27, AnalogVideo_PAL_I
, _T("South Africa")},
64 {30, AnalogVideo_SECAM_B
, _T("Greece")},
65 {31, AnalogVideo_PAL_B
, _T("Netherlands")},
66 {32, AnalogVideo_PAL_B
, _T("Belgium")},
67 {33, AnalogVideo_SECAM_L
, _T("France")},
68 {34, AnalogVideo_PAL_B
, _T("Spain")},
69 {36, AnalogVideo_SECAM_D
, _T("Hungary")},
70 {39, AnalogVideo_PAL_B
, _T("Italy")},
71 {39, AnalogVideo_PAL_B
, _T("Vatican City")},
72 {40, AnalogVideo_PAL_D
, _T("Romania")},
73 {41, AnalogVideo_PAL_B
, _T("Switzerland")},
74 {41, AnalogVideo_PAL_B
, _T("Liechtenstein")},
75 {43, AnalogVideo_PAL_B
, _T("Austria")},
76 {44, AnalogVideo_PAL_I
, _T("United Kingdom")},
77 {45, AnalogVideo_PAL_B
, _T("Denmark")},
78 {46, AnalogVideo_PAL_B
, _T("Sweden")},
79 {47, AnalogVideo_PAL_B
, _T("Norway")},
80 {48, AnalogVideo_PAL_B
, _T("Poland")},
81 {49, AnalogVideo_PAL_B
, _T("Germany")},
82 {51, AnalogVideo_NTSC_M
, _T("Peru")},
83 {52, AnalogVideo_NTSC_M
, _T("Mexico")},
84 {53, AnalogVideo_NTSC_M
, _T("Cuba")},
85 {53, AnalogVideo_NTSC_M
, _T("Guantanamo Bay")},
86 {54, AnalogVideo_PAL_N
, _T("Argentina")},
87 {55, AnalogVideo_PAL_M
, _T("Brazil")},
88 {56, AnalogVideo_NTSC_M
, _T("Chile")},
89 {57, AnalogVideo_NTSC_M
, _T("Colombia")},
90 {58, AnalogVideo_NTSC_M
, _T("Bolivarian Republic of Venezuela")},
91 {60, AnalogVideo_PAL_B
, _T("Malaysia")},
92 {61, AnalogVideo_PAL_B
, _T("Australia")},
93 // {61, AnalogVideo_NTSC_M, _T("Cocos-Keeling Islands")},
94 {62, AnalogVideo_PAL_B
, _T("Indonesia")},
95 {63, AnalogVideo_NTSC_M
, _T("Philippines")},
96 {64, AnalogVideo_PAL_B
, _T("New Zealand")},
97 {65, AnalogVideo_PAL_B
, _T("Singapore")},
98 {66, AnalogVideo_PAL_B
, _T("Thailand")},
99 {81, AnalogVideo_NTSC_M_J
, _T("Japan")},
100 {82, AnalogVideo_NTSC_M
, _T("Korea (South)")},
101 {84, AnalogVideo_NTSC_M
, _T("Vietnam")},
102 {86, AnalogVideo_PAL_D
, _T("China")},
103 {90, AnalogVideo_PAL_B
, _T("Turkey")},
104 {91, AnalogVideo_PAL_B
, _T("India")},
105 {92, AnalogVideo_PAL_B
, _T("Pakistan")},
106 {93, AnalogVideo_PAL_B
, _T("Afghanistan")},
107 {94, AnalogVideo_PAL_B
, _T("Sri Lanka")},
108 {95, AnalogVideo_NTSC_M
, _T("Myanmar")},
109 {98, AnalogVideo_SECAM_B
, _T("Iran")},
110 {212, AnalogVideo_SECAM_B
, _T("Morocco")},
111 {213, AnalogVideo_PAL_B
, _T("Algeria")},
112 {216, AnalogVideo_SECAM_B
, _T("Tunisia")},
113 {218, AnalogVideo_SECAM_B
, _T("Libya")},
114 {220, AnalogVideo_SECAM_K
, _T("Gambia")},
115 {221, AnalogVideo_SECAM_K
, _T("Senegal Republic")},
116 {222, AnalogVideo_SECAM_B
, _T("Mauritania")},
117 {223, AnalogVideo_SECAM_K
, _T("Mali")},
118 {224, AnalogVideo_SECAM_K
, _T("Guinea")},
119 {225, AnalogVideo_SECAM_K
, _T("Cote D'Ivoire")},
120 {226, AnalogVideo_SECAM_K
, _T("Burkina Faso")},
121 {227, AnalogVideo_SECAM_K
, _T("Niger")},
122 {228, AnalogVideo_SECAM_K
, _T("Togo")},
123 {229, AnalogVideo_SECAM_K
, _T("Benin")},
124 {230, AnalogVideo_SECAM_B
, _T("Mauritius")},
125 {231, AnalogVideo_PAL_B
, _T("Liberia")},
126 {232, AnalogVideo_PAL_B
, _T("Sierra Leone")},
127 {233, AnalogVideo_PAL_B
, _T("Ghana")},
128 {234, AnalogVideo_PAL_B
, _T("Nigeria")},
129 {235, AnalogVideo_PAL_B
, _T("Chad")},
130 {236, AnalogVideo_PAL_B
, _T("Central African Republic")},
131 {237, AnalogVideo_PAL_B
, _T("Cameroon")},
132 {238, AnalogVideo_NTSC_M
, _T("Cape Verde Islands")},
133 {239, AnalogVideo_PAL_B
, _T("Sao Tome and Principe")},
134 {240, AnalogVideo_SECAM_B
, _T("Equatorial Guinea")},
135 {241, AnalogVideo_SECAM_K
, _T("Gabon")},
136 {242, AnalogVideo_SECAM_D
, _T("Congo")},
137 {243, AnalogVideo_SECAM_K
, _T("Congo(DRC)")},
138 {244, AnalogVideo_PAL_I
, _T("Angola")},
139 {245, AnalogVideo_NTSC_M
, _T("Guinea-Bissau")},
140 {246, AnalogVideo_NTSC_M
, _T("Diego Garcia")},
141 {247, AnalogVideo_NTSC_M
, _T("Ascension Island")},
142 {248, AnalogVideo_PAL_B
, _T("Seychelle Islands")},
143 {249, AnalogVideo_PAL_B
, _T("Sudan")},
144 {250, AnalogVideo_PAL_B
, _T("Rwanda")},
145 {251, AnalogVideo_PAL_B
, _T("Ethiopia")},
146 {252, AnalogVideo_PAL_B
, _T("Somalia")},
147 {253, AnalogVideo_SECAM_K
, _T("Djibouti")},
148 {254, AnalogVideo_PAL_B
, _T("Kenya")},
149 {255, AnalogVideo_PAL_B
, _T("Tanzania")},
150 {256, AnalogVideo_PAL_B
, _T("Uganda")},
151 {257, AnalogVideo_SECAM_K
, _T("Burundi")},
152 {258, AnalogVideo_PAL_B
, _T("Mozambique")},
153 {260, AnalogVideo_PAL_B
, _T("Zambia")},
154 {261, AnalogVideo_SECAM_K
, _T("Madagascar")},
155 {262, AnalogVideo_SECAM_K
, _T("Reunion Island")},
156 {263, AnalogVideo_PAL_B
, _T("Zimbabwe")},
157 {264, AnalogVideo_PAL_I
, _T("Namibia")},
158 {265, AnalogVideo_NTSC_M
, _T("Malawi")},
159 {266, AnalogVideo_PAL_I
, _T("Lesotho")},
160 {267, AnalogVideo_SECAM_K
, _T("Botswana")},
161 {268, AnalogVideo_PAL_B
, _T("Swaziland")},
162 {269, AnalogVideo_SECAM_K
, _T("Mayotte Island")},
163 // {269, AnalogVideo_NTSC_M, _T("Comoros")},
164 {290, AnalogVideo_NTSC_M
, _T("St. Helena")},
165 {291, AnalogVideo_NTSC_M
, _T("Eritrea")},
166 {297, AnalogVideo_NTSC_M
, _T("Aruba")},
167 {298, AnalogVideo_PAL_B
, _T("Faroe Islands")},
168 {299, AnalogVideo_NTSC_M
, _T("Greenland")},
169 {350, AnalogVideo_PAL_B
, _T("Gibraltar")},
170 {351, AnalogVideo_PAL_B
, _T("Portugal")},
171 {352, AnalogVideo_PAL_B
, _T("Luxembourg")},
172 {353, AnalogVideo_PAL_I
, _T("Ireland")},
173 {354, AnalogVideo_PAL_B
, _T("Iceland")},
174 {355, AnalogVideo_PAL_B
, _T("Albania")},
175 {356, AnalogVideo_PAL_B
, _T("Malta")},
176 {357, AnalogVideo_PAL_B
, _T("Cyprus")},
177 {358, AnalogVideo_PAL_B
, _T("Finland")},
178 {359, AnalogVideo_SECAM_D
, _T("Bulgaria")},
179 {370, AnalogVideo_PAL_B
, _T("Lithuania")},
180 {371, AnalogVideo_SECAM_D
, _T("Latvia")},
181 {372, AnalogVideo_PAL_B
, _T("Estonia")},
182 {373, AnalogVideo_SECAM_D
, _T("Moldova")},
183 {374, AnalogVideo_SECAM_D
, _T("Armenia")},
184 {375, AnalogVideo_SECAM_D
, _T("Belarus")},
185 {376, AnalogVideo_NTSC_M
, _T("Andorra")},
186 {377, AnalogVideo_SECAM_G
, _T("Monaco")},
187 {378, AnalogVideo_PAL_B
, _T("San Marino")},
188 {380, AnalogVideo_SECAM_D
, _T("Ukraine")},
189 {381, AnalogVideo_PAL_B
, _T("Serbia and Montenegro")},
190 {385, AnalogVideo_PAL_B
, _T("Croatia")},
191 {386, AnalogVideo_PAL_B
, _T("Slovenia")},
192 {387, AnalogVideo_PAL_B
, _T("Bosnia and Herzegovina")},
193 {389, AnalogVideo_PAL_B
, _T("F.Y.R.O.M. (Former Yugoslav Republic of Macedonia)")},
194 {420, AnalogVideo_PAL_D
, _T("Czech Republic")},
195 {421, AnalogVideo_PAL_B
, _T("Slovak Republic")},
196 {500, AnalogVideo_PAL_I
, _T("Falkland Islands (Islas Malvinas)")},
197 {501, AnalogVideo_NTSC_M
, _T("Belize")},
198 {502, AnalogVideo_NTSC_M
, _T("Guatemala")},
199 {503, AnalogVideo_NTSC_M
, _T("El Salvador")},
200 {504, AnalogVideo_NTSC_M
, _T("Honduras")},
201 {505, AnalogVideo_NTSC_M
, _T("Nicaragua")},
202 {506, AnalogVideo_NTSC_M
, _T("Costa Rica")},
203 {507, AnalogVideo_NTSC_M
, _T("Panama")},
204 {508, AnalogVideo_SECAM_K
, _T("St. Pierre and Miquelon")},
205 {509, AnalogVideo_NTSC_M
, _T("Haiti")},
206 {590, AnalogVideo_SECAM_K
, _T("Guadeloupe")},
207 // {590, AnalogVideo_NTSC_M, _T("French Antilles")},
208 {591, AnalogVideo_PAL_N
, _T("Bolivia")},
209 {592, AnalogVideo_SECAM_K
, _T("Guyana")},
210 {593, AnalogVideo_NTSC_M
, _T("Ecuador")},
211 {594, AnalogVideo_SECAM_K
, _T("French Guiana")},
212 {595, AnalogVideo_PAL_N
, _T("Paraguay")},
213 {596, AnalogVideo_SECAM_K
, _T("Martinique")},
214 {597, AnalogVideo_NTSC_M
, _T("Suriname")},
215 {598, AnalogVideo_PAL_N
, _T("Uruguay")},
216 {599, AnalogVideo_NTSC_M
, _T("Netherlands Antilles")},
217 {670, AnalogVideo_NTSC_M
, _T("Saipan Island")},
218 // {670, AnalogVideo_NTSC_M, _T("Rota Island")},
219 // {670, AnalogVideo_NTSC_M, _T("Tinian Island")},
220 {671, AnalogVideo_NTSC_M
, _T("Guam")},
221 {672, AnalogVideo_NTSC_M
, _T("Christmas Island")},
222 {672, AnalogVideo_NTSC_M
, _T("Australian Antarctic Territory")},
223 //{672, AnalogVideo_PAL_B, _T("Norfolk Island")},
224 {673, AnalogVideo_PAL_B
, _T("Brunei")},
225 {674, AnalogVideo_NTSC_M
, _T("Nauru")},
226 {675, AnalogVideo_PAL_B
, _T("Papua New Guinea")},
227 {676, AnalogVideo_NTSC_M
, _T("Tonga")},
228 {677, AnalogVideo_NTSC_M
, _T("Solomon Islands")},
229 {678, AnalogVideo_NTSC_M
, _T("Vanuatu")},
230 {679, AnalogVideo_NTSC_M
, _T("Fiji Islands")},
231 {680, AnalogVideo_NTSC_M
, _T("Palau")},
232 {681, AnalogVideo_SECAM_K
, _T("Wallis and Futuna Islands")},
233 {682, AnalogVideo_PAL_B
, _T("Cook Islands")},
234 {683, AnalogVideo_NTSC_M
, _T("Niue")},
235 {684, AnalogVideo_NTSC_M
, _T("Territory of American Samoa")},
236 {685, AnalogVideo_PAL_B
, _T("Samoa")},
237 {686, AnalogVideo_PAL_B
, _T("Kiribati Republic")},
238 {687, AnalogVideo_SECAM_K
, _T("New Caledonia")},
239 {688, AnalogVideo_NTSC_M
, _T("Tuvalu")},
240 {689, AnalogVideo_SECAM_K
, _T("French Polynesia")},
241 {690, AnalogVideo_NTSC_M
, _T("Tokelau")},
242 {691, AnalogVideo_NTSC_M
, _T("Micronesia")},
243 {692, AnalogVideo_NTSC_M
, _T("Marshall Islands")},
244 {850, AnalogVideo_SECAM_D
, _T("Korea (North)")},
245 {852, AnalogVideo_PAL_I
, _T("Hong Kong SAR")},
246 {853, AnalogVideo_PAL_I
, _T("Macao SAR")},
247 {855, AnalogVideo_PAL_B
, _T("Cambodia")},
248 {856, AnalogVideo_PAL_B
, _T("Laos")},
249 {871, AnalogVideo_NTSC_M
, _T("INMARSAT (Atlantic-East)")},
250 {872, AnalogVideo_NTSC_M
, _T("INMARSAT (Pacific)")},
251 {873, AnalogVideo_NTSC_M
, _T("INMARSAT (Indian)")},
252 {874, AnalogVideo_NTSC_M
, _T("INMARSAT (Atlantic-West)")},
253 {880, AnalogVideo_PAL_B
, _T("Bangladesh")},
254 {886, AnalogVideo_NTSC_M
, _T("Taiwan")},
255 {960, AnalogVideo_PAL_B
, _T("Maldives")},
256 {961, AnalogVideo_SECAM_B
, _T("Lebanon")},
257 {962, AnalogVideo_PAL_B
, _T("Jordan")},
258 {963, AnalogVideo_SECAM_B
, _T("Syria")},
259 {964, AnalogVideo_SECAM_B
, _T("Iraq")},
260 {965, AnalogVideo_PAL_B
, _T("Kuwait")},
261 {966, AnalogVideo_SECAM_B
, _T("Saudi Arabia")},
262 {967, AnalogVideo_PAL_B
, _T("Yemen")},
263 {968, AnalogVideo_PAL_B
, _T("Oman")},
264 {971, AnalogVideo_PAL_B
, _T("United Arab Emirates")},
265 {972, AnalogVideo_PAL_B
, _T("Israel")},
266 {973, AnalogVideo_PAL_B
, _T("Bahrain")},
267 {974, AnalogVideo_PAL_B
, _T("Qatar")},
268 {975, AnalogVideo_NTSC_M
, _T("Bhutan")},
269 {976, AnalogVideo_SECAM_D
, _T("Mongolia")},
270 {977, AnalogVideo_PAL_B
, _T("Nepal")},
271 {994, AnalogVideo_SECAM_D
, _T("Azerbaijan")},
272 {995, AnalogVideo_SECAM_D
,_T("Georgia")},
275 // COpenCapDeviceDlg dialog
277 //IMPLEMENT_DYNAMIC(COpenCapDeviceDlg, CResizableDialog)
278 COpenCapDeviceDlg::COpenCapDeviceDlg(CWnd
* pParent
/*=NULL*/)
279 : CResizableDialog(COpenCapDeviceDlg::IDD
, pParent
)
286 COpenCapDeviceDlg::~COpenCapDeviceDlg()
290 void COpenCapDeviceDlg::DoDataExchange(CDataExchange
* pDX
)
292 __super::DoDataExchange(pDX
);
293 DDX_Control(pDX
, IDC_COMBO1
, m_vidctrl
);
294 DDX_Control(pDX
, IDC_COMBO2
, m_audctrl
);
295 DDX_Control(pDX
, IDC_COMBO9
, m_countryctrl
);
298 BEGIN_MESSAGE_MAP(COpenCapDeviceDlg
, CResizableDialog
)
299 ON_BN_CLICKED(IDOK
, OnBnClickedOk
)
303 // COpenCapDeviceDlg message handlers
305 BOOL
COpenCapDeviceDlg::OnInitDialog()
307 __super::OnInitDialog();
309 AddAnchor(m_vidctrl
, TOP_LEFT
, TOP_RIGHT
);
310 AddAnchor(m_audctrl
, TOP_LEFT
, TOP_RIGHT
);
311 AddAnchor(m_countryctrl
, TOP_LEFT
, TOP_RIGHT
);
312 AddAnchor(IDOK
, TOP_CENTER
);
313 AddAnchor(IDCANCEL
, TOP_CENTER
);
322 CString dummy
= _T("dummy");
323 CString vidstr
= AfxGetApp()->GetProfileString(_T("Capture"), _T("VidDispName"), dummy
);
324 CString audstr
= AfxGetApp()->GetProfileString(_T("Capture"), _T("AudDispName"), dummy
);
325 long country
= AfxGetApp()->GetProfileInt(_T("Capture"), _T("Country"), 1);
327 int iSel
= vidstr
== dummy
? 0 : -1;
329 BeginEnumSysDev(CLSID_VideoInputDeviceCategory
, pMoniker
)
331 CComPtr
<IPropertyBag
> pPB
;
332 pMoniker
->BindToStorage(0, 0, IID_IPropertyBag
, (void**)&pPB
);
335 pPB
->Read(CComBSTR(_T("FriendlyName")), &var
, NULL
);
336 int i
= m_vidctrl
.AddString(CString(var
.bstrVal
));
338 LPOLESTR strName
= NULL
;
339 if(SUCCEEDED(pMoniker
->GetDisplayName(NULL
, NULL
, &strName
)))
341 m_vidnames
.Add(CString(strName
));
342 if(vidstr
== CString(strName
)) iSel
= i
;
343 CoTaskMemFree(strName
);
348 if(m_vidctrl
.GetCount())
349 m_vidctrl
.SetCurSel(iSel
);
351 iSel
= audstr
== dummy
? 0 : -1;
353 BeginEnumSysDev(CLSID_AudioInputDeviceCategory
, pMoniker
)
355 CComPtr
<IPropertyBag
> pPB
;
356 pMoniker
->BindToStorage(0, 0, IID_IPropertyBag
, (void**)&pPB
);
359 pPB
->Read(CComBSTR(_T("FriendlyName")), &var
, NULL
);
360 int i
= m_audctrl
.AddString(CString(var
.bstrVal
));
362 LPOLESTR strName
= NULL
;
363 if(SUCCEEDED(pMoniker
->GetDisplayName(NULL
, NULL
, &strName
)))
365 m_audnames
.Add(CString(strName
));
366 if(audstr
== CString(strName
)) iSel
= i
;
367 CoTaskMemFree(strName
);
373 int i
= m_audctrl
.AddString(_T("<Video Capture Device>"));
374 m_audnames
.Add(_T(""));
375 if(audstr
.IsEmpty()) iSel
= i
;
378 if(m_audctrl
.GetCount())
379 m_audctrl
.SetCurSel(iSel
);
383 for(int j
= 0; j
< countof(s_countrycodes
); j
++)
386 switch(s_countrycodes
[j
].standard
)
388 case AnalogVideo_NTSC_M
: standard
= _T("NTSC M"); break;
389 case AnalogVideo_NTSC_M_J
: standard
= _T("NTSC M J"); break;
390 case AnalogVideo_NTSC_433
: standard
= _T("NTSC 433"); break;
391 case AnalogVideo_PAL_B
: standard
= _T("PAL B"); break;
392 case AnalogVideo_PAL_D
: standard
= _T("PAL D"); break;
393 case AnalogVideo_PAL_G
: standard
= _T("PAL G"); break;
394 case AnalogVideo_PAL_H
: standard
= _T("PAL H"); break;
395 case AnalogVideo_PAL_I
: standard
= _T("PAL I"); break;
396 case AnalogVideo_PAL_M
: standard
= _T("PAL M"); break;
397 case AnalogVideo_PAL_N
: standard
= _T("PAL N"); break;
398 case AnalogVideo_PAL_60
: standard
= _T("PAL 60"); break;
399 case AnalogVideo_SECAM_B
: standard
= _T("SECAM B"); break;
400 case AnalogVideo_SECAM_D
: standard
= _T("SECAM D"); break;
401 case AnalogVideo_SECAM_G
: standard
= _T("SECAM G"); break;
402 case AnalogVideo_SECAM_H
: standard
= _T("SECAM H"); break;
403 case AnalogVideo_SECAM_K
: standard
= _T("SECAM K"); break;
404 case AnalogVideo_SECAM_K1
: standard
= _T("SECAM K1"); break;
405 case AnalogVideo_SECAM_L
: standard
= _T("SECAM L"); break;
406 case AnalogVideo_SECAM_L1
: standard
= _T("SECAM L1"); break;
407 case AnalogVideo_PAL_N_COMBO
: standard
= _T("PAL N COMBO"); break;
411 str
.Format(_T("%d - %s - %s"), s_countrycodes
[j
].code
, s_countrycodes
[j
].str
, standard
);
413 int i
= m_countryctrl
.AddString(str
);
414 m_countryctrl
.SetItemDataPtr(i
, &s_countrycodes
[j
]);
415 if(country
== s_countrycodes
[j
].code
) iSel
= i
;
418 if(m_countryctrl
.GetCount())
419 m_countryctrl
.SetCurSel(iSel
);
421 return TRUE
; // return TRUE unless you set the focus to a control
422 // EXCEPTION: OCX Property Pages should return FALSE
425 void COpenCapDeviceDlg::OnBnClickedOk()
429 if(m_vidctrl
.GetCurSel() >= 0)
431 m_vidstr
= m_vidnames
[m_vidctrl
.GetCurSel()];
432 AfxGetApp()->WriteProfileString(_T("Capture"), _T("VidDispName"), m_vidstr
);
435 if(m_audctrl
.GetCurSel() >= 0)
437 m_audstr
= m_audnames
[m_audctrl
.GetCurSel()];
438 AfxGetApp()->WriteProfileString(_T("Capture"), _T("AudDispName"), m_audstr
);
441 if(m_countryctrl
.GetCurSel() >= 0)
443 m_country
= ((cc_t
*)m_countryctrl
.GetItemDataPtr(m_countryctrl
.GetCurSel()))->code
;
444 AfxGetApp()->WriteProfileInt(_T("Capture"), _T("Country"), m_country
);