Team Fortress 2 Source Code as on 22/4/2020
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.

64 lines
1.8 KiB

  1. //========= Copyright 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. class IAudioDevice;
  13. IAudioDevice *Audio_CreateXAudioDevice( void );
  14. #if defined ( _X360 )
  15. class CClientInfo;
  16. void VOICE_AddPlayerToVoiceList( CClientInfo *pClient, bool bLocal );
  17. class CXboxVoice
  18. {
  19. public:
  20. static const DWORD MAX_VOICE_BUFFER_TIME = 200; // 200ms
  21. CXboxVoice( void );
  22. void VoiceInit( void );
  23. void VoiceShutdown( void );
  24. void AddPlayerToVoiceList( CClientInfo *pClient, bool bLocal );
  25. void RemovePlayerFromVoiceList( CClientInfo *pClient, bool bLocal );
  26. bool VoiceUpdateData( void );
  27. void GetVoiceData( CLC_VoiceData *pData );
  28. void VoiceSendData( INetChannel *pChannel );
  29. void VoiceResetLocalData( void );
  30. void PlayIncomingVoiceData( XUID xuid, const byte *pbData, DWORD pdwSize );
  31. void UpdateHUDVoiceStatus( void );
  32. void GetRemoteTalkers( int *pNumTalkers, XUID *pRemoteTalkers );
  33. void SetPlaybackPriority( XUID remoteTalker, DWORD dwUserIndex, XHV_PLAYBACK_PRIORITY playbackPriority );
  34. bool IsPlayerTalking( XUID uid, bool bLocal );
  35. bool IsHeadsetPresent( int id );
  36. void RemoveAllTalkers( CClientInfo *pLocal );
  37. private:
  38. PIXHV2ENGINE m_pXHVEngine;
  39. // Local chat data
  40. static const WORD m_ChatBufferSize = XHV_VOICECHAT_MODE_PACKET_SIZE * XHV_MAX_VOICECHAT_PACKETS;
  41. BYTE m_ChatBuffer[ m_ChatBufferSize ];
  42. WORD m_wLocalDataSize;
  43. // Last voice data sent
  44. DWORD m_dwLastVoiceSend;
  45. };
  46. CXboxVoice *Audio_GetXVoice( void );
  47. IXAudio2 *Audio_GetXAudio2( void );
  48. #endif
  49. #endif // SND_DEV_XAUDIO_H