summaryrefslogtreecommitdiff
path: root/soundsystem/snd_audio_source.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /soundsystem/snd_audio_source.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'soundsystem/snd_audio_source.cpp')
-rw-r--r--soundsystem/snd_audio_source.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/soundsystem/snd_audio_source.cpp b/soundsystem/snd_audio_source.cpp
new file mode 100644
index 0000000..fb4fe2b
--- /dev/null
+++ b/soundsystem/snd_audio_source.cpp
@@ -0,0 +1,58 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+#include <stdio.h>
+#include "soundsystem/snd_audio_source.h"
+#include "soundsystem/isoundsystem.h"
+#include "soundsystem.h"
+
+
+
+extern CAudioSource *Audio_CreateMemoryWave( const char *pName );
+
+//-----------------------------------------------------------------------------
+// Purpose: Simple wrapper to crack naming convention and create the proper wave source
+// Input : *pName - WAVE filename
+// Output : CAudioSource
+//-----------------------------------------------------------------------------
+CAudioSource *AudioSource_Create( const char *pName )
+{
+ if ( !pName )
+ return NULL;
+
+// if ( pName[0] == '!' ) // sentence
+ ;
+
+ // Names that begin with "*" are streaming.
+ // Skip over the * and create a streamed source
+ if ( pName[0] == '*' )
+ {
+
+ return NULL;
+ }
+
+ // These are loaded into memory directly
+ return Audio_CreateMemoryWave( pName );
+}
+
+CAudioSource::~CAudioSource( void )
+{
+ CAudioMixer *mixer;
+
+ while ( 1 )
+ {
+ mixer = g_pSoundSystem->FindMixer( this );
+ if ( !mixer )
+ break;
+
+ g_pSoundSystem->StopSound( mixer );
+ }
+}
+
+CAudioSource::CAudioSource( void )
+{
+}