summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2016-04-26 16:20:01 -0700
committerRider Linden <rider@lindenlab.com>2016-04-26 16:20:01 -0700
commit3771778ac3063860319b4eabb55c289ff00fc952 (patch)
tree4e8b05cf82e52d547fe808eac29f8236803bffc4 /indra/newview/llvoicevivox.cpp
parent1eaed3d37f49e1a9e4d1c6c432de7801797a5d49 (diff)
parent66dd72459ae5ad17bfab622c71b2122233707dd4 (diff)
Merge
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rwxr-xr-xindra/newview/llvoicevivox.cpp77
1 files changed, 25 insertions, 52 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 4316db115e..07427e0377 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -900,8 +900,7 @@ bool LLVivoxVoiceClient::loginToVivox()
{
LLEventPump &voicePump = LLEventPumps::instance().obtain("vivoxClientPump");
- LLSD timeoutResult;
- timeoutResult["login"] = LLSD::String("timeout");
+ LLSD timeoutResult(LLSDMap("login", "timeout"));
int loginRetryCount(0);
@@ -1012,8 +1011,7 @@ void LLVivoxVoiceClient::logoutOfVivox(bool wait)
if (wait)
{
LLEventPump &voicePump = LLEventPumps::instance().obtain("vivoxClientPump");
- LLSD timeoutResult;
- timeoutResult["logout"] = LLSD::String("timeout");
+ LLSD timeoutResult(LLSDMap("lougout", "timeout"));
LLSD result = llcoro::suspendUntilEventOnWithTimeout(voicePump, LOGIN_ATTEMPT_TIMEOUT, timeoutResult);
@@ -1216,8 +1214,7 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
bool added(true);
bool joined(false);
- LLSD timeoutResult;
- timeoutResult["session"] = LLSD::String("timeout");
+ LLSD timeoutResult(LLSDMap("session", "timeout"));
// It appears that I need to wait for BOTH the SessionGroup.AddSession response and the SessionStateChangeEvent with state 4
// before continuing from this state. They can happen in either order, and if I don't wait for both, things can get stuck.
@@ -1498,8 +1495,7 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
notifyParticipantObservers();
notifyVoiceFontObservers();
- LLSD timeoutEvent = LLSD::emptyMap();
- timeoutEvent["timeout"] = LLSD::Boolean(true);
+ LLSD timeoutEvent(LLSDMap("timeout", LLSD::Boolean(true)));
LLEventPump &voicePump = LLEventPumps::instance().obtain("vivoxClientPump");
mIsInChannel = true;
@@ -1651,8 +1647,7 @@ void LLVivoxVoiceClient::recordingAndPlaybackMode()
int LLVivoxVoiceClient::voiceRecordBuffer()
{
- LLSD timeoutResult;
- timeoutResult["recplay"] = LLSD::String("stop");
+ LLSD timeoutResult(LLSDMap("recplay", "stop"));
LL_INFOS("Voice") << "Recording voice buffer" << LL_ENDL;
@@ -1682,8 +1677,7 @@ int LLVivoxVoiceClient::voiceRecordBuffer()
int LLVivoxVoiceClient::voicePlaybackBuffer()
{
- LLSD timeoutResult;
- timeoutResult["recplay"] = LLSD::String("stop");
+ LLSD timeoutResult(LLSDMap("recplay", "stop"));
LL_INFOS("Voice") << "Playing voice buffer" << LL_ENDL;
@@ -2922,11 +2916,9 @@ void LLVivoxVoiceClient::sessionCreateResponse(std::string &requestId, int statu
session->mErrorStatusString = statusString;
if(session == mAudioSession)
{
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["handle"] = LLSD::String(sessionHandle);
- vivoxevent["session"] = LLSD::String("failed");
- vivoxevent["reason"] = LLSD::Integer(statusCode);
+ LLSD vivoxevent(LLSDMap("handle", LLSD::String(sessionHandle))
+ ("session", "failed")
+ ("reason", LLSD::Integer(statusCode)));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
}
@@ -2943,10 +2935,8 @@ void LLVivoxVoiceClient::sessionCreateResponse(std::string &requestId, int statu
{
setSessionHandle(session, sessionHandle);
}
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["handle"] = LLSD::String(sessionHandle);
- vivoxevent["session"] = LLSD::String("created");
+ LLSD vivoxevent(LLSDMap("handle", LLSD::String(sessionHandle))
+ ("session", "created"));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
}
@@ -2970,10 +2960,8 @@ void LLVivoxVoiceClient::sessionGroupAddSessionResponse(std::string &requestId,
session->mErrorStatusString = statusString;
if(session == mAudioSession)
{
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["handle"] = LLSD::String(sessionHandle);
- vivoxevent["session"] = LLSD::String("failed");
+ LLSD vivoxevent(LLSDMap("handle", LLSD::String(sessionHandle))
+ ("session", "failed"));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
}
@@ -2991,10 +2979,8 @@ void LLVivoxVoiceClient::sessionGroupAddSessionResponse(std::string &requestId,
setSessionHandle(session, sessionHandle);
}
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["handle"] = LLSD::String(sessionHandle);
- vivoxevent["session"] = LLSD::String("added");
+ LLSD vivoxevent(LLSDMap("handle", LLSD::String(sessionHandle))
+ ("session", "added"));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
@@ -3039,9 +3025,7 @@ void LLVivoxVoiceClient::logoutResponse(int statusCode, std::string &statusStrin
LL_WARNS("Voice") << "Account.Logout response failure: " << statusString << LL_ENDL;
// Should this ever fail? do we care if it does?
}
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["logout"] = LLSD::Boolean(true);
+ LLSD vivoxevent(LLSDMap("logout", LLSD::Boolean(true)));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
}
@@ -3056,9 +3040,7 @@ void LLVivoxVoiceClient::connectorShutdownResponse(int statusCode, std::string &
mConnected = false;
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["connector"] = LLSD::Boolean(false);
+ LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false)));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
}
@@ -3166,10 +3148,8 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
// This is the session we're joining.
if(mIsJoiningSession)
{
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["handle"] = LLSD::String(session->mHandle);
- vivoxevent["session"] = LLSD::String("joined");
+ LLSD vivoxevent(LLSDMap("handle", LLSD::String(session->mHandle))
+ ("session", "joined"));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
@@ -3312,10 +3292,8 @@ void LLVivoxVoiceClient::leftAudioSession(const sessionStatePtr_t &session)
{
if (mAudioSession == session)
{
- LLSD vivoxevent = LLSD::emptyMap();
-
- vivoxevent["handle"] = LLSD::String(session->mHandle);
- vivoxevent["session"] = LLSD::String("removed");
+ LLSD vivoxevent(LLSDMap("handle", LLSD::String(session->mHandle))
+ ("session", "removed"));
LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
}
@@ -6170,9 +6148,7 @@ void LLVivoxVoiceClient::accountGetSessionFontsResponse(int statusCode, const st
{
// *TODO: We seem to get multiple events of this type. Should figure a way to advance only after
// receiving the last one.
- LLSD result = LLSD::emptyMap();
-
- result["voice_fonts"] = LLSD::Boolean(true);
+ LLSD result(LLSDMap("voice_fonts", LLSD::Boolean(true)));
LLEventPumps::instance().post("vivoxClientPump", result);
}
@@ -6345,8 +6321,7 @@ void LLVivoxVoiceClient::recordPreviewBuffer()
mCaptureBufferRecording = true;
- LLSD result;
- result["recplay"] = "record";
+ LLSD result(LLSDMap("recplay", "record"));
LLEventPumps::instance().post("vivoxClientPump", result);
}
@@ -6369,8 +6344,7 @@ void LLVivoxVoiceClient::playPreviewBuffer(const LLUUID& effect_id)
mPreviewVoiceFont = effect_id;
mCaptureBufferPlaying = true;
- LLSD result;
- result["recplay"] = "playback";
+ LLSD result(LLSDMap("recplay", "playback"));
LLEventPumps::instance().post("vivoxClientPump", result);
}
@@ -6379,8 +6353,7 @@ void LLVivoxVoiceClient::stopPreviewBuffer()
mCaptureBufferRecording = false;
mCaptureBufferPlaying = false;
- LLSD result;
- result["recplay"] = "quit";
+ LLSD result(LLSDMap("recplay", "quit"));
LLEventPumps::instance().post("vivoxClientPump", result);
}