From 5561001c926cb0f005d54cb5e9cf4f57d5e0ba15 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 14:24:40 +0000 Subject: randgauss.h isn't *really* used by the viewer - remove #include and move it to llmath with ll-header naming convention. --- indra/llmath/CMakeLists.txt | 1 + indra/newview/CMakeLists.txt | 1 - indra/newview/llvowater.cpp | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 7957c32be2..8ae643099f 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -55,6 +55,7 @@ set(llmath_HEADER_FILES llplane.h llquantize.h llquaternion.h + llrandgauss.h llrect.h llsphere.h lltreenode.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 08e43da9e4..649d86aaa6 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1031,7 +1031,6 @@ set(viewer_HEADER_FILES macmain.h noise.h pipeline.h - randgauss.h VertexCache.h VorbisFramework.h ) diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index e5ff62746e..a8c4625f6e 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -55,8 +55,6 @@ const BOOL gUseRoam = FALSE; /////////////////////////////////// -#include "randgauss.h" - template inline T LERP(T a, T b, F32 factor) { return a + (b - a) * factor; -- cgit v1.2.3 From fbf57b442b7291b354f63f46c3bdfb1b85439866 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 14:26:10 +0000 Subject: ... remove unused llrandgauss.h - because on second thoughts, there's not much wisdom in carrying probably-not-tested-for-years code around 'just in case'. --- indra/llmath/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 8ae643099f..7957c32be2 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -55,7 +55,6 @@ set(llmath_HEADER_FILES llplane.h llquantize.h llquaternion.h - llrandgauss.h llrect.h llsphere.h lltreenode.h -- cgit v1.2.3 From a492b2815a66f41bde0138444d410209b6b615f8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 14:41:31 +0000 Subject: trivial comment fix while I was there. --- indra/newview/llvoiceclient.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 9df96d9a52..2b61086680 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -196,7 +196,7 @@ static void updatePosition(void); void setEarLocation(S32 loc); void setVoiceVolume(F32 volume); void setMicGain(F32 volume); - void setUserVolume(const LLUUID& id, F32 volume); // set's volume for specified agent, from 0-1 (where .5 is nominal) + void setUserVolume(const LLUUID& id, F32 volume); // sets volume for specified agent, from 0-1 (where .5 is nominal) void setLipSyncEnabled(BOOL enabled); BOOL lipSyncEnabled(); -- cgit v1.2.3 From e9d09879d6aed037710f4f023ca7e01195a42bf8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:06:49 +0000 Subject: Don't have LLVoiceClient manually poke the nearbychatbar's 'speak' button's visual state as a special case - all speak buttons will soon know how to poll (sigh) the ptt state, with more reliability. --- indra/newview/llnearbychatbar.cpp | 5 ----- indra/newview/llnearbychatbar.h | 1 - indra/newview/llvoiceclient.cpp | 2 -- 3 files changed, 8 deletions(-) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index bcb4edd7c1..d54545971b 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -695,11 +695,6 @@ LLWString LLNearbyChatBar::stripChannelNumber(const LLWString &mesg, S32* channe } } -void LLNearbyChatBar::setPTTState(bool state) -{ - mSpeakBtn->setSpeakBtnToggleState(state); -} - void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) { LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index aa25b6aa68..56ee706a97 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -96,7 +96,6 @@ public: std::string getCurrentChat(); virtual BOOL handleKeyHere( KEY key, MASK mask ); - void setPTTState(bool state); static void startChat(const char* line); static void stopChat(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index df5481c874..5e7afe1913 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5791,7 +5791,6 @@ bool LLVoiceClient::getMuteMic() const void LLVoiceClient::setUserPTTState(bool ptt) { mUserPTTState = ptt; - if (LLNearbyChatBar::instanceExists()) LLNearbyChatBar::getInstance()->setPTTState(ptt); } bool LLVoiceClient::getUserPTTState() @@ -5802,7 +5801,6 @@ bool LLVoiceClient::getUserPTTState() void LLVoiceClient::toggleUserPTTState(void) { mUserPTTState = !mUserPTTState; - if (LLNearbyChatBar::instanceExists()) LLNearbyChatBar::getInstance()->setPTTState(mUserPTTState); } void LLVoiceClient::setVoiceEnabled(bool enabled) -- cgit v1.2.3 From 7804990998c1cc4cb0faa5fd7b37b3a22321c3b6 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:07:36 +0000 Subject: remove #include no longer needed. --- indra/newview/llvoiceclient.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 5e7afe1913..f303f14843 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" -- cgit v1.2.3 From e9048b17792b91e6bf8a05692d859ea9c94011d6 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:13:37 +0000 Subject: Central-source the authoritative state of mic openness. --- indra/newview/llbottomtray.cpp | 1 - indra/newview/llspeakbutton.cpp | 9 +++++++++ indra/newview/llspeakbutton.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index a17ba79078..e5cc2fce88 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -50,7 +50,6 @@ LLBottomTray::LLBottomTray(const LLSD&) mSpeakBtn(NULL), mNearbyChatBar(NULL), mToolbarStack(NULL) - { mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index cd765b0338..312d7050b9 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -62,6 +62,15 @@ 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); + llinfos << "mic state " << int(openmic) << llendl; + LLUICtrl::draw(); +} + LLSpeakButton::LLSpeakButton(const Params& p) : LLUICtrl(p) , mPrivateCallPanel(NULL) diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h index f59ded2133..48a4d5880b 100644 --- a/indra/newview/llspeakbutton.h +++ b/indra/newview/llspeakbutton.h @@ -61,6 +61,7 @@ public: }; /*virtual*/ ~LLSpeakButton(); + /*virtual*/ void draw(); void setSpeakBtnToggleState(bool state); -- cgit v1.2.3 From 56841bb2118184aa0a0c2b2a8bc52d2b593cc0c5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:45:53 +0000 Subject: don't have the 'speak' button be, technically, a toggle button - we'll be managing its state rather manually, not necessarily conforming to 'toggle' semantics. --- indra/newview/skins/default/xui/en/widgets/talk_button.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/widgets/talk_button.xml b/indra/newview/skins/default/xui/en/widgets/talk_button.xml index d9f39b6937..1d8257fbc8 100644 --- a/indra/newview/skins/default/xui/en/widgets/talk_button.xml +++ b/indra/newview/skins/default/xui/en/widgets/talk_button.xml @@ -11,7 +11,6 @@ label_selected="Speak" font="SansSerifSmall" tab_stop="false" - is_toggle="true" /> Date: Mon, 9 Nov 2009 17:51:21 +0000 Subject: Smarter mildly-refactored voice-toggle state management. --- indra/newview/llspeakbutton.cpp | 15 +++++++------- indra/newview/llspeakbutton.h | 6 ++---- indra/newview/llvoiceclient.cpp | 45 +++++++++++++++++------------------------ indra/newview/llvoiceclient.h | 1 + 4 files changed, 30 insertions(+), 37 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() diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h index 48a4d5880b..e213c562dd 100644 --- a/indra/newview/llspeakbutton.h +++ b/indra/newview/llspeakbutton.h @@ -45,7 +45,6 @@ class LLOutputMonitorCtrl; * clicked. */ class LLSpeakButton : public LLUICtrl - { public: @@ -63,13 +62,12 @@ public: /*virtual*/ ~LLSpeakButton(); /*virtual*/ void draw(); - void setSpeakBtnToggleState(bool state); - protected: friend class LLUICtrlFactory; LLSpeakButton(const Params& p); - void onClick_SpeakBtn(); + void onMouseDown_SpeakBtn(); + void onMouseUp_SpeakBtn(); void onClick_ShowBtn(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index f303f14843..39d4bb0c02 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5925,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 @@ -5935,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); } } diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 2b61086680..347fae6156 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -188,6 +188,7 @@ static void updatePosition(void); void setUserPTTState(bool ptt); bool getUserPTTState(); void toggleUserPTTState(void); + void inputUserControlState(bool down); // interpret any sort of up-down mic-open control input according to ptt-toggle prefs void setVoiceEnabled(bool enabled); static bool voiceEnabled(); void setUsePTT(bool usePTT); -- cgit v1.2.3 From 0777c177525c8ff2889e9cd5f06877de3c5f9f31 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:54:40 +0000 Subject: remove debug spew. --- indra/newview/llspeakbutton.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index b2c0fcdaf2..d441762fa6 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -67,7 +67,6 @@ 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); - llinfos << "mic state " << int(openmic) << llendl; LLUICtrl::draw(); } -- cgit v1.2.3