summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorcallum <none@none>2011-10-10 17:29:04 -0700
committercallum <none@none>2011-10-10 17:29:04 -0700
commit213985ca0d045252ad49d9d45f77d0727fa9008f (patch)
treeaf408f93eecc903736ea24812aa327736887594f /indra/newview/llagent.cpp
parentec5ea33c8113a63e956c195ccf051b2a03979be9 (diff)
EXP-1302 PARTIAL Make the Speak button work as a toolbar button
First pass - no Push-To-Talk functionality.
Diffstat (limited to 'indra/newview/llagent.cpp')
-rwxr-xr-xindra/newview/llagent.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index ed29ac7960..8303a5942d 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -174,12 +174,43 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
}
else if (param == "speak")
{
- retval = true;
+ if ( gAgent.isVoiceConnected() )
+ {
+ retval = true;
+ }
+ else
+ {
+ retval = false;
+ }
}
return retval;
}
+// static
+void LLAgent::toggleMicrophone(const LLSD& name)
+{
+ gAgent.mMicrophoneOn = ! gAgent.mMicrophoneOn;
+
+ if ( gAgent.mMicrophoneOn )
+ {
+ LLFirstUse::speak(false);
+
+ LLVoiceClient::getInstance()->inputUserControlState(true);
+ LLVoiceClient::getInstance()->inputUserControlState(false);
+ }
+ else
+ {
+ LLVoiceClient::getInstance()->inputUserControlState(false);
+ LLVoiceClient::getInstance()->inputUserControlState(true);
+ }
+}
+
+// static
+bool LLAgent::isMicrophoneOn(const LLSD& sdname)
+{
+ return gAgent.mMicrophoneOn;
+}
// ************************************************************
// Enabled this definition to compile a 'hacked' viewer that
@@ -261,6 +292,9 @@ LLAgent::LLAgent() :
mCurrentFidget(0),
mFirstLogin(FALSE),
mGenderChosen(FALSE),
+
+ mVoiceConnected(false),
+ mMicrophoneOn(false),
mAppearanceSerialNum(0),
@@ -280,6 +314,8 @@ LLAgent::LLAgent() :
LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2));
+ LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
}
// Requires gSavedSettings to be initialized.