summaryrefslogtreecommitdiff
path: root/indra/newview/llspeakbutton.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-11-09 13:16:18 -0800
committerMark Palange (Mani) <palange@lindenlab.com>2009-11-09 13:16:18 -0800
commitb34b82f7fea702b7cb4309195314c45fd3d2e630 (patch)
tree8af0d2b7f2670902d9b3d7cf878081ffd7aacab7 /indra/newview/llspeakbutton.cpp
parent06ba4927aa8d288b843ed1380132c14938708707 (diff)
parentdc5db676efd340bccd2c6f376c0bcba77e0507c4 (diff)
Automated merge with ssh://hg.lindenlab.com/brad/brad-parabuild
Diffstat (limited to 'indra/newview/llspeakbutton.cpp')
-rw-r--r--indra/newview/llspeakbutton.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp
index cd765b0338..d441762fa6 100644
--- a/indra/newview/llspeakbutton.cpp
+++ b/indra/newview/llspeakbutton.cpp
@@ -62,6 +62,14 @@ LLSpeakButton::Params::Params()
// See widgets/talk_button.xml
}
+void LLSpeakButton::draw()
+{
+ // gVoiceClient is the authoritative global source of info regarding our open-mic state, we merely reflect that state.
+ bool openmic = gVoiceClient->getUserPTTState();
+ mSpeakBtn->setToggleState(openmic);
+ LLUICtrl::draw();
+}
+
LLSpeakButton::LLSpeakButton(const Params& p)
: LLUICtrl(p)
, mPrivateCallPanel(NULL)
@@ -84,7 +92,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;
@@ -122,15 +131,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()