Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

949 lines
36 KiB

  1. /****************************************************************************
  2. * @doc INTERNAL NETWORKP
  3. *
  4. * @module NetworkP.cpp | Source file for the <c CNetworkProperty>
  5. * class used to implement a property page to test the TAPI control
  6. * interface <i ITQualityControl>.
  7. ***************************************************************************/
  8. #include "Precomp.h"
  9. extern HINSTANCE ghInst;
  10. /****************************************************************************
  11. * @doc INTERNAL CNETWORKPMETHOD
  12. *
  13. * @mfunc void | CNetworkProperty | CNetworkProperty | This
  14. * method is the constructor for bitrate and frame rate property objects. It
  15. * calls the base class constructor, calls InitCommonControlsEx, and saves
  16. * pointers to the <i ITQualityControl> interfaces.
  17. *
  18. * @parm HWND | hDlg | Specifies a handle to the parent property page.
  19. *
  20. * @parm ULONG | IDLabel | Specifies a label ID for the property.
  21. *
  22. * @parm ULONG | IDMinControl | Specifies a label ID for the associated
  23. * property edit control where the Minimum value of the property appears.
  24. *
  25. * @parm ULONG | IDMaxControl | Specifies a label ID for the associated
  26. * property edit control where the Maximum value of the property appears.
  27. *
  28. * @parm ULONG | IDDefaultControl | Specifies a label ID for the associated
  29. * property edit control where the Default value of the property appears.
  30. *
  31. * @parm ULONG | IDStepControl | Specifies a label ID for the associated
  32. * property edit control where the Stepping Delta value of the property appears.
  33. *
  34. * @parm ULONG | IDEditControl | Specifies a label ID for the associated
  35. * property edit control where the value of the property appears.
  36. *
  37. * @parm ULONG | IDTrackbarControl | Specifies a label ID for the associated
  38. * property slide bar.
  39. *
  40. * @parm ULONG | IDProgressControl | Specifies a label ID for the associated
  41. * property slide bar.
  42. *
  43. * @parm ULONG | IDProperty | Specifies the ID of the Ks property.
  44. *
  45. * @parm ITQualityControl* | pITQualityControl | Specifies a pointer to the
  46. * <i ITQualityControl> interface.
  47. *
  48. * @rdesc Nada.
  49. ***************************************************************************/
  50. CNetworkProperty::CNetworkProperty(HWND hDlg, ULONG IDLabel, ULONG IDMinControl, ULONG IDMaxControl, ULONG IDDefaultControl, ULONG IDStepControl, ULONG IDEditControl, ULONG IDTrackbarControl, ULONG IDProgressControl, ULONG IDProperty, ITStreamQualityControl *pITQualityControl)
  51. : CPropertyEditor(hDlg, IDLabel, IDMinControl, IDMaxControl, IDDefaultControl, IDStepControl, IDEditControl, IDTrackbarControl, IDProgressControl, IDProperty, 0)
  52. {
  53. INITCOMMONCONTROLSEX cc;
  54. FX_ENTRY("CNetworkProperty::CNetworkProperty")
  55. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  56. cc.dwSize = sizeof (INITCOMMONCONTROLSEX);
  57. cc.dwICC = ICC_UPDOWN_CLASS | ICC_BAR_CLASSES;
  58. InitCommonControlsEx(&cc);
  59. // It's fine if the interface pointers are NULL, we'll grey the
  60. // associated items in the property page
  61. m_pITQualityControl = pITQualityControl;
  62. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  63. }
  64. /****************************************************************************
  65. * @doc INTERNAL CNETWORKPMETHOD
  66. *
  67. * @mfunc void | CNetworkProperty | ~CNetworkProperty | This
  68. * method is the destructor for capture property objects. It
  69. * simply calls the base class destructor.
  70. *
  71. * @rdesc Nada.
  72. ***************************************************************************/
  73. CNetworkProperty::~CNetworkProperty()
  74. {
  75. FX_ENTRY("CNetworkProperty::~CNetworkProperty")
  76. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  77. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  78. }
  79. /****************************************************************************
  80. * @doc INTERNAL CNETWORKPMETHOD
  81. *
  82. * @mfunc HRESULT | CNetworkProperty | GetValue | This method queries for
  83. * the value of a property.
  84. *
  85. * @rdesc This method returns an HRESULT value that depends on the
  86. * implementation of the interface. HRESULT can include one of the
  87. * following standard constants, or other values not listed:
  88. *
  89. * @flag E_FAIL | Failure
  90. * @flag E_POINTER | Null pointer argument
  91. * @flag E_NOTIMPL | Method is not supported
  92. * @flag NOERROR | No error
  93. ***************************************************************************/
  94. HRESULT CNetworkProperty::GetValue()
  95. {
  96. HRESULT Hr = E_NOTIMPL;
  97. LONG CurrentValue;
  98. TAPIControlFlags CurrentFlag;
  99. LONG Mode;
  100. FX_ENTRY("CNetworkProperty::GetValue")
  101. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  102. switch (m_IDProperty)
  103. {
  104. case IDC_Video_PlayoutDelay:
  105. case IDC_Audio_PlayoutDelay:
  106. /*
  107. if (m_pITQualityControl && SUCCEEDED (Hr = m_pITQualityControl->Get(StreamQuality_MaxPlayoutDelay, &m_CurrentValue, &CurrentFlag)))
  108. {
  109. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: *pdwMaxPlayoutDelay=%ld"), _fx_, m_CurrentValue));
  110. }
  111. else
  112. {
  113. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  114. }
  115. */
  116. break;
  117. case IDC_VideoOut_RTT:
  118. case IDC_VideoIn_RTT:
  119. case IDC_AudioOut_RTT:
  120. case IDC_AudioIn_RTT:
  121. /*
  122. if (m_pITQualityControl && SUCCEEDED (Hr = m_pITQualityControl->Get(Quality_RoundTripTime, &m_CurrentValue, &CurrentFlag)))
  123. {
  124. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: *pdwMaxRTT=%ld"), _fx_, m_CurrentValue));
  125. }
  126. else
  127. {
  128. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  129. }
  130. */
  131. break;
  132. case IDC_VideoOut_LossRate:
  133. case IDC_VideoIn_LossRate:
  134. case IDC_AudioOut_LossRate:
  135. case IDC_AudioIn_LossRate:
  136. /*
  137. if (m_pITQualityControl && SUCCEEDED (Hr = m_pITQualityControl->Get(Quality_LossRate, &m_CurrentValue, &CurrentFlag)))
  138. {
  139. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: *pdwMaxLossRate=%ld"), _fx_, m_CurrentValue));
  140. }
  141. else
  142. {
  143. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  144. }
  145. */
  146. break;
  147. default:
  148. Hr = E_UNEXPECTED;
  149. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Unknown property"), _fx_));
  150. }
  151. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  152. return Hr;
  153. }
  154. /****************************************************************************
  155. * @doc INTERNAL CNETWORKPMETHOD
  156. *
  157. * @mfunc HRESULT | CNetworkProperty | SetValue | This method sets the
  158. * value of a property.
  159. *
  160. * @rdesc This method returns an HRESULT value that depends on the
  161. * implementation of the interface. HRESULT can include one of the
  162. * following standard constants, or other values not listed:
  163. *
  164. * @flag E_FAIL | Failure
  165. * @flag E_POINTER | Null pointer argument
  166. * @flag E_NOTIMPL | Method is not supported
  167. * @flag NOERROR | No error
  168. ***************************************************************************/
  169. HRESULT CNetworkProperty::SetValue()
  170. {
  171. HRESULT Hr = E_NOTIMPL;
  172. LONG CurrentValue;
  173. FX_ENTRY("CNetworkProperty::SetValue")
  174. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  175. /*
  176. switch (m_IDProperty)
  177. {
  178. case IDC_Video_PlayoutDelay:
  179. case IDC_Audio_PlayoutDelay:
  180. if (m_pITQualityControl && SUCCEEDED (Hr = m_pITQualityControl->Set(Quality_MaxPlayoutDelay, m_CurrentValue, TAPIControl_Flags_None)))
  181. {
  182. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: dwMaxPlayoutDelay=%ld"), _fx_, m_CurrentValue));
  183. }
  184. else
  185. {
  186. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  187. }
  188. break;
  189. case IDC_VideoOut_RTT:
  190. case IDC_VideoIn_RTT:
  191. case IDC_AudioOut_RTT:
  192. case IDC_AudioIn_RTT:
  193. case IDC_VideoOut_LossRate:
  194. case IDC_VideoIn_LossRate:
  195. case IDC_AudioOut_LossRate:
  196. case IDC_AudioIn_LossRate:
  197. // This is a read-only property. Don't do anything.
  198. Hr = NOERROR;
  199. break;
  200. default:
  201. Hr = E_UNEXPECTED;
  202. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Unknown property"), _fx_));
  203. }
  204. */
  205. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  206. return Hr;
  207. }
  208. /****************************************************************************
  209. * @doc INTERNAL CNETWORKPMETHOD
  210. *
  211. * @mfunc HRESULT | CNetworkProperty | GetRange | This method retrieves
  212. * the range information of a property.
  213. *
  214. * @rdesc This method returns an HRESULT value that depends on the
  215. * implementation of the interface. HRESULT can include one of the
  216. * following standard constants, or other values not listed:
  217. *
  218. * @flag E_FAIL | Failure
  219. * @flag E_POINTER | Null pointer argument
  220. * @flag E_NOTIMPL | Method is not supported
  221. * @flag NOERROR | No error
  222. ***************************************************************************/
  223. HRESULT CNetworkProperty::GetRange()
  224. {
  225. HRESULT Hr = E_NOTIMPL;
  226. LONG Min;
  227. LONG Max;
  228. LONG SteppingDelta;
  229. LONG Default;
  230. LONG CapsFlags;
  231. FX_ENTRY("CNetworkProperty::GetRange")
  232. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  233. /*
  234. switch (m_IDProperty)
  235. {
  236. case IDC_Video_PlayoutDelay:
  237. case IDC_Audio_PlayoutDelay:
  238. if (m_pITQualityControl && SUCCEEDED (Hr = m_pITQualityControl->GetRange(Quality_MaxPlayoutDelay, &m_Min, &m_Max, &m_SteppingDelta, &m_DefaultValue, &m_CapsFlags)))
  239. {
  240. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: *pdwMin=%ld, *pdwMax=%ld, *pdwSteppingDelta=%ld, *pdwDefault=%ld"), _fx_, m_Min, m_Max, m_SteppingDelta, m_DefaultValue));
  241. }
  242. else
  243. {
  244. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  245. }
  246. break;
  247. case IDC_VideoOut_RTT:
  248. case IDC_VideoIn_RTT:
  249. case IDC_AudioOut_RTT:
  250. case IDC_AudioIn_RTT:
  251. if (m_pITQualityControl && SUCCEEDED (Hr = m_pITQualityControl->GetRange(Quality_RoundTripTime, &m_Min, &m_Max, &m_SteppingDelta, &m_DefaultValue, &m_CapsFlags)))
  252. {
  253. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: *pdwMin=%ld, *pdwMax=%ld, *pdwSteppingDelta=%ld, *pdwDefault=%ld"), _fx_, m_Min, m_Max, m_SteppingDelta, m_DefaultValue));
  254. }
  255. else
  256. {
  257. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  258. }
  259. break;
  260. case IDC_VideoOut_LossRate:
  261. case IDC_VideoIn_LossRate:
  262. case IDC_AudioOut_LossRate:
  263. case IDC_AudioIn_LossRate:
  264. if (m_pITQualityControl && SUCCEEDED (Hr = m_pITQualityControl->GetRange(Quality_LossRate, &m_Min, &m_Max, &m_SteppingDelta, &m_DefaultValue, &m_CapsFlags)))
  265. {
  266. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: *pdwMin=%ld, *pdwMax=%ld, *pdwSteppingDelta=%ld, *pdwDefault=%ld"), _fx_, m_Min, m_Max, m_SteppingDelta, m_DefaultValue));
  267. }
  268. else
  269. {
  270. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  271. }
  272. break;
  273. default:
  274. Hr = E_UNEXPECTED;
  275. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Unknown property"), _fx_));
  276. }
  277. */
  278. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  279. return Hr;
  280. }
  281. /****************************************************************************
  282. * @doc INTERNAL CNETWORKPMETHOD
  283. *
  284. * @mfunc HPROPSHEETPAGE | CNetworkProperties | OnCreate | This
  285. * method creates a new page for a property sheet.
  286. *
  287. * @rdesc Returns the handle to the new property sheet if successful, or
  288. * NULL otherwise.
  289. ***************************************************************************/
  290. HPROPSHEETPAGE CNetworkProperties::OnCreate()
  291. {
  292. PROPSHEETPAGE psp;
  293. psp.dwSize = sizeof(psp);
  294. psp.dwFlags = PSP_USEREFPARENT;
  295. psp.hInstance = ghInst;
  296. psp.pszTemplate = MAKEINTRESOURCE(IDD_NetworkProperties);
  297. psp.pfnDlgProc = BaseDlgProc;
  298. psp.pcRefParent = 0;
  299. psp.pfnCallback = (LPFNPSPCALLBACK)NULL;
  300. psp.lParam = (LPARAM)this;
  301. return CreatePropertySheetPage(&psp);
  302. }
  303. /****************************************************************************
  304. * @doc INTERNAL CNETWORKPMETHOD
  305. *
  306. * @mfunc void | CNetworkProperties | CNetworkProperties | This
  307. * method is the constructor for the property page object. It simply
  308. * calls the constructor of the property page base class.
  309. *
  310. * @rdesc Nada.
  311. ***************************************************************************/
  312. CNetworkProperties::CNetworkProperties()
  313. {
  314. FX_ENTRY("CNetworkProperties::CNetworkProperties")
  315. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  316. m_pVideoInITQualityControl = NULL;
  317. m_pVideoOutITQualityControl = NULL;
  318. m_pAudioInITQualityControl = NULL;
  319. m_pAudioOutITQualityControl = NULL;
  320. m_NumProperties = NUM_NETWORK_CONTROLS;
  321. m_hDlg = NULL;
  322. for (int i = 0; i < m_NumProperties; i++)
  323. m_Controls[i] = NULL;
  324. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  325. }
  326. /****************************************************************************
  327. * @doc INTERNAL CNETWORKPMETHOD
  328. *
  329. * @mfunc void | CNetworkProperties | ~CNetworkProperties | This
  330. * method is the destructor for the capture pin property page. It
  331. * simply calls the base class destructor after deleting all the controls.
  332. *
  333. * @rdesc Nada.
  334. ***************************************************************************/
  335. CNetworkProperties::~CNetworkProperties()
  336. {
  337. int j;
  338. FX_ENTRY("CNetworkProperties::~CNetworkProperties")
  339. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  340. // Free the controls
  341. for (j = 0; j < m_NumProperties; j++)
  342. {
  343. if (m_Controls[j])
  344. {
  345. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: deleting m_Controls[%ld]=0x%08lX"), _fx_, j, m_Controls[j]));
  346. delete m_Controls[j], m_Controls[j] = NULL;
  347. }
  348. else
  349. {
  350. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: WARNING: control already freed"), _fx_));
  351. }
  352. }
  353. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  354. }
  355. /****************************************************************************
  356. * @doc INTERNAL CNETWORKPMETHOD
  357. *
  358. * @mfunc HRESULT | CNetworkProperties | OnConnect | This
  359. * method is called when the property page is connected to a TAPI object.
  360. *
  361. * @parm ITStream* | pStream | Specifies a pointer to the <i ITStream>
  362. * interface. It is used to QI for the <i ITQualityControl> and
  363. * <i ITFormatControl> interfaces.
  364. *
  365. * @rdesc This method returns an HRESULT value that depends on the
  366. * implementation of the interface. HRESULT can include one of the
  367. * following standard constants, or other values not listed:
  368. *
  369. * @flag E_FAIL | Failure
  370. * @flag E_POINTER | Null pointer argument
  371. * @flag E_NOTIMPL | Method is not supported
  372. * @flag NOERROR | No error
  373. ***************************************************************************/
  374. HRESULT CNetworkProperties::OnConnect(ITStream *pVideoInStream, ITStream *pVideoOutStream, ITStream *pAudioInStream, ITStream *pAudioOutStream)
  375. {
  376. FX_ENTRY("CNetworkProperties::OnConnect")
  377. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  378. // Get the quality control interfaces
  379. if (pVideoInStream && SUCCEEDED (pVideoInStream->QueryInterface(__uuidof(ITStreamQualityControl), (void **)&m_pVideoInITQualityControl)))
  380. {
  381. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_pVideoInITQualityControl=0x%08lX"), _fx_, m_pVideoInITQualityControl));
  382. }
  383. else
  384. {
  385. m_pVideoInITQualityControl = NULL;
  386. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  387. }
  388. if (pVideoOutStream && SUCCEEDED (pVideoOutStream->QueryInterface(__uuidof(ITStreamQualityControl), (void **)&m_pVideoOutITQualityControl)))
  389. {
  390. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_pVideoOutITQualityControl=0x%08lX"), _fx_, m_pVideoOutITQualityControl));
  391. }
  392. else
  393. {
  394. m_pVideoOutITQualityControl = NULL;
  395. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  396. }
  397. if (pAudioInStream && SUCCEEDED (pAudioInStream->QueryInterface(__uuidof(ITStreamQualityControl), (void **)&m_pAudioInITQualityControl)))
  398. {
  399. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_pAudioInITQualityControl=0x%08lX"), _fx_, m_pAudioInITQualityControl));
  400. }
  401. else
  402. {
  403. m_pAudioInITQualityControl = NULL;
  404. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  405. }
  406. if (pAudioOutStream && SUCCEEDED (pAudioOutStream->QueryInterface(__uuidof(ITStreamQualityControl), (void **)&m_pAudioOutITQualityControl)))
  407. {
  408. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_pAudioOutITQualityControl=0x%08lX"), _fx_, m_pAudioOutITQualityControl));
  409. }
  410. else
  411. {
  412. m_pAudioOutITQualityControl = NULL;
  413. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: Failed Hr=0x%08lX"), _fx_, Hr));
  414. }
  415. // It's Ok if we couldn't get interface pointers
  416. // We'll just grey the controls in the property page
  417. // to make it clear to the user that they can't
  418. // control those properties on the capture device
  419. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  420. return NOERROR;
  421. }
  422. /****************************************************************************
  423. * @doc INTERNAL CNETWORKPMETHOD
  424. *
  425. * @mfunc HRESULT | CNetworkProperties | OnDisconnect | This
  426. * method is called when the property page is disconnected from the owning
  427. * filter.
  428. *
  429. * @rdesc This method returns an HRESULT value that depends on the
  430. * implementation of the interface. HRESULT can include one of the
  431. * following standard constants, or other values not listed:
  432. *
  433. * @flag NOERROR | No error
  434. ***************************************************************************/
  435. HRESULT CNetworkProperties::OnDisconnect()
  436. {
  437. FX_ENTRY("CNetworkProperties::OnDisconnect")
  438. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  439. // Validate input parameters
  440. if (!m_pVideoInITQualityControl)
  441. {
  442. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: WARNING: already disconnected!"), _fx_));
  443. }
  444. else
  445. {
  446. // Release the interface
  447. m_pVideoInITQualityControl->Release();
  448. m_pVideoInITQualityControl = NULL;
  449. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: releasing m_pVideoInITQualityControl"), _fx_));
  450. }
  451. // Validate input parameters
  452. if (!m_pVideoOutITQualityControl)
  453. {
  454. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: WARNING: already disconnected!"), _fx_));
  455. }
  456. else
  457. {
  458. // Release the interface
  459. m_pVideoOutITQualityControl->Release();
  460. m_pVideoOutITQualityControl = NULL;
  461. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: releasing m_pVideoOutITQualityControl"), _fx_));
  462. }
  463. // Validate input parameters
  464. if (!m_pAudioInITQualityControl)
  465. {
  466. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: WARNING: already disconnected!"), _fx_));
  467. }
  468. else
  469. {
  470. // Release the interface
  471. m_pAudioInITQualityControl->Release();
  472. m_pAudioInITQualityControl = NULL;
  473. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: releasing m_pAudioInITQualityControl"), _fx_));
  474. }
  475. // Validate input parameters
  476. if (!m_pAudioOutITQualityControl)
  477. {
  478. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: WARNING: already disconnected!"), _fx_));
  479. }
  480. else
  481. {
  482. // Release the interface
  483. m_pAudioOutITQualityControl->Release();
  484. m_pAudioOutITQualityControl = NULL;
  485. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: releasing m_pAudioOutITQualityControl"), _fx_));
  486. }
  487. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  488. return NOERROR;
  489. }
  490. /****************************************************************************
  491. * @doc INTERNAL CNETWORKPMETHOD
  492. *
  493. * @mfunc HRESULT | CNetworkProperties | OnActivate | This
  494. * method is called when the property page is activated.
  495. *
  496. * @rdesc This method returns an HRESULT value that depends on the
  497. * implementation of the interface. HRESULT can include one of the
  498. * following standard constants, or other values not listed:
  499. *
  500. * @flag E_FAIL | Failure
  501. * @flag E_POINTER | Null pointer argument
  502. * @flag E_NOTIMPL | Method is not supported
  503. * @flag NOERROR | No error
  504. ***************************************************************************/
  505. HRESULT CNetworkProperties::OnActivate()
  506. {
  507. HRESULT Hr = E_OUTOFMEMORY;
  508. int j;
  509. FX_ENTRY("CNetworkProperties::OnActivate")
  510. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  511. // Create the controls for the properties
  512. if (!(m_Controls[IDC_VideoOut_RTT] = new CNetworkProperty(m_hDlg, IDC_VideoOut_RTT_Label, IDC_VideoOut_RTT_Minimum, IDC_VideoOut_RTT_Maximum, IDC_VideoOut_RTT_Default, IDC_VideoOut_RTT_Stepping, IDC_VideoOut_RTT_Actual, IDC_VideoOut_RTT_Slider, IDC_VideoOut_RTT_Meter, IDC_VideoOut_RTT, m_pVideoOutITQualityControl)))
  513. {
  514. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_VideoOut_RTT] failed - Out of memory"), _fx_));
  515. goto MyExit;
  516. }
  517. else
  518. {
  519. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_VideoOut_RTT]=0x%08lX"), _fx_, m_Controls[IDC_VideoOut_RTT]));
  520. }
  521. if (!(m_Controls[IDC_VideoOut_LossRate] = new CNetworkProperty(m_hDlg, IDC_VideoOut_LossRate_Label, IDC_VideoOut_LossRate_Minimum, IDC_VideoOut_LossRate_Maximum, IDC_VideoOut_LossRate_Default, IDC_VideoOut_LossRate_Stepping, IDC_VideoOut_LossRate_Actual, IDC_VideoOut_LossRate_Slider, IDC_VideoOut_LossRate_Meter, IDC_VideoOut_LossRate, m_pVideoOutITQualityControl)))
  522. {
  523. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_VideoOut_LossRate] failed - Out of memory"), _fx_));
  524. goto MyError0;
  525. }
  526. else
  527. {
  528. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_VideoOut_LossRate]=0x%08lX"), _fx_, m_Controls[IDC_VideoOut_LossRate]));
  529. }
  530. if (!(m_Controls[IDC_VideoIn_RTT] = new CNetworkProperty(m_hDlg, IDC_VideoIn_RTT_Label, IDC_VideoIn_RTT_Minimum, IDC_VideoIn_RTT_Maximum, IDC_VideoIn_RTT_Default, IDC_VideoIn_RTT_Stepping, IDC_VideoIn_RTT_Actual, IDC_VideoIn_RTT_Slider, IDC_VideoIn_RTT_Meter, IDC_VideoIn_RTT, m_pVideoOutITQualityControl)))
  531. {
  532. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_VideoIn_RTT] failed - Out of memory"), _fx_));
  533. goto MyError1;
  534. }
  535. else
  536. {
  537. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_VideoIn_RTT]=0x%08lX"), _fx_, m_Controls[IDC_VideoIn_RTT]));
  538. }
  539. if (!(m_Controls[IDC_VideoIn_LossRate] = new CNetworkProperty(m_hDlg, IDC_VideoIn_LossRate_Label, IDC_VideoIn_LossRate_Minimum, IDC_VideoIn_LossRate_Maximum, IDC_VideoIn_LossRate_Default, IDC_VideoIn_LossRate_Stepping, IDC_VideoIn_LossRate_Actual, IDC_VideoIn_LossRate_Slider, IDC_VideoIn_LossRate_Meter, IDC_VideoIn_LossRate, m_pVideoInITQualityControl)))
  540. {
  541. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_VideoIn_LossRate] failed - Out of memory"), _fx_));
  542. goto MyError2;
  543. }
  544. else
  545. {
  546. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_VideoIn_LossRate]=0x%08lX"), _fx_, m_Controls[IDC_VideoIn_LossRate]));
  547. }
  548. if (!(m_Controls[IDC_AudioOut_RTT] = new CNetworkProperty(m_hDlg, IDC_AudioOut_RTT_Label, IDC_AudioOut_RTT_Minimum, IDC_AudioOut_RTT_Maximum, IDC_AudioOut_RTT_Default, IDC_AudioOut_RTT_Stepping, IDC_AudioOut_RTT_Actual, IDC_AudioOut_RTT_Slider, IDC_AudioOut_RTT_Meter, IDC_AudioOut_RTT, m_pAudioOutITQualityControl)))
  549. {
  550. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_AudioOut_RTT] failed - Out of memory"), _fx_));
  551. goto MyError3;
  552. }
  553. else
  554. {
  555. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_AudioOut_RTT]=0x%08lX"), _fx_, m_Controls[IDC_AudioOut_RTT]));
  556. }
  557. if (!(m_Controls[IDC_AudioOut_LossRate] = new CNetworkProperty(m_hDlg, IDC_AudioOut_LossRate_Label, IDC_AudioOut_LossRate_Minimum, IDC_AudioOut_LossRate_Maximum, IDC_AudioOut_LossRate_Default, IDC_AudioOut_LossRate_Stepping, IDC_AudioOut_LossRate_Actual, IDC_AudioOut_LossRate_Slider, IDC_AudioOut_LossRate_Meter, IDC_AudioOut_LossRate, m_pAudioOutITQualityControl)))
  558. {
  559. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_AudioOut_LossRate] failed - Out of memory"), _fx_));
  560. goto MyError4;
  561. }
  562. else
  563. {
  564. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_AudioOut_LossRate]=0x%08lX"), _fx_, m_Controls[IDC_AudioOut_LossRate]));
  565. }
  566. if (!(m_Controls[IDC_AudioIn_RTT] = new CNetworkProperty(m_hDlg, IDC_AudioIn_RTT_Label, IDC_AudioIn_RTT_Minimum, IDC_AudioIn_RTT_Maximum, IDC_AudioIn_RTT_Default, IDC_AudioIn_RTT_Stepping, IDC_AudioIn_RTT_Actual, IDC_AudioIn_RTT_Slider, IDC_AudioIn_RTT_Meter, IDC_AudioIn_RTT, m_pAudioInITQualityControl)))
  567. {
  568. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_AudioIn_RTT] failed - Out of memory"), _fx_));
  569. goto MyError5;
  570. }
  571. else
  572. {
  573. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_AudioIn_RTT]=0x%08lX"), _fx_, m_Controls[IDC_AudioIn_RTT]));
  574. }
  575. if (!(m_Controls[IDC_AudioIn_LossRate] = new CNetworkProperty(m_hDlg, IDC_AudioIn_LossRate_Label, IDC_AudioIn_LossRate_Minimum, IDC_AudioIn_LossRate_Maximum, IDC_AudioIn_LossRate_Default, IDC_AudioIn_LossRate_Stepping, IDC_AudioIn_LossRate_Actual, IDC_AudioIn_LossRate_Slider, IDC_AudioIn_LossRate_Meter, IDC_AudioIn_LossRate, m_pAudioInITQualityControl)))
  576. {
  577. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_AudioIn_LossRate] failed - Out of memory"), _fx_));
  578. goto MyError6;
  579. }
  580. else
  581. {
  582. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_AudioIn_LossRate]=0x%08lX"), _fx_, m_Controls[IDC_AudioIn_LossRate]));
  583. }
  584. if (!(m_Controls[IDC_Video_PlayoutDelay] = new CNetworkProperty(m_hDlg, IDC_Video_PlayoutDelay_Label, IDC_Video_PlayoutDelay_Minimum, IDC_Video_PlayoutDelay_Maximum, IDC_Video_PlayoutDelay_Default, IDC_Video_PlayoutDelay_Stepping, IDC_Video_PlayoutDelay_Actual, IDC_Video_PlayoutDelay_Slider, IDC_Video_PlayoutDelay_Meter, IDC_Video_PlayoutDelay, m_pVideoInITQualityControl)))
  585. {
  586. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_VideoOut_PlayoutDelay] failed - Out of memory"), _fx_));
  587. goto MyError7;
  588. }
  589. else
  590. {
  591. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_VideoOut_PlayoutDelay]=0x%08lX"), _fx_, m_Controls[IDC_Video_PlayoutDelay]));
  592. }
  593. if (!(m_Controls[IDC_Audio_PlayoutDelay] = new CNetworkProperty(m_hDlg, IDC_Audio_PlayoutDelay_Label, IDC_Audio_PlayoutDelay_Minimum, IDC_Audio_PlayoutDelay_Maximum, IDC_Audio_PlayoutDelay_Default, IDC_Audio_PlayoutDelay_Stepping, IDC_Audio_PlayoutDelay_Actual, IDC_Audio_PlayoutDelay_Slider, IDC_Audio_PlayoutDelay_Meter, IDC_Audio_PlayoutDelay, m_pAudioInITQualityControl)))
  594. {
  595. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: mew m_Controls[IDC_AudioOut_PlayoutDelay] failed - Out of memory"), _fx_));
  596. goto MyError8;
  597. }
  598. else
  599. {
  600. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[IDC_AudioOut_PlayoutDelay]=0x%08lX"), _fx_, m_Controls[IDC_Audio_PlayoutDelay]));
  601. }
  602. // Initialize all the controls. If the initialization fails, it's Ok. It just means
  603. // that the TAPI control interface isn't implemented by the device. The dialog item
  604. // in the property page will be greyed, showing this to the user.
  605. for (j = 0; j < m_NumProperties; j++)
  606. {
  607. if (m_Controls[j]->Init())
  608. {
  609. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: m_Controls[%ld]->Init()"), _fx_, j));
  610. }
  611. else
  612. {
  613. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: WARNING: m_Controls[%ld]->Init() failed"), _fx_, j));
  614. }
  615. }
  616. Hr = NOERROR;
  617. goto MyExit;
  618. MyError8:
  619. if (m_Controls[IDC_Video_PlayoutDelay])
  620. delete m_Controls[IDC_Video_PlayoutDelay], m_Controls[IDC_Video_PlayoutDelay] = NULL;
  621. MyError7:
  622. if (m_Controls[IDC_AudioIn_LossRate])
  623. delete m_Controls[IDC_AudioIn_LossRate], m_Controls[IDC_AudioIn_LossRate] = NULL;
  624. MyError6:
  625. if (m_Controls[IDC_AudioIn_RTT])
  626. delete m_Controls[IDC_AudioIn_RTT], m_Controls[IDC_AudioIn_RTT] = NULL;
  627. MyError5:
  628. if (m_Controls[IDC_AudioOut_LossRate])
  629. delete m_Controls[IDC_AudioOut_LossRate], m_Controls[IDC_AudioOut_LossRate] = NULL;
  630. MyError4:
  631. if (m_Controls[IDC_AudioOut_RTT])
  632. delete m_Controls[IDC_AudioOut_RTT], m_Controls[IDC_AudioOut_RTT] = NULL;
  633. MyError3:
  634. if (m_Controls[IDC_VideoIn_LossRate])
  635. delete m_Controls[IDC_VideoIn_LossRate], m_Controls[IDC_VideoIn_LossRate] = NULL;
  636. MyError2:
  637. if (m_Controls[IDC_VideoIn_RTT])
  638. delete m_Controls[IDC_VideoIn_RTT], m_Controls[IDC_VideoIn_RTT] = NULL;
  639. MyError1:
  640. if (m_Controls[IDC_VideoOut_LossRate])
  641. delete m_Controls[IDC_VideoOut_LossRate], m_Controls[IDC_VideoOut_LossRate] = NULL;
  642. MyError0:
  643. if (m_Controls[IDC_VideoOut_RTT])
  644. delete m_Controls[IDC_VideoOut_RTT], m_Controls[IDC_VideoOut_RTT] = NULL;
  645. MyExit:
  646. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  647. return Hr;
  648. }
  649. /****************************************************************************
  650. * @doc INTERNAL CNETWORKPMETHOD
  651. *
  652. * @mfunc HRESULT | CNetworkProperties | OnDeactivate | This
  653. * method is called when the property page is dismissed.
  654. *
  655. * @rdesc This method returns an HRESULT value that depends on the
  656. * implementation of the interface. HRESULT can include one of the
  657. * following standard constants, or other values not listed:
  658. *
  659. * @flag NOERROR | No error
  660. ***************************************************************************/
  661. HRESULT CNetworkProperties::OnDeactivate()
  662. {
  663. int j;
  664. FX_ENTRY("CNetworkProperties::OnDeactivate")
  665. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  666. // Free the controls
  667. for (j = 0; j < m_NumProperties; j++)
  668. {
  669. if (m_Controls[j])
  670. {
  671. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: deleting m_Controls[%ld]=0x%08lX"), _fx_, j, m_Controls[j]));
  672. delete m_Controls[j], m_Controls[j] = NULL;
  673. }
  674. else
  675. {
  676. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: WARNING: control already freed"), _fx_));
  677. }
  678. }
  679. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  680. return NOERROR;
  681. }
  682. /****************************************************************************
  683. * @doc INTERNAL CNETWORKPMETHOD
  684. *
  685. * @mfunc HRESULT | CNetworkProperties | OnApplyChanges | This
  686. * method is called when the user applies changes to the property page.
  687. *
  688. * @rdesc This method returns an HRESULT value that depends on the
  689. * implementation of the interface. HRESULT can include one of the
  690. * following standard constants, or other values not listed:
  691. *
  692. * @flag E_FAIL | Failure
  693. * @flag E_POINTER | Null pointer argument
  694. * @flag E_NOTIMPL | Method is not supported
  695. * @flag NOERROR | No error
  696. ***************************************************************************/
  697. HRESULT CNetworkProperties::OnApplyChanges()
  698. {
  699. HRESULT Hr = NOERROR;
  700. FX_ENTRY("CNetworkProperties::OnApplyChanges")
  701. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: begin"), _fx_));
  702. for (int j = IDC_Video_PlayoutDelay; j < IDC_Audio_PlayoutDelay; j++)
  703. {
  704. if (m_Controls[j])
  705. {
  706. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: SUCCESS: calling m_Controls[%ld]=0x%08lX->OnApply"), _fx_, j, m_Controls[j]));
  707. if (m_Controls[j]->HasChanged())
  708. m_Controls[j]->OnApply();
  709. Hr = NOERROR;
  710. }
  711. else
  712. {
  713. DbgLog((LOG_ERROR, DBG_LEVEL_TRACE_FAILURES, TEXT("%s: ERROR: can't calling m_Controls[%ld]=NULL->OnApply"), _fx_, j));
  714. Hr = E_UNEXPECTED;
  715. }
  716. }
  717. DbgLog((LOG_TRACE, DBG_LEVEL_TRACE_DETAILS, TEXT("%s: end"), _fx_));
  718. return Hr;
  719. }
  720. /****************************************************************************
  721. * @doc INTERNAL CNETWORKPMETHOD
  722. *
  723. * @mfunc BOOL | CNetworkProperties | BaseDlgProc | This
  724. * method is called when a message is sent to the property page dialog box.
  725. *
  726. * @rdesc By default, returns the value returned by the Win32 DefWindowProc function.
  727. ***************************************************************************/
  728. INT_PTR CALLBACK CNetworkProperties::BaseDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
  729. {
  730. CNetworkProperties *pSV = (CNetworkProperties*)GetWindowLong(hDlg, DWL_USER);
  731. int iNotify = HIWORD (wParam);
  732. int j;
  733. switch (uMsg)
  734. {
  735. case WM_INITDIALOG:
  736. {
  737. LPPROPSHEETPAGE psp = (LPPROPSHEETPAGE)lParam;
  738. pSV = (CNetworkProperties*)psp->lParam;
  739. pSV->m_hDlg = hDlg;
  740. SetWindowLong(hDlg, DWL_USER, (LPARAM)pSV);
  741. pSV->m_bInit = FALSE;
  742. //pSV->OnActivate();
  743. //pSV->m_bInit = TRUE;
  744. return TRUE;
  745. }
  746. break;
  747. case WM_TIMER:
  748. if (pSV && pSV->m_bInit)
  749. {
  750. // Update the Vu-Meters
  751. for (j = IDC_VideoOut_RTT; j < IDC_AudioIn_LossRate; j++)
  752. {
  753. if (pSV->m_Controls[j]->GetProgressHWnd())
  754. {
  755. pSV->m_Controls[j]->UpdateProgress();
  756. pSV->SetDirty();
  757. }
  758. }
  759. }
  760. break;
  761. case WM_HSCROLL:
  762. case WM_VSCROLL:
  763. if (pSV && pSV->m_bInit)
  764. {
  765. // Process all of the Trackbar messages
  766. for (j = IDC_Video_PlayoutDelay; j < IDC_Audio_PlayoutDelay; j++)
  767. {
  768. if (pSV->m_Controls[j]->GetTrackbarHWnd() == (HWND)lParam)
  769. {
  770. pSV->m_Controls[j]->OnScroll(uMsg, wParam, lParam);
  771. pSV->SetDirty();
  772. }
  773. }
  774. //pSV->OnApplyChanges();
  775. }
  776. break;
  777. case WM_COMMAND:
  778. if (pSV && pSV->m_bInit)
  779. {
  780. // Process all of the auto checkbox messages
  781. for (j = 0; j < pSV->m_NumProperties; j++)
  782. {
  783. if (pSV->m_Controls[j] && pSV->m_Controls[j]->GetAutoHWnd() == (HWND)lParam)
  784. {
  785. pSV->m_Controls[j]->OnAuto(uMsg, wParam, lParam);
  786. pSV->SetDirty();
  787. break;
  788. }
  789. }
  790. // Process all of the edit box messages
  791. for (j = 0; j < pSV->m_NumProperties; j++)
  792. {
  793. if (pSV->m_Controls[j] && pSV->m_Controls[j]->GetEditHWnd() == (HWND)lParam)
  794. {
  795. pSV->m_Controls[j]->OnEdit(uMsg, wParam, lParam);
  796. pSV->SetDirty();
  797. break;
  798. }
  799. }
  800. switch (LOWORD(wParam))
  801. {
  802. case IDC_CONTROL_DEFAULT:
  803. for (j = IDC_Video_PlayoutDelay; j < IDC_Audio_PlayoutDelay; j++)
  804. {
  805. if (pSV->m_Controls[j])
  806. pSV->m_Controls[j]->OnDefault();
  807. }
  808. break;
  809. default:
  810. break;
  811. }
  812. //pSV->OnApplyChanges();
  813. }
  814. break;
  815. case WM_NOTIFY:
  816. if (pSV)
  817. {
  818. switch (((NMHDR FAR *)lParam)->code)
  819. {
  820. case PSN_SETACTIVE:
  821. {
  822. // We call out here specially so we can mark this page as having been init'd.
  823. int iRet = pSV->OnActivate();
  824. pSV->m_bInit = TRUE;
  825. return iRet;
  826. }
  827. break;
  828. case PSN_APPLY:
  829. pSV->OnApplyChanges();
  830. break;
  831. case PSN_QUERYCANCEL:
  832. // return pSV->QueryCancel();
  833. break;
  834. default:
  835. break;
  836. }
  837. }
  838. break;
  839. default:
  840. return FALSE;
  841. }
  842. return TRUE;
  843. }
  844. /****************************************************************************
  845. * @doc INTERNAL CNETWORKPMETHOD
  846. *
  847. * @mfunc BOOL | CNetworkProperties | SetDirty | This
  848. * method notifies the property page site of changes.
  849. *
  850. * @rdesc Nada.
  851. ***************************************************************************/
  852. void CNetworkProperties::SetDirty()
  853. {
  854. PropSheet_Changed(GetParent(m_hDlg), m_hDlg);
  855. }