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.

59 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Device Common Routines
  4. //
  5. //=====================================================================================//
  6. #ifndef SND_DEV_COMMON_H
  7. #define SND_DEV_COMMON_H
  8. #pragma once
  9. class CAudioDeviceBase : public IAudioDevice
  10. {
  11. public:
  12. virtual bool IsActive( void ) { return false; }
  13. virtual bool Init( void ) { return false; }
  14. virtual void Shutdown( void ) {}
  15. virtual void Pause( void ) {}
  16. virtual void UnPause( void ) {}
  17. virtual float MixDryVolume( void ) { return 0; }
  18. virtual bool Should3DMix( void ) { return m_bSurround; }
  19. virtual void StopAllSounds( void ) {}
  20. virtual int PaintBegin( float, int soundtime, int paintedtime ) { return 0; }
  21. virtual void PaintEnd( void ) {}
  22. virtual void SpatializeChannel( int volume[CCHANVOLUMES/2], int master_vol, const Vector& sourceDir, float gain, float mono );
  23. virtual void ApplyDSPEffects( int idsp, portable_samplepair_t *pbuffront, portable_samplepair_t *pbufrear, portable_samplepair_t *pbufcenter, int samplecount );
  24. virtual int GetOutputPosition( void ) { return 0; }
  25. virtual void ClearBuffer( void ) {}
  26. virtual void UpdateListener( const Vector& position, const Vector& forward, const Vector& right, const Vector& up ) {}
  27. virtual void MixBegin( int sampleCount );
  28. virtual void MixUpsample( int sampleCount, int filtertype );
  29. virtual void Mix8Mono( channel_t *pChannel, char *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
  30. virtual void Mix8Stereo( channel_t *pChannel, char *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
  31. virtual void Mix16Mono( channel_t *pChannel, short *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
  32. virtual void Mix16Stereo( channel_t *pChannel, short *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
  33. virtual void ChannelReset( int entnum, int channelIndex, float distanceMod ) {}
  34. virtual void TransferSamples( int end ) {}
  35. virtual const char *DeviceName( void ) { return NULL; }
  36. virtual int DeviceChannels( void ) { return 0; }
  37. virtual int DeviceSampleBits( void ) { return 0; }
  38. virtual int DeviceSampleBytes( void ) { return 0; }
  39. virtual int DeviceDmaSpeed( void ) { return 1; }
  40. virtual int DeviceSampleCount( void ) { return 0; }
  41. virtual bool IsSurround( void ) { return m_bSurround; }
  42. virtual bool IsSurroundCenter( void ) { return m_bSurroundCenter; }
  43. virtual bool IsHeadphone( void ) { return m_bHeadphone; }
  44. bool m_bSurround;
  45. bool m_bSurroundCenter;
  46. bool m_bHeadphone;
  47. };
  48. #endif // SND_DEV_COMMON_H