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.

216 lines
7.3 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dpvxdump.cpp
  6. * Content: Useful dump utility functions lib for sample apps
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 10/07/99 rodtoll Created It
  12. * 10/28/99 pnewson bug#114176 - updates to DVSOUNDDEVICECONFIG struct
  13. * 11/17/99 rodtoll Fix: Bug #116440 - Remove unused flags
  14. * 02/08/2000 rodtoll Updated for API changes (overdue)
  15. * 08/31/2000 rodtoll Bug #43804 - DVOICE: dwSensitivity structure member is confusing - should be dwThreshold
  16. *
  17. ***************************************************************************/
  18. #include "dpvxlibpch.h"
  19. // Structure -> String Conversions
  20. void DPVDX_DUMP_GUID( GUID guid )
  21. {
  22. /*
  23. _tprintf(_T("{%-08.8X-%-04.4X-%-04.4X-%02.2X%02.2X-%02.2X%02.2X%02.2X%02.2X%02.2X%02.2X}"),guid.Data1, guid.Data2, guid.Data3,
  24. guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
  25. guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7] );
  26. */
  27. }
  28. void DPVDX_DUMP_WaveFormatEx( LPWAVEFORMATEX lpwfxFormat )
  29. {
  30. /*
  31. _tprintf(_T("> WAVEFORMATEX Dump Addr = 0x%lx\n"),lpwfxFormat );
  32. _tprintf(_T("> > wFormatTag = %d\n"),lpwfxFormat->wFormatTag );
  33. _tprintf(_T("> > nSamplesPerSec = %d\n"),lpwfxFormat->nSamplesPerSec );
  34. _tprintf(_T("> > nChannels = %d\n"),lpwfxFormat->nChannels );
  35. _tprintf(_T("> > wBitsPerSample = %d\n"),lpwfxFormat->wBitsPerSample );
  36. _tprintf(_T("> > nAvgBytesPerSec = %d\n"),lpwfxFormat->nAvgBytesPerSec );
  37. _tprintf(_T("> > nBlockAlign = %d\n"),lpwfxFormat->nBlockAlign );
  38. _tprintf(_T("> > cbSize = %d\n"),lpwfxFormat->cbSize );
  39. */
  40. }
  41. void DPVDX_DUMP_SoundDeviceConfig( LPDVSOUNDDEVICECONFIG lpdvSoundConfig)
  42. {
  43. /*
  44. DWORD dwIndex;
  45. _tprintf(_T("DVSOUNDDEVICECONFIG Dump Addr=0x%lx\n"),lpdvSoundConfig );
  46. _tprintf(_T("dwSize = %d\n"),lpdvSoundConfig->dwSize );
  47. _tprintf(_T("dwFlags = 0x%x\n"),lpdvSoundConfig->dwFlags );
  48. _tprintf(_T(" %s%s\n"),
  49. (lpdvSoundConfig->dwFlags & DVSOUNDCONFIG_AUTOSELECT) ? _T("DVSESSION_SERVERCONTROLTARGET,") : _T(""),
  50. (lpdvSoundConfig->dwFlags & DVSOUNDCONFIG_HALFDUPLEX) ? _T("DVSESSION_HALFDUPLEX,") : _T("") );
  51. _tprintf(_T("guidPlaybackDevice =\n") );
  52. DPVDX_DUMP_GUID( lpdvSoundConfig->guidPlaybackDevice );
  53. _tprintf(_T("guidCaptureDevice =\n") );
  54. DPVDX_DUMP_GUID( lpdvSoundConfig->guidCaptureDevice );
  55. // 7/31/2000(a-JiTay): IA64: Use %p format specifier for 32/64-bit pointers, addresses, and handles.
  56. #ifdef WIN95
  57. _tprintf(_T("lpdsPlaybackDevice = 0x%x\n"), lpdvSoundConfig->lpdsPlaybackDevice ) ;
  58. _tprintf(_T("lpdsCaptureDevice = 0x%x\n"), lpdvSoundConfig->lpdsCaptureDevice ) ;
  59. #else
  60. _tprintf(_T("lpdsPlaybackDevice = 0x%p\n"), lpdvSoundConfig->lpdsPlaybackDevice ) ;
  61. _tprintf(_T("lpdsCaptureDevice = 0x%p\n"), lpdvSoundConfig->lpdsCaptureDevice ) ;
  62. #endif
  63. */
  64. }
  65. void DPVDX_DUMP_FullCompressionInfo( LPDVCOMPRESSIONINFO lpdvfCompressionInfo, DWORD dwNumElements)
  66. {
  67. /*
  68. DWORD dwIndex;
  69. LPSTR lpszTmp;
  70. _tprintf(_T("DVFULLCOMPRESSIONINFO Array Dump Addr=0x%lx\n"),lpdvfCompressionInfo );
  71. for( dwIndex = 0; dwIndex < dwNumElements; dwIndex++ )
  72. {
  73. _tprintf(_T("dwSize = %d\n"),lpdvfCompressionInfo[dwIndex].dwSize );
  74. _tprintf(_T("dwFlags = 0x%x\n"),lpdvfCompressionInfo[dwIndex].dwFlags );
  75. if( FAILED( DPVDX_AllocAndConvertToANSI( &lpszTmp, lpdvfCompressionInfo[dwIndex].lpszDescription ) ) )
  76. {
  77. _tprintf(_T("lpszDescription = <Unable to Convert>") );
  78. }
  79. else
  80. {
  81. _tprintf(_T("lpszDescription = %s\n"),lpszTmp );
  82. delete [] lpszTmp;
  83. }
  84. if( FAILED( DPVDX_AllocAndConvertToANSI( &lpszTmp, lpdvfCompressionInfo[dwIndex].lpszName ) ) )
  85. {
  86. _tprintf(_T("lpszName = <Unable to Convert>") );
  87. }
  88. else
  89. {
  90. _tprintf(_T("lpszName = %s\n"),lpszTmp );
  91. delete [] lpszTmp;
  92. }
  93. _tprintf(_T("guidType = ") );
  94. DPVDX_DUMP_GUID( lpdvfCompressionInfo[dwIndex].guidType );
  95. _tprintf(_T("\n") );
  96. _tprintf(_T("dwMaxBitsPerSecond = %d\n"),lpdvfCompressionInfo[dwIndex].dwMaxBitsPerSecond );
  97. }
  98. */
  99. }
  100. void DPVDX_DUMP_ClientConfig( LPDVCLIENTCONFIG lpdvClientConfig )
  101. {
  102. /*
  103. _tprintf(_T("DVCLIENTCONFIG Dump Addr = 0x%lx\n"),lpdvClientConfig );
  104. _tprintf(_T("> dwSize = %d\n"),lpdvClientConfig->dwSize );
  105. _tprintf(_T("> dwFlags = 0x%x"),lpdvClientConfig->dwFlags );
  106. _tprintf(_T("%s%s%s%s%s%s)\n"),
  107. (lpdvClientConfig->dwFlags & DVCLIENTCONFIG_RECORDMUTE) ? _T("DVCLIENTCONFIG_RECORDMUTE,") : _T(""),
  108. (lpdvClientConfig->dwFlags & DVCLIENTCONFIG_PLAYBACKMUTE) ? _T("DVCLIENTCONFIG_PLAYBACKMUTE,") : _T(""),
  109. (lpdvClientConfig->dwFlags & DVCLIENTCONFIG_AUTOVOICEACTIVATED) ? _T("DVCLIENTCONFIG_AUTOVOICEACTIVATED,") : _T(""),
  110. (lpdvClientConfig->dwFlags & DVCLIENTCONFIG_MANUALVOICEACTIVATED) ? _T("DVCLIENTCONFIG_MANUALVOICEACTIVATED,") : _T(""),
  111. (lpdvClientConfig->dwFlags & DVCLIENTCONFIG_MUTEGLOBAL) ? _T("DVCLIENTCONFIG_MUTEGLOBAL,") : _T(""),
  112. (lpdvClientConfig->dwFlags & DVCLIENTCONFIG_AUTORECORDVOLUME) ? _T("DVCLIENTCONFIG_AUTORECORDVOLUME") : _T("") );
  113. if( lpdvClientConfig->dwBufferAggressiveness == DVBUFFERAGGRESSIVENESS_DEFAULT )
  114. {
  115. _tprintf(_T("> dwBufferAggresiveness = DEFAULT\n") );
  116. }
  117. else
  118. {
  119. _tprintf(_T("> dwBufferAggresiveness = %d\n"),lpdvClientConfig->dwBufferAggressiveness );
  120. }
  121. if( lpdvClientConfig->dwBufferQuality == DVBUFFERQUALITY_DEFAULT )
  122. {
  123. _tprintf(_T("> dwBufferQuality = DEFAULT\n") );
  124. }
  125. else
  126. {
  127. _tprintf(_T("> dwBufferQuality = %d\n"),lpdvClientConfig->dwBufferQuality );
  128. }
  129. if( lpdvClientConfig->dwThreshold == DVTHRESHOLD_DEFAULT )
  130. {
  131. _tprintf(_T("> dwSensitivity = DEFAULT\n") );
  132. }
  133. else
  134. {
  135. _tprintf(_T("> dwSensitivity = %d\n"),lpdvClientConfig->dwThreshold );
  136. }
  137. _tprintf(_T("> dwNotifyPeriod = %d\n"),lpdvClientConfig->dwNotifyPeriod );
  138. _tprintf(_T("> lPlaybackVolume = %li\n"),lpdvClientConfig->lPlaybackVolume );
  139. _tprintf(_T("> lRecordVolume = %li\n"),lpdvClientConfig->lRecordVolume );
  140. */
  141. }
  142. void DPVDX_DUMP_SessionDesc( LPDVSESSIONDESC lpdvSessionDesc )
  143. {
  144. /*
  145. _tprintf(_T("DVSESSIONDESC Dump Addr=0x%lx\n"),lpdvSessionDesc );
  146. _tprintf(_T("> dwSize = %d\n"),lpdvSessionDesc->dwSize );
  147. _tprintf(_T("> dwFlags = 0x%x "),lpdvSessionDesc->dwFlags );
  148. _tprintf(_T("%s\n"), (lpdvSessionDesc->dwFlags & DVSESSION_SERVERCONTROLTARGET) ? _T("DVSESSION_SERVERCONTROLTARGET,") : _T("") );
  149. switch( lpdvSessionDesc->dwSessionType )
  150. {
  151. case DVSESSIONTYPE_PEER:
  152. _tprintf(_T("> dwSessionType = DVSESSIONTYPE_PEER\n") );
  153. break;
  154. case DVSESSIONTYPE_MIXING:
  155. _tprintf(_T("> dwSessionType = DVSESSIONTYPE_MIXING\n") );
  156. break;
  157. case DVSESSIONTYPE_FORWARDING:
  158. _tprintf(_T("> dwSessionType = DVSESSIONTYPE_FORWARDING\n") );
  159. break;
  160. case DVSESSIONTYPE_ECHO:
  161. _tprintf(_T("> dwSessionType = DVSESSIONTYPE_ECHO\n") );
  162. break;
  163. default:
  164. _tprintf(_T("> dwSessionType = Unknown\n") );
  165. break;
  166. }
  167. if( lpdvSessionDesc->dwBufferAggressiveness == DVBUFFERAGGRESSIVENESS_DEFAULT )
  168. {
  169. _tprintf(_T("> dwBufferAggresiveness = DEFAULT\n") );
  170. }
  171. else
  172. {
  173. _tprintf(_T("> dwBufferAggresiveness = %d\n"),lpdvSessionDesc->dwBufferAggressiveness );
  174. }
  175. if( lpdvSessionDesc->dwBufferQuality == DVBUFFERQUALITY_DEFAULT )
  176. {
  177. _tprintf(_T("> dwBufferQuality = DEFAULT\n") );
  178. }
  179. else
  180. {
  181. _tprintf(_T("> dwBufferQuality = %d\n"),lpdvSessionDesc->dwBufferQuality );
  182. }
  183. _tprintf(_T("> guidCT = \n") );
  184. DPVDX_DUMP_GUID( lpdvSessionDesc->guidCT );
  185. _tprintf(_T("\n") );
  186. */
  187. }