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.

212 lines
7.3 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: supervis.h
  6. * Content: Prototypes the SupervisorProcess function
  7. * History:
  8. * Date By Reason
  9. * ============
  10. * 08/19/99 pnewson created
  11. * 10/27/99 pnewson change guid members from pointers to structs
  12. * 11/04/99 pnewson Bug #115279 - fixed cancel processing
  13. * - added HWND to check audio setup
  14. * 11/30/99 pnewson default device mapping
  15. * 01/21/2000 pnewson Update for UI revisions
  16. * 01/23/2000 pnewson Improvded feedback for fatal errors (millen bug 114508)
  17. * 01/24/2000 pnewson fixed bug in GetRenderDesc
  18. * 04/04/2000 pnewson Added support for DVFLAGS_ALLOWBACK
  19. * 04/19/2000 rodtoll Bug #31106 - Grey out recording sliders when no vol control avail
  20. * 04/19/2000 pnewson Error handling cleanup
  21. * 05/03/2000 pnewson bug #33878 - Wizard locks up when clicking Next/Cancel during speaker test
  22. * 11/29/2000 rodtoll Bug #48348 - DPVOICE: Modify wizard to make use of DirectPlay8 as the transport.
  23. *
  24. ***************************************************************************/
  25. #ifndef _SUPERVIS_H_
  26. #define _SUPERVIS_H_
  27. #include "fdtipc.h"
  28. extern HRESULT SupervisorCheckAudioSetup(
  29. const GUID* lpguidRender,
  30. const GUID* lpguidCapture,
  31. HWND hwndParent,
  32. DWORD dwFlags);
  33. // App defined window messages
  34. #define WM_APP_FULLDUP_TEST_COMPLETE (WM_APP)
  35. #define WM_APP_STEP_PROGRESS_BAR (WM_APP + 1)
  36. #define WM_APP_LOOPBACK_RUNNING (WM_APP + 2)
  37. #define WM_APP_RECORDSTART (WM_APP + 3)
  38. #define WM_APP_RECORDSTOP (WM_APP + 4)
  39. // The UI element this is used for can only display about 40 chars anyway,
  40. // so there's no point going through the hassle of allocating this off
  41. // the heap and cleaning it up.
  42. #define MAX_DEVICE_DESC_LEN 50
  43. // class used to manage the supervisor state and shared info
  44. class CSupervisorInfo
  45. {
  46. private:
  47. CRegistry m_creg;
  48. HFONT m_hfTitle;
  49. HFONT m_hfBold;
  50. CSupervisorIPC m_sipc;
  51. GUID m_guidCaptureDevice;
  52. GUID m_guidRenderDevice;
  53. TCHAR m_szCaptureDeviceDesc[MAX_DEVICE_DESC_LEN];
  54. TCHAR m_szRenderDeviceDesc[MAX_DEVICE_DESC_LEN];
  55. HANDLE m_hFullDuplexThread;
  56. BOOL m_fAbortFullDuplex;
  57. HANDLE m_hLoopbackThread;
  58. HANDLE m_hLoopbackThreadExitEvent;
  59. HANDLE m_hLoopbackShutdownEvent;
  60. BOOL m_fVoiceDetected;
  61. BOOL m_fUserBack;
  62. BOOL m_fUserCancel;
  63. BOOL m_fWelcomeNext;
  64. HWND m_hwndParent;
  65. HWND m_hwndWizard;
  66. HWND m_hwndDialog;
  67. HWND m_hwndProgress;
  68. HWND m_hwndInputPeak;
  69. HWND m_hwndOutputPeak;
  70. HWND m_hwndInputVolumeSlider;
  71. LONG m_lInputVolumeSliderPos;
  72. HWND m_hwndOutputVolumeSlider;
  73. LPDIRECTPLAYVOICECLIENT m_lpdpvc;
  74. HANDLE m_hMutex;
  75. PROCESS_INFORMATION m_piSndVol32Record;
  76. PROCESS_INFORMATION m_piSndVol32Playback;
  77. UINT m_uiWaveInDeviceId;
  78. UINT m_uiWaveOutDeviceId;
  79. WAVEOUTCAPS m_woCaps;
  80. DWORD m_dwLoopbackFlags;
  81. DWORD m_dwCheckAudioSetupFlags;
  82. HRESULT m_hrFullDuplexResults;
  83. HRESULT m_hrError;
  84. DWORD m_dwDeviceFlags;
  85. BOOL m_fLoopbackRunning;
  86. BOOL m_fCritSecInited;
  87. DNCRITICAL_SECTION m_csLock;
  88. static BOOL CALLBACK DSEnumCallback(LPGUID lpguid, LPCTSTR lpcstrDescription, LPCTSTR lpcstrModule, LPVOID lpContext);
  89. static BOOL CALLBACK DSCEnumCallback(LPGUID lpguid, LPCTSTR lpcstrDescription, LPCTSTR lpcstrModule, LPVOID lpContext);
  90. public:
  91. CSupervisorInfo();
  92. ~CSupervisorInfo();
  93. HRESULT ThereCanBeOnlyOne();
  94. HRESULT CrashCheckIn();
  95. HRESULT OpenRegKey(BOOL fCreate);
  96. HRESULT CloseRegKey();
  97. HRESULT QueryFullDuplex();
  98. HRESULT InitIPC();
  99. HRESULT DeinitIPC();
  100. HRESULT TestCase(const WAVEFORMATEX* lpwfxPrimary, DWORD dwFlags);
  101. HRESULT CreateFullDuplexThread();
  102. HRESULT WaitForFullDuplexThreadExitCode();
  103. HRESULT CreateLoopbackThread();
  104. HRESULT WaitForLoopbackShutdownEvent();
  105. HRESULT ShutdownLoopbackThread();
  106. HRESULT SignalLoopbackThreadDone();
  107. HRESULT CreateTitleFont();
  108. HRESULT DestroyTitleFont();
  109. HRESULT CreateBoldFont();
  110. HRESULT DestroyBoldFont();
  111. HRESULT Unmute();
  112. HRESULT Mute();
  113. HRESULT GetDeviceDescriptions();
  114. LPCTSTR GetCaptureDesc() const { return m_szCaptureDeviceDesc; };
  115. LPCTSTR GetRenderDesc() const { return m_szRenderDeviceDesc; };
  116. BOOL GetLoopbackRunning() const { return m_fLoopbackRunning; };
  117. void SetLoopbackRunning( BOOL fRunning ) { m_fLoopbackRunning = fRunning; };
  118. BOOL InitClass();
  119. HRESULT Finish();
  120. HRESULT Cancel();
  121. HRESULT CancelFullDuplexTest();
  122. void GetDeviceFlags(DWORD *dwFlags) const;
  123. void SetDeviceFlags(DWORD dwFlags);
  124. HRESULT CancelLoopbackTest();
  125. HRESULT Abort(HWND hDlg, HRESULT hr);
  126. void GetReg(CRegistry* pcreg);
  127. void GetTitleFont(HFONT* lphfTitle);
  128. void GetBoldFont(HFONT* lphfTitle);
  129. void SetCaptureDevice(const GUID& guidCaptureDevice);
  130. void GetCaptureDevice(GUID* lpguidCaptureDevice);
  131. void SetRenderDevice(const GUID& guidRenderDevice);
  132. void GetRenderDevice(GUID* lpguidRenderDevice);
  133. void GetHWNDParent(HWND* lphwnd);
  134. void SetHWNDParent(HWND hwnd);
  135. void GetHWNDWizard(HWND* lphwnd);
  136. void SetHWNDWizard(HWND hwnd);
  137. void GetHWNDDialog(HWND* lphwnd);
  138. void SetHWNDDialog(HWND hwnd);
  139. void GetHWNDProgress(HWND* lphwnd);
  140. void SetHWNDProgress(HWND hwnd);
  141. void GetHWNDInputPeak(HWND* lphwnd);
  142. void SetHWNDInputPeak(HWND hwnd);
  143. void GetHWNDOutputPeak(HWND* lphwnd);
  144. void SetHWNDOutputPeak(HWND hwnd);
  145. void GetHWNDInputVolumeSlider(HWND* lphwnd);
  146. void SetHWNDInputVolumeSlider(HWND hwnd);
  147. void GetInputVolumeSliderPos(LONG* lpl);
  148. void SetInputVolumeSliderPos(LONG lpl);
  149. void GetHWNDOutputVolumeSlider(HWND* lphwnd);
  150. void SetHWNDOutputVolumeSlider(HWND hwnd);
  151. void GetDPVC(LPDIRECTPLAYVOICECLIENT* lplpdpvc);
  152. void SetDPVC(LPDIRECTPLAYVOICECLIENT lpdpvc);
  153. void GetLoopbackShutdownEvent(HANDLE* lphEvent);
  154. void SetLoopbackShutdownEvent(HANDLE hEvent);
  155. void GetIPC(CSupervisorIPC** lplpsipc);
  156. void GetAbortFullDuplex(BOOL* lpfAbort);
  157. void ClearAbortFullDuplex();
  158. void SetWaveOutHandle(HWAVEOUT hwo);
  159. HRESULT SetWaveOutId(UINT ui);
  160. void SetWaveInId(UINT ui);
  161. void GetLoopbackFlags(DWORD* pdwFlags);
  162. void SetLoopbackFlags(DWORD dwFlags);
  163. void GetCheckAudioSetupFlags(DWORD* pdwFlags);
  164. void SetCheckAudioSetupFlags(DWORD dwFlags);
  165. void GetFullDuplexResults(HRESULT* hr);
  166. void SetFullDuplexResults(HRESULT hr);
  167. void GetError(HRESULT* hr);
  168. void SetError(HRESULT hr);
  169. HRESULT GetFullDuplex(DWORD* pdwFullDuplex);
  170. HRESULT SetFullDuplex(DWORD dwFullDuplex);
  171. HRESULT GetHalfDuplex(DWORD* pdwHalfDuplex);
  172. HRESULT SetHalfDuplex(DWORD dwHalfDuplex);
  173. HRESULT GetMicDetected(DWORD* pdwMicDetected);
  174. HRESULT SetMicDetected(DWORD dwMicDetected);
  175. HRESULT SetRecordVolume(LONG lVolume);
  176. HRESULT LaunchWindowsVolumeControl(HWND hwndWizard, BOOL fRecord);
  177. HRESULT CloseWindowsVolumeControl(BOOL fRecord);
  178. HRESULT GetWaveOutVolume(DWORD* lpdwVolume);
  179. HRESULT SetWaveOutVolume(DWORD dwVolume);
  180. void CloseMutex();
  181. void SetVoiceDetected();
  182. void ClearVoiceDetected();
  183. void GetVoiceDetected(BOOL* lpfPreviousCrash);
  184. void SetUserBack();
  185. void ClearUserBack();
  186. void GetUserBack(BOOL* lpfUserBack);
  187. void SetUserCancel();
  188. void ClearUserCancel();
  189. void GetUserCancel(BOOL* lpfUserCancel);
  190. void SetWelcomeNext();
  191. void ClearWelcomeNext();
  192. void GetWelcomeNext(BOOL* lpfWelcomeNext);
  193. };
  194. #endif