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.

56 lines
1.2 KiB

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