summaryrefslogtreecommitdiff
path: root/indra/newview/lloutputmonitorctrl.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2009-08-04 01:12:59 +0000
committerRichard Nelson <richard@lindenlab.com>2009-08-04 01:12:59 +0000
commiteb853f55c07ae4a3c3f2aa05fbabcf2e4b4dc115 (patch)
tree7707fccb8d0946b6257d5ed7c5dfd3941c53eec0 /indra/newview/lloutputmonitorctrl.cpp
parentdb5cda26676f376f18816013c0c5e3fbad5b20d0 (diff)
svn merge -r 128442:129343 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-18 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
Diffstat (limited to 'indra/newview/lloutputmonitorctrl.cpp')
-rw-r--r--indra/newview/lloutputmonitorctrl.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index 955f50caf5..d088c45710 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -70,6 +70,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p)
: LLView(p),
mPower(0),
mIsMuted(true),
+ mIsTalking(false),
mImageMute(p.image_mute),
mImageOff(p.image_off),
mImageOn(p.image_on),
@@ -116,31 +117,32 @@ void LLOutputMonitorCtrl::draw()
// call directly into gVoiceClient to ask if that agent-id is muted, is
// speaking, and what power. This avoids duplicating data, which can get
// out of sync.
+ const F32 LEVEL_0 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL / 3.f;
+ const F32 LEVEL_1 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL * 2.f / 3.f;
+ const F32 LEVEL_2 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL;
+
LLPointer<LLUIImage> icon;
if (mIsMuted)
{
icon = mImageMute;
}
- else if (mPower == 0.f)
+ else if (mPower == 0.f && !mIsTalking)
{
+ // only show off if PTT is not engaged
icon = mImageOff;
}
- else if (mPower < LLVoiceClient::OVERDRIVEN_POWER_LEVEL)
+ else if (mPower < LEVEL_0)
+ {
+ // PTT is on, possibly with quiet background noise
+ icon = mImageOn;
+ }
+ else if (mPower < LEVEL_1)
+ {
+ icon = mImageLevel1;
+ }
+ else if (mPower < LEVEL_2)
{
- S32 icon_image_idx = llmin(2, llfloor((mPower / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 3.f));
- switch(icon_image_idx)
- {
- default:
- case 0:
- icon = mImageOn;
- break;
- case 1:
- icon = mImageLevel1;
- break;
- case 2:
- icon = mImageLevel2;
- break;
- }
+ icon = mImageLevel2;
}
else
{