summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-11-02 15:51:55 +0000
committerLynx Linden <lynx@lindenlab.com>2009-11-02 15:51:55 +0000
commit3ec9f79f0782539659963f159f6b94c86d1ebd7b (patch)
tree136565424c0e20aafea98798614a08cc81cfe317 /indra/newview/llvoiceclient.cpp
parentd8b3e7a021b97bf3cb4494c4d9228ed0a3c16738 (diff)
DEV-40702: fixed the audio device enumeration code so that it works
with Vivox V2 and V3 SDKs. We were assuming that the <CaptureDevice> tag contains only a single tag (<Device>), but the V3 SDK returns other tags such as <DisplayName> and <Type>. I also added the current Vivox SDK version to the About window so that it is easier to tell which version your client is actually using.
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 2834284a9b..df5481c874 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -254,6 +254,7 @@ protected:
std::string nameString;
std::string audioMediaString;
std::string displayNameString;
+ std::string deviceString;
int participantType;
bool isLocallyMuted;
bool isModeratorMuted;
@@ -485,6 +486,14 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
{
gVoiceClient->clearRenderDevices();
}
+ else if (!stricmp("CaptureDevice", tag))
+ {
+ deviceString.clear();
+ }
+ else if (!stricmp("RenderDevice", tag))
+ {
+ deviceString.clear();
+ }
else if (!stricmp("Buddies", tag))
{
gVoiceClient->deleteAllBuddies();
@@ -508,7 +517,6 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
void LLVivoxProtocolParser::EndTag(const char *tag)
{
const std::string& string = textBuffer;
- bool clearbuffer = true;
responseDepth--;
@@ -580,6 +588,8 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
nameString = string;
else if (!stricmp("DisplayName", tag))
displayNameString = string;
+ else if (!stricmp("Device", tag))
+ deviceString = string;
else if (!stricmp("AccountName", tag))
nameString = string;
else if (!stricmp("ParticipantType", tag))
@@ -596,18 +606,13 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
uriString = string;
else if (!stricmp("Presence", tag))
statusString = string;
- else if (!stricmp("Device", tag))
- {
- // This closing tag shouldn't clear the accumulated text.
- clearbuffer = false;
- }
else if (!stricmp("CaptureDevice", tag))
{
- gVoiceClient->addCaptureDevice(textBuffer);
+ gVoiceClient->addCaptureDevice(deviceString);
}
else if (!stricmp("RenderDevice", tag))
{
- gVoiceClient->addRenderDevice(textBuffer);
+ gVoiceClient->addRenderDevice(deviceString);
}
else if (!stricmp("Buddy", tag))
{
@@ -648,12 +653,8 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
else if (!stricmp("SubscriptionType", tag))
subscriptionType = string;
-
- if(clearbuffer)
- {
- textBuffer.clear();
- accumulateText= false;
- }
+ textBuffer.clear();
+ accumulateText= false;
if (responseDepth == 0)
{
@@ -1160,7 +1161,8 @@ LLVoiceClient::LLVoiceClient() :
mVoiceEnabled(false),
mWriteInProgress(false),
- mLipSyncEnabled(false)
+ mLipSyncEnabled(false),
+ mAPIVersion("Unknown")
{
gVoiceClient = this;
@@ -3749,6 +3751,7 @@ void LLVoiceClient::connectorCreateResponse(int statusCode, std::string &statusS
{
// Connector created, move forward.
LL_INFOS("Voice") << "Connector.Create succeeded, Vivox SDK version is " << versionID << LL_ENDL;
+ mAPIVersion = versionID;
mConnectorHandle = connectorHandle;
if(getState() == stateConnectorStarting)
{