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.

114 lines
5.0 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dvshared.h
  6. * Content: Utility functions for DirectXVoice structures.
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 07/06/99 rodtoll Created It
  12. * 07/26/99 rodtoll Added support for DirectXVoiceNotify objects
  13. * 08/04/99 rodtoll Added new validation functions
  14. * 08/25/99 rodtoll General Cleanup/Modifications to support new
  15. * compression sub-system.
  16. * Added new DUMP functions
  17. * Moved several compression functions to dvcdb
  18. * 09/01/99 rodtoll Added check for valid pointers in func calls
  19. * Changed return type on DV_ call to HRESULT
  20. * 09/14/99 rodtoll Added new Init params and DV_ValidMessageArray
  21. * 10/04/99 rodtoll Updated initialize to take LPUNKNOWN instead of LPVOID
  22. * 10/19/99 rodtoll Fix: Bug #113904 - Shutdown issues
  23. * - Added reference count for notify interface, allows
  24. * determination if stopsession should be called from release
  25. * 10/25/99 rodtoll Fix: Bug #114098 - Release/Addref failure from multiple threads
  26. * 01/14/2000 rodtoll Added DV_ValidTargetList function
  27. * 01/27/2000 rodtoll Bug #129934 - Update Create3DSoundBuffer to take DSBUFFERDESC
  28. * Updated param validations to check new params
  29. * 03/29/2000 rodtoll Bug #30753 - Added volatile to the class definition
  30. * 06/21/2000 rodtoll Bug #35767 - Must implement ability for DSound effects processing on Voice buffers
  31. * Updated parameter validation to take new parameters.
  32. * 07/22/2000 rodtoll Bug #40284 - Initialize() and SetNotifyMask() should return invalidparam instead of invalidpointer
  33. * 09/14/2000 rodtoll Bug #45001 - DVOICE: AV if client has targetted > 10 players
  34. *
  35. ***************************************************************************/
  36. #ifndef __DVSHARED_H
  37. #define __DVSHARED_H
  38. struct DIRECTVOICEOBJECT;
  39. class CDirectVoiceEngine;
  40. class CDirectVoiceTransport;
  41. volatile struct DIRECTVOICENOTIFYOBJECT
  42. {
  43. LPVOID lpNotifyVtble;
  44. DIRECTVOICEOBJECT *lpDV;
  45. LONG lRefCnt;
  46. };
  47. volatile struct DIRECTVOICEOBJECT
  48. {
  49. LPVOID lpVtbl;
  50. LONG lIntRefCnt;
  51. CDirectVoiceEngine *lpDVEngine;
  52. CDirectVoiceTransport *lpDVTransport;
  53. DIRECTVOICENOTIFYOBJECT dvNotify;
  54. DNCRITICAL_SECTION csCountLock;
  55. };
  56. typedef DIRECTVOICEOBJECT *LPDIRECTVOICEOBJECT;
  57. typedef DIRECTVOICENOTIFYOBJECT *LPDIRECTVOICENOTIFYOBJECT;
  58. BOOL DV_ValidBufferAggresiveness( DWORD dwValue );
  59. BOOL DV_ValidBufferQuality( DWORD dwValue );
  60. BOOL DV_ValidSensitivity( DWORD dwValue );
  61. HRESULT DV_ValidBufferSettings( LPDIRECTSOUNDBUFFER lpdsBuffer, DWORD dwPriority, DWORD dwFlags, LPWAVEFORMATEX pwfxPlayFormat );
  62. HRESULT DV_ValidClientConfig( LPDVCLIENTCONFIG lpClientConfig );
  63. HRESULT DV_ValidSoundDeviceConfig( LPDVSOUNDDEVICECONFIG lpSoundDeviceConfig, LPWAVEFORMATEX pwfxPlayFormat );
  64. HRESULT DV_ValidSessionDesc( LPDVSESSIONDESC lpSessionDesc );
  65. HRESULT DV_ValidTargetList( PDVID pdvidTargets, DWORD dwNumTargets );
  66. BOOL DV_ValidDirectVoiceObject( LPDIRECTVOICEOBJECT lpdv );
  67. BOOL DV_ValidDirectXVoiceClientObject( LPDIRECTVOICEOBJECT lpdvc );
  68. BOOL DV_ValidDirectXVoiceServerObject( LPDIRECTVOICEOBJECT lpdvs );
  69. HRESULT DV_ValidMessageArray( LPDWORD lpdwMessages, DWORD dwNumMessages, BOOL fServer );
  70. STDAPI DV_AddRef(LPDIRECTVOICEOBJECT lpDV );
  71. STDAPI DV_Initialize( LPDIRECTVOICEOBJECT lpdvObject, LPUNKNOWN lpTransport, LPDVMESSAGEHANDLER lpMessageHandler, LPVOID lpUserContext, LPDWORD lpdwMessages, DWORD dwNumElements );
  72. DWORD DV_GetWaveFormatExSize( LPWAVEFORMATEX lpwfxFormat );
  73. HRESULT DV_CopySessionDescToBuffer( LPVOID lpTarget, LPDVSESSIONDESC lpdvSessionDesc, LPDWORD lpdwSize );
  74. HRESULT DV_CopyCompressionInfoArrayToBuffer( LPVOID lpTarget, LPDVCOMPRESSIONINFO lpdvCompressionList, LPDWORD lpdwSize, DWORD dwNumElements );
  75. void DV_DUMP_Caps( LPDVCAPS lpdvCaps );
  76. void DV_DUMP_CompressionInfo( LPDVCOMPRESSIONINFO lpdvCompressionInfo, DWORD dwNumElements );
  77. void DV_DUMP_FullCompressionInfo( LPDVFULLCOMPRESSIONINFO lpdvfCompressionInfo, DWORD dwNumElements );
  78. void DV_DUMP_SessionDesc( LPDVSESSIONDESC lpdvSessionDesc );
  79. void DV_DUMP_SoundDeviceConfig( LPDVSOUNDDEVICECONFIG lpdvSoundConfig );
  80. void DV_DUMP_ClientConfig( LPDVCLIENTCONFIG lpdvClientConfig );
  81. void DV_DUMP_WaveFormatEx( LPWAVEFORMATEX lpwfxFormat );
  82. void DV_DUMP_GUID( GUID guid );
  83. #ifdef _DEBUG
  84. #define DV_DUMP_CI( ci, ne ) DV_DUMP_CompressionInfo( ci, ne )
  85. #define DV_DUMP_SD( sd ) DV_DUMP_SessionDesc( sd )
  86. #define DV_DUMP_SDC( sdc ) DV_DUMP_SoundDeviceConfig( sdc )
  87. #define DV_DUMP_CC( cc ) DV_DUMP_ClientConfig( cc )
  88. #define DV_DUMP_CAPS( caps ) DV_DUMP_Caps( caps )
  89. #define DV_DUMP_CIF( cif, ne ) DV_DUMP_FullCompressionInfo( cif, ne )
  90. #else
  91. #define DV_DUMP_CIF( cif, ne )
  92. #define DV_DUMP_CI( ci, ne )
  93. #define DV_DUMP_SD( sd )
  94. #define DV_DUMP_SDC( sdc )
  95. #define DV_DUMP_CC( cc )
  96. #define DV_DUMP_CAPS( caps )
  97. #endif
  98. #define DV_MAX_TARGETS 64
  99. #define CLIENT_POOLS_NUM_TARGETS_BUFFERED DV_MAX_TARGETS
  100. #endif