summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-04-28 17:48:05 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-04-28 17:48:05 -0700
commitb6ba0da7f5e8d830f776ec974287b2d451a4715f (patch)
tree3810085ccc4e8225138254eceb6622b4b54fa736 /indra/newview
parentb8688c8860aea64ecd51a60011b918a7527315a6 (diff)
Media sound attentuation first pass
reviewed by Richard
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/llviewermedia.cpp12
2 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index a6dbe00759..6f11a6d616 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5838,7 +5838,18 @@
<key>Value</key>
<real>1.0</real>
</map>
- <key>RecentItemsSortOrder</key>
+ <key>MediaRollOffFactor</key>
+ <map>
+ <key>Comment</key>
+ <string>Multiplier to change rate of media attenuation</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>10.0</real>
+ </map>
+ <key>RecentItemsSortOrder</key>
<map>
<key>Comment</key>
<string>Specifies sort key for recent inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string>
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 3c0345df90..fd2bb0fdf9 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1914,7 +1914,15 @@ void LLViewerMediaImpl::updateVolume()
{
if(mMediaSource)
{
- mMediaSource->setVolume(mRequestedVolume * LLViewerMedia::getVolume());
+ F32 attenuation_multiplier = 1.0;
+
+ if (mProximityDistance > 0)
+ {
+ // the attenuation multiplier should never be more than one since that would increase volume
+ attenuation_multiplier = llmin(1.0, gSavedSettings.getF32("MediaRollOffFactor")/mProximityDistance);
+ }
+
+ mMediaSource->setVolume(mRequestedVolume * LLViewerMedia::getVolume() * attenuation_multiplier);
}
}
@@ -2427,6 +2435,8 @@ void LLViewerMediaImpl::update()
}
else
{
+ updateVolume();
+
// If we didn't just create the impl, it may need to get cookie updates.
if(!sUpdatedCookies.empty())
{