summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-04-29 02:37:07 +0100
committerAimee Linden <aimee@lindenlab.com>2010-04-29 02:37:07 +0100
commit46897efc3efade25feaaa1dc67bc131c35202d12 (patch)
treea7e1f41f8b2d4ff338107f22d5ad3c2d3068debb /indra/newview/llvoiceclient.cpp
parentad24d0c72a272dd9b30841ecc20e34d334e6f2b6 (diff)
Make a proper XUI commit_callback for the Voice Font combo
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp49
1 files changed, 20 insertions, 29 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index d131285512..657a130c27 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -7256,55 +7256,46 @@ void LLVoiceClient::addVoiceFont(const S32 font_index,
bool LLVoiceClient::setVoiceFont(const LLUUID& id)
{
- if (!mAudioSession || !mAudioSession->mVoiceEnabled || !hasVoiceFonts())
+ return mAudioSession ? setVoiceFont(mAudioSession->mHandle, id) : false;
+}
+
+bool LLVoiceClient::setVoiceFont(const std::string &session_handle, const LLUUID& id)
+{
+ sessionState *session = findSession(session_handle);
+
+ if (!session || !session->mVoiceEnabled || !hasVoiceFonts())
{
LL_DEBUGS("Voice") << "Voice fonts not available." << LL_ENDL;
return false;
}
- if (id.isNull() || (mVoiceFontMap.find(&id) != mVoiceFontMap.end()))
- {
- // *TODO: Check for expired fonts?
- mAudioSession->mVoiceFontID = id;
-
- // *TODO: Separate voice font defaults for spatial chat and IM?
- gSavedSettings.setString("VoiceFontDefault", id.asString());
- }
- else
+ if (!id.isNull() && (mVoiceFontMap.find(&id) == mVoiceFontMap.end()))
{
LL_DEBUGS("Voice") << "Invalid voice font " << id << LL_ENDL;
return false;
}
- sessionSetVoiceFontSendMessage(mAudioSession);
+ // *TODO: Check for expired fonts?
+ mAudioSession->mVoiceFontID = id;
+
+ // *TODO: Separate voice font defaults for spatial chat and IM?
+ gSavedSettings.setString("VoiceFontDefault", id.asString());
+
+ sessionSetVoiceFontSendMessage(session);
notifyVoiceFontObservers();
+
return true;
}
const LLUUID LLVoiceClient::getVoiceFont()
{
- if (mAudioSession)
- {
- return getVoiceFont(mAudioSession->mHandle);
- }
- else
- {
- return LLUUID::null;
- }
+ return mAudioSession ? getVoiceFont(mAudioSession->mHandle) : LLUUID::null;
}
const LLUUID LLVoiceClient::getVoiceFont(const std::string &session_handle)
{
- LLUUID result;
- if (hasVoiceFonts())
- {
- sessionState *session = findSession(session_handle);
- if (session)
- {
- result = mAudioSession->mVoiceFontID;
- }
- }
- return result;
+ sessionState *session = findSession(session_handle);
+ return session ? session->mVoiceFontID : LLUUID::null;
}
S32 LLVoiceClient::getVoiceFontIndex(const LLUUID& id) const