Source code of Windows XP (NT5)
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.

159 lines
6.5 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: fdtcfg.cpp
  6. * Content: Configuration of the full duplex test app
  7. * History:
  8. * Date By Reason
  9. * ============
  10. * 08/20/99 pnewson created
  11. * 10/28/99 pnewson Bug #114176 updated DVSOUNDDEVICECONFIG struct
  12. * 11/04/99 pnewson Bug #115279 removed unused const global
  13. * fixed infinite timeouts
  14. * 11/30/99 pnewson default device mapping support
  15. * 01/21/2000 pnewson changed registry key names
  16. * 03/03/2000 rodtoll Updated to handle alternative gamevoice build.
  17. * 04/18/2000 rodtoll Bug #32649 Voice wizard failing
  18. * Changed secondary format for tests from stereo --> mono
  19. *
  20. ***************************************************************************/
  21. #include "dxvtlibpch.h"
  22. // the name of the DLL where the direct voice functions reside
  23. const char gc_szDVoiceDLLName[] = DPVOICE_FILENAME_DPVOICE_A;
  24. // the name of the DLL where the required resources are (could be different
  25. // from the DLL above, hence the second name...)
  26. const char gc_szResDLLName[] = DPVOICE_FILENAME_RES_A;
  27. // the name of the DirectSound DLL
  28. const char gc_szDSoundDLLName[] = "dsound.dll";
  29. // the name of the GetDeviceID DirectSound function
  30. const char gc_szGetDeviceIDFuncName[] = "GetDeviceID";
  31. // command line related definitions
  32. const TCHAR gc_szPriorityCommand[] = DPVOICE_COMMANDLINE_PRIORITY;
  33. const TCHAR gc_szFullDuplexCommand[] = DPVOICE_COMMANDLINE_FULLDUPLEX;
  34. // registry related definitions
  35. const WCHAR gc_wszKeyName_AudioConfig[] = DPVOICE_REGISTRY_BASE DPVOICE_REGISTRY_AUDIOCONFIG;
  36. const WCHAR gc_wszValueName_Started[] = L"Started";
  37. const WCHAR gc_wszValueName_FullDuplex[] = L"FullDuplex";
  38. const WCHAR gc_wszValueName_HalfDuplex[] = L"HalfDuplex";
  39. const WCHAR gc_wszValueName_MicDetected[] = L"MicDetected";
  40. // the name of the mutex used to ensure only one app instance
  41. // uses a GUID to ensure uniqueness
  42. const TCHAR gc_szMutexName[] = _T("A5EBE0E0-57B5-4e8f-AE94-976EAD62355C");
  43. // the event names
  44. // uses GUIDs to ensure uniqueness
  45. const TCHAR gc_szPriorityEventName[] = _T("85D97F8C-7131-4d14-95E2-056843FADC34");
  46. const TCHAR gc_szFullDuplexEventName[] = _T("CB6DD850-BA0A-4e9f-924A-8FECAFCF502F");
  47. const TCHAR gc_szPriorityReplyEventName[] = _T("C4AEDED9-7B39-46db-BFF2-DE19A766B42B");
  48. const TCHAR gc_szFullDuplexReplyEventName[] = _T("53E6CF94-CE39-40a5-9BEF-EB5DE9307A77");
  49. // The shared memory names and sizes. Again, guids for names
  50. // Shared memory sizes do not need to be big. We're just passing
  51. // back and forth some WAVEFORMATEX structures and return codes.
  52. // 1 k should be more than adequate.
  53. const TCHAR gc_szPriorityShMemName[] = _T("E814F4FC-5DAC-4149-8B98-8899A1BF66A7");
  54. const DWORD gc_dwPriorityShMemSize = 1024;
  55. const TCHAR gc_szFullDuplexShMemName[] = _T("3CBCA2AD-C462-4f3a-85FE-9766D02E5E53");
  56. const DWORD gc_dwFullDuplexShMemSize = 1024;
  57. // the send mutex names
  58. const TCHAR gc_szPrioritySendMutex[] = _T("855EF6EE-48D4-4968-8D3D-8D29E865E370");
  59. const TCHAR gc_szFullDuplexSendMutex[] = _T("05DACF95-EFE9-4f3c-9A92-2A7F5C2A7A51");
  60. // the error message and caption to use if the FormatMessage function fails
  61. const TCHAR gc_szUnknownMessage[]
  62. = _T("An error has occured, but the program was unable to retrive the text of the error message");
  63. const TCHAR gc_szUnknownMessageCaption[]
  64. = _T("Error");
  65. // While there is officially a global for each timeout, they are all
  66. // the same value right now. This define is here to make it simple
  67. // to change the timeouts to INFINITE and back for debugging.
  68. //
  69. // Uncomment the timeout you want to use.
  70. #ifdef DEBUG
  71. #define GENERIC_TIMEOUT 10000
  72. //#define GENERIC_TIMEOUT INFINITE
  73. #else
  74. #define GENERIC_TIMEOUT 10000
  75. #endif
  76. // The number of milliseconds we will wait for the child processes
  77. // to exit before we timeout.
  78. const DWORD gc_dwChildWaitTimeout = GENERIC_TIMEOUT;
  79. // The number of milliseconds we will wait for the child processes
  80. // to startup and signal the supervisor before we timeout.
  81. const DWORD gc_dwChildStartupTimeout = GENERIC_TIMEOUT;
  82. // The number of milliseconds a process will wait to receive a command,
  83. // or wait for the reply from a command.
  84. const DWORD gc_dwCommandReceiveTimeout = GENERIC_TIMEOUT;
  85. const DWORD gc_dwCommandReplyTimeout = GENERIC_TIMEOUT;
  86. // The number of milliseconds a process will wait to acquire the
  87. // mutex used to make a SendCommand() call.
  88. const DWORD gc_dwSendMutexTimeout = GENERIC_TIMEOUT;
  89. // The number of milliseconds to wait for a dialog box to spawn
  90. const DWORD gc_dwDialogTimeout = GENERIC_TIMEOUT;
  91. // In the loopback test, how long to wait for the loopback test
  92. // thread proc to exit.
  93. const DWORD gc_dwLoopbackTestThreadTimeout = GENERIC_TIMEOUT;
  94. // The number of milliseconds of audio in a DirectSound buffer
  95. const DWORD gc_dwFrameSize = 50;
  96. // The array of wave formats to try
  97. const WAVEFORMATEX gc_rgwfxPrimaryFormats[] =
  98. {
  99. { WAVE_FORMAT_PCM, 2, 44100, 4*44100, 4, 16, 0 },
  100. { WAVE_FORMAT_PCM, 2, 22050, 4*22050, 4, 16, 0 },
  101. { WAVE_FORMAT_PCM, 2, 11025, 4*11025, 4, 16, 0 },
  102. { WAVE_FORMAT_PCM, 2, 8000, 4* 8000, 4, 16, 0 },
  103. { WAVE_FORMAT_PCM, 1, 44100, 2*44100, 2, 16, 0 },
  104. { WAVE_FORMAT_PCM, 1, 22050, 2*22050, 2, 16, 0 },
  105. { WAVE_FORMAT_PCM, 1, 11025, 2*11025, 2, 16, 0 },
  106. { WAVE_FORMAT_PCM, 1, 8000, 2* 8000, 2, 16, 0 },
  107. { WAVE_FORMAT_PCM, 2, 44100, 2*44100, 2, 8, 0 },
  108. { WAVE_FORMAT_PCM, 2, 22050, 2*22050, 2, 8, 0 },
  109. { WAVE_FORMAT_PCM, 2, 11025, 2*11025, 2, 8, 0 },
  110. { WAVE_FORMAT_PCM, 2, 8000, 2* 8000, 2, 8, 0 },
  111. { WAVE_FORMAT_PCM, 1, 44100, 1*44100, 1, 8, 0 },
  112. { WAVE_FORMAT_PCM, 1, 22050, 1*22050, 1, 8, 0 },
  113. { WAVE_FORMAT_PCM, 1, 11025, 1*11025, 1, 8, 0 },
  114. { WAVE_FORMAT_PCM, 1, 8000, 1* 8000, 1, 8, 0 },
  115. { 0, 0, 0, 0, 0, 0, 0 } // Note: make sure this remains the last format!
  116. };
  117. const WAVEFORMATEX gc_wfxSecondaryFormat =
  118. { WAVE_FORMAT_PCM, 1, 22050, 2* 22050, 2, 16, 0 };
  119. const WAVEFORMATEX gc_rgwfxCaptureFormats[] =
  120. {
  121. { WAVE_FORMAT_PCM, 1, 8000, 2* 8000, 2, 16, 0 },
  122. { WAVE_FORMAT_PCM, 1, 11025, 2*11025, 2, 16, 0 },
  123. { WAVE_FORMAT_PCM, 1, 22050, 2*22050, 2, 16, 0 },
  124. { WAVE_FORMAT_PCM, 1, 44100, 2*44100, 2, 16, 0 },
  125. { WAVE_FORMAT_PCM, 1, 8000, 1* 8000, 1, 8, 0 },
  126. { WAVE_FORMAT_PCM, 1, 11025, 1*11025, 1, 8, 0 },
  127. { WAVE_FORMAT_PCM, 1, 22050, 1*22050, 1, 8, 0 },
  128. { WAVE_FORMAT_PCM, 1, 44100, 1*44100, 1, 8, 0 },
  129. { 0, 0, 0, 0, 0, 0, 0 } // Note: make sure this remains the last format!
  130. };
  131. // the devices to test if the user passes null to CheckAudioSetup
  132. const GUID gc_guidDefaultCaptureDevice = GUID_NULL;
  133. const GUID gc_guidDefaultRenderDevice = GUID_NULL;