Counter Strike : Global Offensive Source Code
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.

66 lines
2.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #ifndef SND_DEV_XAUDIO_H
  7. #define SND_DEV_XAUDIO_H
  8. #pragma once
  9. #include "audio_pch.h"
  10. #include "inetmessage.h"
  11. #include "netmessages.h"
  12. #include "engine/ienginevoice.h"
  13. class IAudioDevice;
  14. IAudioDevice *Audio_CreateXAudioDevice( bool bInitVoice );
  15. #if defined ( _X360 )
  16. class CXboxVoice : public IEngineVoice
  17. {
  18. public:
  19. CXboxVoice();
  20. static const DWORD MAX_VOICE_BUFFER_TIME = 200; // 200ms
  21. void VoiceInit( void );
  22. void VoiceShutdown( void );
  23. void AddPlayerToVoiceList( XUID xPlayer, int iController, uint64 uiFlags );
  24. void RemovePlayerFromVoiceList( XUID xPlayer, int iController );
  25. bool VoiceUpdateData( int iCtrlr );
  26. void GetVoiceData( int iCtrlr, CCLCMsg_VoiceData_t *pData );
  27. void GetVoiceData( int iController, const byte **ppvVoiceDataBuffer, unsigned int *pnumVoiceDataBytes );
  28. void VoiceSendData( int iCtrlr, INetChannel *pChannel );
  29. void VoiceResetLocalData( int iCtrlr );
  30. void PlayIncomingVoiceData( XUID xuid, const byte *pbData, unsigned int dwDataSize, const bool *bAudiblePlayers = NULL );
  31. void UpdateHUDVoiceStatus( void );
  32. void GetRemoteTalkers( int *pNumTalkers, XUID *pRemoteTalkers );
  33. void SetPlaybackPriority( XUID remoteTalker, int iController, int iAllowPlayback );
  34. bool IsLocalPlayerTalking( int controlerID );
  35. bool IsPlayerTalking( XUID uid );
  36. bool IsHeadsetPresent( int id );
  37. void RemoveAllTalkers();
  38. private:
  39. PIXHV2ENGINE m_pXHVEngine;
  40. // Local chat data
  41. static const WORD m_ChatBufferSize = XHV_VOICECHAT_MODE_PACKET_SIZE * XHV_MAX_VOICECHAT_PACKETS;
  42. BYTE m_ChatBuffer[ XUSER_MAX_COUNT ][ m_ChatBufferSize ];
  43. WORD m_wLocalDataSize[ XUSER_MAX_COUNT ];
  44. bool m_bUserRegistered[ XUSER_MAX_COUNT ]; //This is to handle a bug in UnregisterLocalTalker where it crashes on
  45. //unregistering a local talker who has not been registered if the
  46. //controller id is non-0.
  47. // Last voice data sent
  48. DWORD m_dwLastVoiceSend[ XUSER_MAX_COUNT ];
  49. };
  50. CXboxVoice *Audio_GetXVoice( void );
  51. IXAudio2 *Audio_GetXAudio2( void );
  52. #endif
  53. #endif // SND_DEV_XAUDIO_H