hl2_src-leak-2017/src/utils/hlfaceposer/snd_audio_source.cpp
BotoX 60f625f414 import hl2_src from full.7z
source: magnet:?xt=urn:btih:21DDA6847DDE983F2F8063739249D2D1D09A5DDA
2020-12-25 16:26:23 +01:00

64 lines
1.3 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#include <stdio.h>
#include "snd_audio_source.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 );
}
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "hlfaceposer.h"
#include "ifaceposersound.h"
CAudioSource::~CAudioSource( void )
{
CAudioMixer *mixer;
while ( 1 )
{
mixer = sound->FindMixer( this );
if ( !mixer )
break;
sound->StopSound( mixer );
}
sound->EnsureNoModelReferences( this );
}
CAudioSource::CAudioSource( void )
{
}