summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-10 17:03:48 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-10 17:03:48 +0200
commitebfb32f35bfeb796b4971f66bd1a9ebdf88be854 (patch)
tree12a2fd956a69147758226f49a437a137f065410f /indra/newview/llvoiceclient.cpp
parent15372bbc342a7b4c7a8d9b2e1bedd52655232ba7 (diff)
parent5377f8628e7f3eda9f497db1c367099ca04726d0 (diff)
Merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp50
1 files changed, 19 insertions, 31 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index df5481c874..39d4bb0c02 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -68,9 +68,6 @@
#include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel
#include "llfloaterchat.h" // for LLFloaterChat::addChat()
-// for Talk Button's state updating
-#include "llnearbychatbar.h"
-
// for base64 decoding
#include "apr_base64.h"
@@ -5791,7 +5788,6 @@ bool LLVoiceClient::getMuteMic() const
void LLVoiceClient::setUserPTTState(bool ptt)
{
mUserPTTState = ptt;
- if (LLNearbyChatBar::instanceExists()) LLNearbyChatBar::getInstance()->setPTTState(ptt);
}
bool LLVoiceClient::getUserPTTState()
@@ -5802,7 +5798,6 @@ bool LLVoiceClient::getUserPTTState()
void LLVoiceClient::toggleUserPTTState(void)
{
mUserPTTState = !mUserPTTState;
- if (LLNearbyChatBar::instanceExists()) LLNearbyChatBar::getInstance()->setPTTState(mUserPTTState);
}
void LLVoiceClient::setVoiceEnabled(bool enabled)
@@ -5930,8 +5925,6 @@ void LLVoiceClient::setMicGain(F32 volume)
void LLVoiceClient::keyDown(KEY key, MASK mask)
{
-// LL_DEBUGS("Voice") << "key is " << LLKeyboard::stringFromKey(key) << LL_ENDL;
-
if (gKeyboard->getKeyRepeated(key))
{
// ignore auto-repeat keys
@@ -5940,44 +5933,39 @@ void LLVoiceClient::keyDown(KEY key, MASK mask)
if(!mPTTIsMiddleMouse)
{
- if(mPTTIsToggle)
- {
- if(key == mPTTKey)
- {
- toggleUserPTTState();
- }
- }
- else if(mPTTKey != KEY_NONE)
- {
- setUserPTTState(gKeyboard->getKeyDown(mPTTKey));
- }
+ bool down = (mPTTKey != KEY_NONE)
+ && gKeyboard->getKeyDown(mPTTKey);
+ inputUserControlState(down);
}
}
void LLVoiceClient::keyUp(KEY key, MASK mask)
{
if(!mPTTIsMiddleMouse)
{
- if(!mPTTIsToggle && (mPTTKey != KEY_NONE))
+ bool down = (mPTTKey != KEY_NONE)
+ && gKeyboard->getKeyDown(mPTTKey);
+ inputUserControlState(down);
+ }
+}
+void LLVoiceClient::inputUserControlState(bool down)
+{
+ if(mPTTIsToggle)
+ {
+ if(down) // toggle open-mic state on 'down'
{
- setUserPTTState(gKeyboard->getKeyDown(mPTTKey));
+ toggleUserPTTState();
}
}
+ else // set open-mic state as an absolute
+ {
+ setUserPTTState(down);
+ }
}
void LLVoiceClient::middleMouseState(bool down)
{
if(mPTTIsMiddleMouse)
{
- if(mPTTIsToggle)
- {
- if(down)
- {
- toggleUserPTTState();
- }
- }
- else
- {
- setUserPTTState(down);
- }
+ inputUserControlState(down);
}
}