From 7f858539851bac96f2a20e50f7e94010a015808c Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 14 Feb 2009 05:21:14 -0700 Subject: Fixed sound settings not being correctly muted --- linden/indra/newview/app_settings/settings.xml | 2 +- linden/indra/newview/llviewermessage.cpp | 4 ++++ linden/indra/newview/llviewerobject.cpp | 6 +++--- linden/indra/newview/llvoavatar.cpp | 13 +++++-------- 4 files changed, 13 insertions(+), 12 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 779b668..9ec5727 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -284,7 +284,7 @@ Type F32 Value - 1.0 + 0.5 AudioLevelUI diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 4543ae4..b947f95 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -111,6 +111,7 @@ #include "llui.h" // for make_ui_sound #include "lluploaddialog.h" #include "llviewercamera.h" +#include "llviewercontrol.h" #include "llviewergenericmessage.h" #include "llviewerinventory.h" #include "llviewermenu.h" @@ -3291,6 +3292,9 @@ void process_sound_trigger(LLMessageSystem *msg, void **) pos_global.mdV[VY] += pos_local.mV[VY]; pos_global.mdV[VZ] += pos_local.mV[VZ]; + // Don't play sounds if sound settings are muted. + if (gSavedSettings.getBOOL("MuteSounds")) return; + // Don't play a trigger sound if you can't hear it due // to parcel "local audio only" settings. if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global)) return; diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index c560ced..cb3afc5 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp @@ -2766,7 +2766,7 @@ BOOL LLViewerObject::updateLOD() // Update volume of looping sounds if (mAudioSourcep && mAudioSourcep->isLoop()) { - F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : (mAudioGain * gSavedSettings.getF32("AudioLevelSFX")); + F32 volume = mAudioGain * gSavedSettings.getF32("AudioLevelSFX"); mAudioSourcep->setGain(volume); } return FALSE; @@ -4331,7 +4331,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow { BOOL queue = flags & LL_SOUND_FLAG_QUEUE; mAudioGain = gain; - F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : gain * gSavedSettings.getF32("AudioLevelSFX"); + F32 volume = gain * gSavedSettings.getF32("AudioLevelSFX"); mAudioSourcep->setGain(volume); mAudioSourcep->setLoop(flags & LL_SOUND_FLAG_LOOP); mAudioSourcep->setSyncMaster(flags & LL_SOUND_FLAG_SYNC_MASTER); @@ -4370,7 +4370,7 @@ void LLViewerObject::adjustAudioGain(const F32 gain) if (mAudioSourcep) { mAudioGain = gain; - F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : mAudioGain * gSavedSettings.getF32("AudioLevelSFX"); + F32 volume = mAudioGain * gSavedSettings.getF32("AudioLevelSFX"); mAudioSourcep->setGain(volume); } } diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index d41f72e..fd2487b 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -3797,7 +3797,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) const LLUUID AGENT_FOOTSTEP_ANIMS[] = {ANIM_AGENT_WALK, ANIM_AGENT_RUN, ANIM_AGENT_LAND}; const S32 NUM_AGENT_FOOTSTEP_ANIMS = sizeof(AGENT_FOOTSTEP_ANIMS) / sizeof(LLUUID); - if ( gAudiop && isAnyAnimationSignaled(AGENT_FOOTSTEP_ANIMS, NUM_AGENT_FOOTSTEP_ANIMS) ) + if ( gAudiop && !gSavedSettings.getBOOL("MuteAmbient") && isAnyAnimationSignaled(AGENT_FOOTSTEP_ANIMS, NUM_AGENT_FOOTSTEP_ANIMS) ) { BOOL playSound = FALSE; LLVector3 foot_pos_agent; @@ -3828,7 +3828,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // AUDIO_STEP_LO_SPEED, AUDIO_STEP_HI_SPEED, // AUDIO_STEP_LO_GAIN, AUDIO_STEP_HI_GAIN ); - const F32 STEP_VOLUME = 0.5f; + const F32 STEP_VOLUME = 0.2f; LLUUID& step_sound_id = getStepSound(); LLVector3d foot_pos_global = gAgent.getPosGlobalFromAgent(foot_pos_agent); @@ -4800,7 +4800,7 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL { if (anim_id == ANIM_AGENT_TYPE) { - if (gAudiop) + if (gAudiop && !gSavedSettings.getBOOL("MuteAmbient")) { LLVector3d char_pos_global = gAgent.getPosGlobalFromAgent(getCharacterPosition()); if (LLViewerParcelMgr::getInstance()->canHearSound(char_pos_global) @@ -4814,11 +4814,8 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL // gAudiop->triggerSound(LLUUID(gSavedSettings.getString("UISndTyping")), volume); //} //else - { - LLUUID sound_id = LLUUID(gSavedSettings.getString("UISndTyping")); - gAudiop->triggerSound(sound_id, getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_SFX, char_pos_global); - - } + LLUUID sound_id = LLUUID(gSavedSettings.getString("UISndTyping")); + gAudiop->triggerSound(sound_id, getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_SFX, char_pos_global); } } } -- cgit v1.1