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.

70 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef ISOUNDSYSTEM_H
  7. #define ISOUNDSYSTEM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "appframework/iappsystem.h"
  12. //-----------------------------------------------------------------------------
  13. // Forward declarations
  14. //-----------------------------------------------------------------------------
  15. class IAudioDevice;
  16. class CAudioSource;
  17. class CAudioMixer;
  18. //-----------------------------------------------------------------------------
  19. // Sound handle
  20. //-----------------------------------------------------------------------------
  21. typedef unsigned short AudioSourceHandle_t;
  22. enum
  23. {
  24. AUDIOSOURCEHANDLE_INVALID = (AudioSourceHandle_t)~0
  25. };
  26. //-----------------------------------------------------------------------------
  27. // Flags for FindAudioSource
  28. //-----------------------------------------------------------------------------
  29. enum FindAudioSourceFlags_t
  30. {
  31. FINDAUDIOSOURCE_NODELAY = 0x1,
  32. FINDAUDIOSOURCE_PREFETCH = 0x2,
  33. FINDAUDIOSOURCE_PLAYONCE = 0x4,
  34. };
  35. //-----------------------------------------------------------------------------
  36. // Purpose: DLL interface for low-level sound utilities
  37. //-----------------------------------------------------------------------------
  38. #define SOUNDSYSTEM_INTERFACE_VERSION "SoundSystem001"
  39. abstract_class ISoundSystem : public IAppSystem
  40. {
  41. public:
  42. virtual void Update( float time ) = 0;
  43. virtual void Flush( void ) = 0;
  44. virtual CAudioSource *FindOrAddSound( const char *filename ) = 0;
  45. virtual CAudioSource *LoadSound( const char *wavfile ) = 0;
  46. virtual void PlaySound( CAudioSource *source, float volume, CAudioMixer **ppMixer ) = 0;
  47. virtual bool IsSoundPlaying( CAudioMixer *pMixer ) = 0;
  48. virtual CAudioMixer *FindMixer( CAudioSource *source ) = 0;
  49. virtual void StopAll( void ) = 0;
  50. virtual void StopSound( CAudioMixer *mixer ) = 0;
  51. };
  52. #endif // ISOUNDSYSTEM_H