aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llvoiceclient.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llvoiceclient.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index 6079447..45935db 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -2286,10 +2286,19 @@ void LLVoiceClient::tuningSetMicVolume(float volume)
2286 2286
2287void LLVoiceClient::tuningSetSpeakerVolume(float volume) 2287void LLVoiceClient::tuningSetSpeakerVolume(float volume)
2288{ 2288{
2289 int scaledVolume = ((int)(volume * 100.0f)) - 100; 2289 // incoming volume has the range [0.0 ... 1.0], with 0.5 as the default.
2290 // Map it as follows: 0.0 -> -100, 0.5 -> 24, 1.0 -> 50
2291
2292 volume -= 0.5f; // offset volume to the range [-0.5 ... 0.5], with 0 at the default.
2293 int scaledVolume = 24; // offset scaledVolume by its default level
2294 if(volume < 0.0f)
2295 scaledVolume += ((int)(volume * 248.0f)); // (24 - (-100)) * 2
2296 else
2297 scaledVolume += ((int)(volume * 52.0f)); // (50 - 24) * 2
2298
2290 if(scaledVolume != mTuningSpeakerVolume) 2299 if(scaledVolume != mTuningSpeakerVolume)
2291 { 2300 {
2292 mTuningSpeakerVolume = ((int)(volume * 100.0f)) - 100; 2301 mTuningSpeakerVolume = scaledVolume;
2293 mTuningSpeakerVolumeDirty = true; 2302 mTuningSpeakerVolumeDirty = true;
2294 } 2303 }
2295} 2304}
@@ -3690,7 +3699,18 @@ void LLVoiceClient::setEarLocation(S32 loc)
3690 3699
3691void LLVoiceClient::setVoiceVolume(F32 volume) 3700void LLVoiceClient::setVoiceVolume(F32 volume)
3692{ 3701{
3693 int scaledVolume = ((int)(volume * 100.0f)) - 100; 3702// llinfos << "volume is " << volume << llendl;
3703
3704 // incoming volume has the range [0.0 ... 1.0], with 0.5 as the default.
3705 // Map it as follows: 0.0 -> -100, 0.5 -> 24, 1.0 -> 50
3706
3707 volume -= 0.5f; // offset volume to the range [-0.5 ... 0.5], with 0 at the default.
3708 int scaledVolume = 24; // offset scaledVolume by its default level
3709 if(volume < 0.0f)
3710 scaledVolume += ((int)(volume * 248.0f)); // (24 - (-100)) * 2
3711 else
3712 scaledVolume += ((int)(volume * 52.0f)); // (50 - 24) * 2
3713
3694 if(scaledVolume != mSpeakerVolume) 3714 if(scaledVolume != mSpeakerVolume)
3695 { 3715 {
3696 if((scaledVolume == -100) || (mSpeakerVolume == -100)) 3716 if((scaledVolume == -100) || (mSpeakerVolume == -100))