Added the ability to have the voice enabled in multiple viewer instances
This commit is contained in:
@@ -15403,6 +15403,17 @@ This should be as low as possible, but too low may break functionality</string>
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<integer>44125</integer>
|
<integer>44125</integer>
|
||||||
</map>
|
</map>
|
||||||
|
<key>VoiceMultiInstance</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Allow multiple viewers to have the voice enabled at the same time</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>Boolean</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</map>
|
||||||
<key>WLSkyDetail</key>
|
<key>WLSkyDetail</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -2503,7 +2503,7 @@ bool LLAppViewer::initConfiguration()
|
|||||||
// This is the second instance of SL. Turn off voice support,
|
// This is the second instance of SL. Turn off voice support,
|
||||||
// but make sure the setting is *not* persisted.
|
// but make sure the setting is *not* persisted.
|
||||||
LLControlVariable* disable_voice = gSavedSettings.getControl("CmdLineDisableVoice");
|
LLControlVariable* disable_voice = gSavedSettings.getControl("CmdLineDisableVoice");
|
||||||
if(disable_voice)
|
if(disable_voice && !gSavedSettings.getBOOL("VoiceMultiInstance"))
|
||||||
{
|
{
|
||||||
const BOOL DO_NOT_PERSIST = FALSE;
|
const BOOL DO_NOT_PERSIST = FALSE;
|
||||||
disable_voice->setValue(LLSD(TRUE), DO_NOT_PERSIST);
|
disable_voice->setValue(LLSD(TRUE), DO_NOT_PERSIST);
|
||||||
|
|||||||
@@ -1313,7 +1313,16 @@ void LLVoiceClient::connectorCreate()
|
|||||||
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Connector.Create.1\">"
|
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Connector.Create.1\">"
|
||||||
<< "<ClientName>V2 SDK</ClientName>"
|
<< "<ClientName>V2 SDK</ClientName>"
|
||||||
<< "<AccountManagementServer>" << mVoiceAccountServerURI << "</AccountManagementServer>"
|
<< "<AccountManagementServer>" << mVoiceAccountServerURI << "</AccountManagementServer>"
|
||||||
<< "<Mode>Normal</Mode>"
|
<< "<Mode>Normal</Mode>";
|
||||||
|
|
||||||
|
if (gSavedSettings.getBOOL("VoiceMultiInstance"))
|
||||||
|
{
|
||||||
|
stream
|
||||||
|
<< "<MinimumPort>30000</MinimumPort>"
|
||||||
|
<< "<MaximumPort>50000</MaximumPort>";
|
||||||
|
}
|
||||||
|
|
||||||
|
stream
|
||||||
<< "<Logging>"
|
<< "<Logging>"
|
||||||
<< "<Folder>" << logpath << "</Folder>"
|
<< "<Folder>" << logpath << "</Folder>"
|
||||||
<< "<FileNamePrefix>Connector</FileNamePrefix>"
|
<< "<FileNamePrefix>Connector</FileNamePrefix>"
|
||||||
@@ -1686,6 +1695,19 @@ void LLVoiceClient::stateMachine()
|
|||||||
std::string args;
|
std::string args;
|
||||||
std::string cmd;
|
std::string cmd;
|
||||||
std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
|
std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
|
||||||
|
|
||||||
|
// If we allow multiple instances of the viewer to start the voice
|
||||||
|
// daemon, set TEMPORARY random voice port
|
||||||
|
if (gSavedSettings.getBOOL("VoiceMultiInstance"))
|
||||||
|
{
|
||||||
|
LLControlVariable* voice_port = gSavedSettings.getControl("VoicePort");
|
||||||
|
if (voice_port)
|
||||||
|
{
|
||||||
|
const BOOL DO_NOT_PERSIST = FALSE;
|
||||||
|
S32 port_nr = 30000 + ll_rand(20000);
|
||||||
|
voice_port->setValue(LLSD(port_nr), DO_NOT_PERSIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(loglevel.empty())
|
if(loglevel.empty())
|
||||||
{
|
{
|
||||||
@@ -1694,6 +1716,12 @@ void LLVoiceClient::stateMachine()
|
|||||||
|
|
||||||
args += " -ll ";
|
args += " -ll ";
|
||||||
args += loglevel;
|
args += loglevel;
|
||||||
|
|
||||||
|
// Tell voice gateway to listen to a specific port
|
||||||
|
if (gSavedSettings.getBOOL("VoiceMultiInstance"))
|
||||||
|
{
|
||||||
|
args += llformat(" -i 127.0.0.1:%u", gSavedSettings.getU32("VoicePort"));
|
||||||
|
}
|
||||||
|
|
||||||
LL_DEBUGS("Voice") << "Args for SLVoice: " << args << LL_ENDL;
|
LL_DEBUGS("Voice") << "Args for SLVoice: " << args << LL_ENDL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user