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.

61 lines
1.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include <stdio.h>
  9. #include "soundsystem/snd_audio_source.h"
  10. #include "soundsystem/isoundsystem.h"
  11. #include "soundsystem.h"
  12. // NOTE: This has to be the last file included!
  13. #include "tier0/memdbgon.h"
  14. extern CAudioSource *Audio_CreateMemoryWave( const char *pName );
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Simple wrapper to crack naming convention and create the proper wave source
  17. // Input : *pName - WAVE filename
  18. // Output : CAudioSource
  19. //-----------------------------------------------------------------------------
  20. CAudioSource *AudioSource_Create( const char *pName )
  21. {
  22. if ( !pName )
  23. return NULL;
  24. // if ( pName[0] == '!' ) // sentence
  25. ;
  26. // Names that begin with "*" are streaming.
  27. // Skip over the * and create a streamed source
  28. if ( pName[0] == '*' )
  29. {
  30. return NULL;
  31. }
  32. // These are loaded into memory directly
  33. return Audio_CreateMemoryWave( pName );
  34. }
  35. CAudioSource::~CAudioSource( void )
  36. {
  37. CAudioMixer *mixer;
  38. while ( 1 )
  39. {
  40. mixer = g_pSoundSystem->FindMixer( this );
  41. if ( !mixer )
  42. break;
  43. g_pSoundSystem->StopSound( mixer );
  44. }
  45. }
  46. CAudioSource::CAudioSource( void )
  47. {
  48. }