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.

47 lines
1.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef SND_WAVE_DATA_H
  8. #define SND_WAVE_DATA_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "snd_audio_source.h"
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Linear iterator over source data.
  15. // Keeps track of position in source, and maintains necessary buffers
  16. //-----------------------------------------------------------------------------
  17. abstract_class IWaveData
  18. {
  19. public:
  20. virtual ~IWaveData( void ) {}
  21. virtual CAudioSource &Source( void ) = 0;
  22. virtual int ReadSourceData( void **pData, int64 sampleIndex, int sampleCount, char copyBuf[AUDIOSOURCE_COPYBUF_SIZE] ) = 0;
  23. virtual bool IsReadyToMix() = 0;
  24. virtual void UpdateLoopPosition( int nLoopPosition ) = 0;
  25. };
  26. abstract_class IWaveStreamSource
  27. {
  28. public:
  29. virtual int64 UpdateLoopingSamplePosition( int64 samplePosition ) = 0;
  30. virtual void UpdateSamples( char *pData, int sampleCount ) = 0;
  31. virtual int GetLoopingInfo( int *pLoopBlock, int *pNumLeadingSamples, int *pNumTrailingSamples ) = 0;
  32. };
  33. class IFileReadBinary;
  34. class CSfxTable;
  35. extern IWaveData *CreateWaveDataStream( CAudioSource &source, IWaveStreamSource *pStreamSource, const char *pFileName, int dataStart, int dataSize, CSfxTable *pSfx, int startOffset, int skipInitialSamples, SoundError &soundError );
  36. extern IWaveData *CreateWaveDataMemory( CAudioSource &source );
  37. extern IWaveData *CreateWaveDataHRTF(IWaveData* pData, hrtf_info_t* dir);
  38. void PrefetchDataStream( const char *pFileName, int dataOffset, int dataSize );
  39. #endif // SND_WAVE_DATA_H