diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-10 16:05:53 +0200 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-10 16:05:53 +0200 |
commit | c3d9aa60a799bb45b32c09870f92d576c9b571ce (patch) | |
tree | 2fef4c4b45d63140535d46f61bd104b14ba8c920 /indra/newview/llvoiceclient.cpp | |
parent | 7dabb3c46e6cdf208ce7dc46b89f431a247d6ba6 (diff) | |
parent | 93adff4569d66d0a8699615b7a21d789921ca15c (diff) |
Merge from default branch
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r-- | indra/newview/llvoiceclient.cpp | 50 |
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); } } |