From 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:50 -0500 Subject: Second Life viewer sources 1.20.7 --- linden/indra/llaudio/audioengine.cpp | 41 ++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'linden/indra/llaudio/audioengine.cpp') diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index 3e1fdf8..021c940 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp @@ -60,6 +60,7 @@ const F32 MAX_CURRENT_TRANSFER_TIME = 60.f; LLAudioEngine::LLAudioEngine() { + setDefaults(); } @@ -68,30 +69,42 @@ LLAudioEngine::~LLAudioEngine() } -BOOL LLAudioEngine::init(const S32 num_channels, void* userdata) +void LLAudioEngine::setDefaults() { - mMuted = FALSE; - mMasterGain = 1.f; - mInternetStreamGain = 0.125f; - mUserData = userdata; - mLastStatus = 0; + mMaxWindGain = 1.f; - mNumChannels = num_channels; - + mListenerp = NULL; - mMaxWindGain = 1.0; + mMuted = FALSE; + mUserData = NULL; + + mLastStatus = 0; + mNumChannels = 0; mEnableWind = FALSE; S32 i; - for (i = 0; i < MAX_BUFFERS; i++) - { - mBuffers[i] = NULL; - } - for (i = 0; i < num_channels; i++) + for (i = 0; i < MAX_CHANNELS; i++) { mChannels[i] = NULL; } + for (i = 0; i < MAX_BUFFERS; i++) + { + mBuffers[i] = NULL; + } + + mMasterGain = 1.f; + mInternetStreamGain = 0.125f; + mNextWindUpdate = 0.f; +} + + +BOOL LLAudioEngine::init(const S32 num_channels, void* userdata) +{ + setDefaults(); + + mNumChannels = num_channels; + mUserData = userdata; allocateListener(); -- cgit v1.1