summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-05-19 16:25:52 +0100
committerAimee Linden <aimee@lindenlab.com>2010-05-19 16:25:52 +0100
commitbe0662234565f772fc4c89e47400dc9df8277800 (patch)
tree4b896f7e19f33458d3bab44c6e43f350baec3541 /indra/newview/llvoicevivox.cpp
parent04ef90ceb0829e660d9c89a13ef526b3d30c732c (diff)
EXT-7337 WIP Voice font previewing
Added LLVoiceEffectInterface::getVoiceEffectProperties Added LLVivoxVoiceClient::getVoiceFontTemplateIndex
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index ee67879d3d..2df9152a17 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -6378,6 +6378,36 @@ const LLUUID LLVivoxVoiceClient::getVoiceEffect()
return mAudioSession ? mAudioSession->mVoiceFontID : LLUUID::null;
}
+LLSD LLVivoxVoiceClient::getVoiceEffectProperties(const LLUUID& id)
+{
+ LLSD sd;
+
+ voice_font_map_t::iterator iter = mVoiceFontMap.find(id);
+ if (iter != mVoiceFontMap.end())
+ {
+ sd["template_only"] = false;
+ }
+ else
+ {
+ // Voice effect is not in the voice font map, see if there is a template
+ iter = mVoiceFontTemplateMap.find(id);
+ if (iter == mVoiceFontTemplateMap.end())
+ {
+ LL_WARNS("Voice") << "Voice effect " << id << "not found." << LL_ENDL;
+ return sd;
+ }
+ sd["template_only"] = true;
+ }
+
+ voiceFontEntry *font = iter->second;
+ sd["name"] = font->mName;
+ sd["expired"] = font->mHasExpired;
+ sd["expiry_date"] = font->mExpirationDate;
+ sd["is_new"] = font->mIsNew;
+
+ return sd;
+}
+
LLVivoxVoiceClient::voiceFontEntry::voiceFontEntry(LLUUID& id) :
mID(id),
mFontIndex(0),
@@ -6536,6 +6566,24 @@ S32 LLVivoxVoiceClient::getVoiceFontIndex(const LLUUID& id) const
return result;
}
+S32 LLVivoxVoiceClient::getVoiceFontTemplateIndex(const LLUUID& id) const
+{
+ S32 result = 0;
+ if (!id.isNull())
+ {
+ voice_font_map_t::const_iterator it = mVoiceFontTemplateMap.find(id);
+ if (it != mVoiceFontTemplateMap.end())
+ {
+ result = it->second->mFontIndex;
+ }
+ else
+ {
+ LL_DEBUGS("Voice") << "Selected voice font template " << id << " is not available." << LL_ENDL;
+ }
+ }
+ return result;
+}
+
void LLVivoxVoiceClient::accountGetSessionFontsSendMessage()
{
if(!mAccountHandle.empty())
@@ -6753,7 +6801,7 @@ void LLVivoxVoiceClient::captureBufferPlayStartSendMessage(const LLUUID& voice_f
LL_DEBUGS("Voice") << "Starting audio buffer playback." << LL_ENDL;
- S32 font_index = getVoiceFontIndex(voice_font_id);
+ S32 font_index = getVoiceFontTemplateIndex(voice_font_id);
LL_DEBUGS("Voice") << "With voice font: " << voice_font_id << " (" << font_index << ")" << LL_ENDL;
stream