summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llvoiceclient.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index b46c55321c..e24884fe81 100644..100755
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -36,6 +36,7 @@
#include "llsdserialize.h"
#include "llui.h"
#include "llkeyboard.h"
+#include "llagent.h"
const F32 LLVoiceClient::OVERDRIVEN_POWER_LEVEL = 0.7f;
@@ -113,8 +114,8 @@ LLVoiceClient::LLVoiceClient()
:
mVoiceModule(NULL),
m_servicePump(NULL),
- mVoiceEffectEnabled(LLCachedControl<bool>(gSavedSettings, "VoiceMorphingEnabled")),
- mVoiceEffectDefault(LLCachedControl<std::string>(gSavedPerAccountSettings, "VoiceEffectDefault")),
+ mVoiceEffectEnabled(LLCachedControl<bool>(gSavedSettings, "VoiceMorphingEnabled", true)),
+ mVoiceEffectDefault(LLCachedControl<std::string>(gSavedPerAccountSettings, "VoiceEffectDefault", "00000000-0000-0000-0000-000000000000")),
mPTTDirty(true),
mPTT(true),
mUsePTT(true),
@@ -160,6 +161,13 @@ void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &age
mVoiceModule->userAuthorized(user_id, agentID);
}
+void LLVoiceClient::setHidden(bool hidden)
+{
+ if (mVoiceModule)
+ {
+ mVoiceModule->setHidden(hidden);
+ }
+}
void LLVoiceClient::terminate()
{
@@ -635,7 +643,7 @@ void LLVoiceClient::keyDown(KEY key, MASK mask)
return;
}
- if(!mPTTIsMiddleMouse)
+ if(!mPTTIsMiddleMouse && LLAgent::isActionAllowed("speak"))
{
bool down = (mPTTKey != KEY_NONE)
&& gKeyboard->getKeyDown(mPTTKey);
@@ -654,12 +662,9 @@ void LLVoiceClient::keyUp(KEY key, MASK mask)
}
void LLVoiceClient::middleMouseState(bool down)
{
- if(mPTTIsMiddleMouse)
+ if(mPTTIsMiddleMouse && LLAgent::isActionAllowed("speak"))
{
- if(mPTTIsMiddleMouse)
- {
- inputUserControlState(down);
- }
+ inputUserControlState(down);
}
}
@@ -714,14 +719,7 @@ BOOL LLVoiceClient::isParticipantAvatar(const LLUUID& id)
BOOL LLVoiceClient::isOnlineSIP(const LLUUID& id)
{
- if (mVoiceModule)
- {
- return mVoiceModule->isOnlineSIP(id);
- }
- else
- {
return FALSE;
- }
}
BOOL LLVoiceClient::getIsSpeaking(const LLUUID& id)
@@ -1026,10 +1024,15 @@ void LLSpeakerVolumeStorage::load()
LLSD settings_llsd;
llifstream file;
- file.open(filename);
+ file.open(filename.c_str());
if (file.is_open())
{
- LLSDSerialize::fromXML(settings_llsd, file);
+ if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(settings_llsd, file))
+ {
+ LL_WARNS("Voice") << "failed to parse " << filename << LL_ENDL;
+
+ }
+
}
for (LLSD::map_const_iterator iter = settings_llsd.beginMap();
@@ -1064,7 +1067,7 @@ void LLSpeakerVolumeStorage::save()
}
llofstream file;
- file.open(filename);
+ file.open(filename.c_str());
LLSDSerialize::toPrettyXML(settings_llsd, file);
}
}