diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-09 17:51:21 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-09 17:51:21 +0000 |
commit | 8b9c031f596280f79d06f688c2f654d7ec07a7d0 (patch) | |
tree | 8e35a86892af78f13416b1d904da1c9638f48103 /indra/newview/llspeakbutton.cpp | |
parent | 56841bb2118184aa0a0c2b2a8bc52d2b593cc0c5 (diff) |
Smarter mildly-refactored voice-toggle state management.
Diffstat (limited to 'indra/newview/llspeakbutton.cpp')
-rw-r--r-- | indra/newview/llspeakbutton.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 312d7050b9..b2c0fcdaf2 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -93,7 +93,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) addChild(mSpeakBtn); LLTransientFloaterMgr::getInstance()->addControlView(mSpeakBtn); - mSpeakBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_SpeakBtn, this)); + mSpeakBtn->setMouseDownCallback(boost::bind(&LLSpeakButton::onMouseDown_SpeakBtn, this)); + mSpeakBtn->setMouseUpCallback(boost::bind(&LLSpeakButton::onMouseUp_SpeakBtn, this)); mSpeakBtn->setToggleState(FALSE); LLButton::Params show_params = p.show_button; @@ -131,15 +132,15 @@ LLSpeakButton::~LLSpeakButton() { } -void LLSpeakButton::setSpeakBtnToggleState(bool state) +void LLSpeakButton::onMouseDown_SpeakBtn() { - mSpeakBtn->setToggleState(state); + bool down = true; + gVoiceClient->inputUserControlState(down); // this method knows/care about whether this translates into a toggle-to-talk or down-to-talk } - -void LLSpeakButton::onClick_SpeakBtn() +void LLSpeakButton::onMouseUp_SpeakBtn() { - bool speaking = mSpeakBtn->getToggleState(); - gVoiceClient->setUserPTTState(speaking); + bool down = false; + gVoiceClient->inputUserControlState(down); } void LLSpeakButton::onClick_ShowBtn() |