aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvieweraudio.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llvieweraudio.cpp44
1 files changed, 30 insertions, 14 deletions
diff --git a/linden/indra/newview/llvieweraudio.cpp b/linden/indra/newview/llvieweraudio.cpp
index 1e6c2ca..58ce7a7 100644
--- a/linden/indra/newview/llvieweraudio.cpp
+++ b/linden/indra/newview/llvieweraudio.cpp
@@ -1,17 +1,27 @@
1/** 1/**
2 * @file llvieweraudio.cpp 2 * @file llvieweraudio.cpp
3 * @brief Audio functions moved from viewer.cpp 3 * @brief Audio functions that used to be in viewer.cpp
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=internal$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2000-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2008, Linden Research, Inc.
8 * 8 *
9 * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of 9 * Second Life Viewer Source Code
10 * this source code is governed by the Linden Lab Source Code Disclosure 10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * Agreement ("Agreement") previously entered between you and Linden 11 * to you under the terms of the GNU General Public License, version 2.0
12 * Lab. By accessing, using, copying, modifying or distributing this 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * software, you acknowledge that you have been informed of your 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * obligations under the Agreement and agree to abide by those obligations. 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
15 * 25 *
16 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
17 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
@@ -136,8 +146,10 @@ void audio_update_volume(bool force_update)
136 if (gAudiop) 146 if (gAudiop)
137 { 147 {
138 F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); 148 F32 music_volume = gSavedSettings.getF32("AudioLevelMusic");
149 BOOL music_muted = gSavedSettings.getBOOL("MuteMusic");
139 music_volume = mute_volume * master_volume * (music_volume*music_volume); 150 music_volume = mute_volume * master_volume * (music_volume*music_volume);
140 gAudiop->setInternetStreamGain ( music_volume ); 151 gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume );
152
141 } 153 }
142 154
143 // Streaming Media 155 // Streaming Media
@@ -145,7 +157,8 @@ void audio_update_volume(bool force_update)
145 { 157 {
146 F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); 158 F32 media_volume = gSavedSettings.getF32("AudioLevelMedia");
147 media_volume = mute_volume * master_volume * (media_volume*media_volume); 159 media_volume = mute_volume * master_volume * (media_volume*media_volume);
148 LLMediaEngine::getInstance()->setVolume(media_volume); 160 BOOL media_muted = gSavedSettings.getBOOL("MuteMedia");
161 LLMediaEngine::getInstance()->setVolume(media_muted ? 0.f : media_volume);
149 } 162 }
150 163
151 // Voice 164 // Voice
@@ -153,8 +166,9 @@ void audio_update_volume(bool force_update)
153 { 166 {
154 F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); 167 F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice");
155 voice_volume = mute_volume * master_volume * voice_volume; 168 voice_volume = mute_volume * master_volume * voice_volume;
156 gVoiceClient->setVoiceVolume(voice_volume); 169 BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice");
157 gVoiceClient->setMicGain(gSavedSettings.getF32("AudioLevelMic")); 170 gVoiceClient->setVoiceVolume(voice_mute ? 0.f : voice_volume);
171 gVoiceClient->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic"));
158 172
159 if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) 173 if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized")))
160 { 174 {
@@ -221,7 +235,9 @@ void audio_update_wind(bool force_update)
221 // want to screw up the fade-in on startup by setting actual source gain 235 // want to screw up the fade-in on startup by setting actual source gain
222 // outside the fade-in. 236 // outside the fade-in.
223 F32 ambient_volume = gSavedSettings.getF32("AudioLevelAmbient"); 237 F32 ambient_volume = gSavedSettings.getF32("AudioLevelAmbient");
224 gAudiop->mMaxWindGain = ambient_volume * ambient_volume; 238 gAudiop->mMaxWindGain = gSavedSettings.getBOOL("MuteAmbient")
239 ? 0.f
240 : ambient_volume * ambient_volume;
225 241
226 last_camera_water_height = camera_water_height; 242 last_camera_water_height = camera_water_height;
227 gAudiop->updateWind(gRelativeWindVec, camera_water_height); 243 gAudiop->updateWind(gRelativeWindVec, camera_water_height);