DEV-34822 viewer 1.23 merge

DEV-32649 Merge the diamondware/vivox voice code
-r124876
-r125220
master
Roxanne Skelly 2009-07-15 21:50:42 +00:00
parent ff51d31af3
commit ff52ac089f
38 changed files with 8861 additions and 7598 deletions

View File

@ -515,8 +515,10 @@ set(viewer_SOURCE_FILES
llvoground.cpp
llvoicechannel.cpp
llvoiceclient.cpp
llvoicedw.cpp
llvoiceremotectrl.cpp
llvoicevisualizer.cpp
llvoicevivox.cpp
llvoinventorylistener.cpp
llvopartgroup.cpp
llvosky.cpp
@ -1018,8 +1020,10 @@ set(viewer_HEADER_FILES
llvoground.h
llvoicechannel.h
llvoiceclient.h
llvoicedw.h
llvoiceremotectrl.h
llvoicevisualizer.h
llvoicevivox.h
llvoinventorylistener.h
llvopartgroup.h
llvosky.h

View File

@ -19,8 +19,7 @@
</array>
<key>tags</key>
<array>
<string>AppInit</string>
<string>LLLogin</string>
<string>Voice</string>
</array>
</map>
<map>
@ -36,8 +35,7 @@
</array>
<key>tags</key>
<array>
<string>AppInit</string>
<string>LLLogin</string>
<string>Voice</string>
</array>
</map>
</array>

View File

@ -10312,6 +10312,17 @@
<key>Value</key>
<string></string>
</map>
<key>VivoxDebugSIPURIHostName</key>
<map>
<key>Comment</key>
<string>Hostname portion of vivox SIP URIs (empty string for the default).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string></string>
</map>
<key>VivoxDebugVoiceAccountServerURI</key>
<map>
<key>Comment</key>
@ -10323,6 +10334,28 @@
<key>Value</key>
<string></string>
</map>
<key>VivoxVoiceHost</key>
<map>
<key>Comment</key>
<string>Client SLVoice host to connect to</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>127.0.0.1</string>
</map>
<key>VivoxVoicePort</key>
<map>
<key>Comment</key>
<string>Client SLVoice port to connect to</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>44125</integer>
</map>
<key>VoiceCallsFriendsOnly</key>
<map>
<key>Comment</key>
@ -10455,6 +10488,17 @@
<key>Value</key>
<string>Default</string>
</map>
<key>VoiceLogFile</key>
<map>
<key>Comment</key>
<string>Log file to use when launching the voice daemon</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string></string>
</map>
<key>VoiceOutputAudioDevice</key>
<map>
<key>Comment</key>
@ -10499,6 +10543,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>VoiceServerType</key>
<map>
<key>Comment</key>
<string>The type of voice server to connect to.</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>vivox</string>
</map>
<key>WLSkyDetail</key>
<map>
<key>Comment</key>

View File

@ -5972,7 +5972,7 @@ bool LLAgent::teleportCore(bool is_local)
// MBW -- Let the voice client know a teleport has begun so it can leave the existing channel.
// This was breaking the case of teleporting within a single sim. Backing it out for now.
// gVoiceClient->leaveChannel();
// LLVoiceClient::getInstance()->leaveChannel();
return true;
}

View File

@ -920,8 +920,7 @@ bool LLAppViewer::mainLoop()
// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated.
LLVoiceChannel::initClass();
LLVoiceClient::init(gServicePump);
LLVoiceClient::getInstance()->init(gServicePump);
LLTimer frameTimer,idleTimer;
LLTimer debugTime;
@ -1241,7 +1240,7 @@ bool LLAppViewer::cleanup()
// to ensure shutdown order
LLMortician::setZealous(TRUE);
LLVoiceClient::terminate();
LLVoiceClient::getInstance()->terminate();
disconnectViewer();
@ -3807,7 +3806,7 @@ void LLAppViewer::sendLogoutRequest()
gLogoutMaxTime = LOGOUT_REQUEST_TIME;
mLogoutRequestSent = TRUE;
gVoiceClient->leaveChannel();
LLVoiceClient::getInstance()->leaveChannel();
//Set internal status variables and marker files
gLogoutInProgress = TRUE;

View File

@ -290,7 +290,7 @@ bool LLAvatarActions::canCall(const LLUUID &id)
// can be only ONLINE. There is no way to see "usual resident" in OFFLINE status. If we see "usual
// resident" it automatically means that the resident is ONLINE. So to make a call to the "usual resident"
// we need to check only that "our" voice is enabled.
return LLVoiceClient::voiceEnabled();
return LLVoiceClient::getInstance()->voiceEnabled();
}
}

View File

@ -365,7 +365,7 @@ BOOL LLBottomTray::postBuild()
mSpeakBtn->setShowToolTip( getString("VoiceControlBtnToolTip") );
// Registering Chat Bar to receive Voice client status change notifications.
gVoiceClient->addObserver(this);
LLVoiceClient::getInstance()->addObserver(this);
mObjectDefaultWidthMap[RS_BUTTON_GESTURES] = mGesturePanel->getRect().getWidth();
mObjectDefaultWidthMap[RS_BUTTON_MOVEMENT] = mMovementPanel->getRect().getWidth();

View File

@ -143,9 +143,9 @@ LLCallFloater::~LLCallFloater()
// Don't use LLVoiceClient::getInstance() here
// singleton MAY have already been destroyed.
if(gVoiceClient)
if(LLVoiceClient::getInstance())
{
gVoiceClient->removeObserver(this);
LLVoiceClient::getInstance()->removeObserver(this);
}
LLTransientFloaterMgr::getInstance()->removeControlView(this);
}
@ -194,7 +194,7 @@ void LLCallFloater::draw()
// Seems this is a problem somewhere in Voice Client (LLVoiceClient::participantAddedEvent)
// onChange();
bool is_moderator_muted = gVoiceClient->getIsModeratorMuted(gAgentID);
bool is_moderator_muted = LLVoiceClient::getInstance()->getIsModeratorMuted(gAgentID);
if (mIsModeratorMutedVoice != is_moderator_muted)
{
@ -212,7 +212,6 @@ void LLCallFloater::draw()
void LLCallFloater::onChange()
{
if (NULL == mParticipants) return;
updateParticipantsVoiceState();
// Add newly joined participants.
@ -252,11 +251,11 @@ void LLCallFloater::updateSession()
LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
if (voice_channel)
{
lldebugs << "Current voice channel: " << voice_channel->getSessionID() << llendl;
LL_DEBUGS("Voice") << "Current voice channel: " << voice_channel->getSessionID() << LL_ENDL;
if (mSpeakerManager && voice_channel->getSessionID() == mSpeakerManager->getSessionID())
{
lldebugs << "Speaker manager is already set for session: " << voice_channel->getSessionID() << llendl;
LL_DEBUGS("Voice") << "Speaker manager is already set for session: " << voice_channel->getSessionID() << LL_ENDL;
return;
}
else
@ -266,7 +265,7 @@ void LLCallFloater::updateSession()
}
const LLUUID& session_id = voice_channel->getSessionID();
lldebugs << "Set speaker manager for session: " << session_id << llendl;
LL_DEBUGS("Voice") << "Set speaker manager for session: " << session_id << LL_ENDL;
LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id);
if (im_session)
@ -306,7 +305,7 @@ void LLCallFloater::updateSession()
{
// by default let show nearby chat participants
mSpeakerManager = LLLocalSpeakerMgr::getInstance();
lldebugs << "Set DEFAULT speaker manager" << llendl;
LL_DEBUGS("Voice") << "Set DEFAULT speaker manager" << LL_ENDL;
mVoiceType = VC_LOCAL_CHAT;
}
@ -482,16 +481,14 @@ void LLCallFloater::updateAgentModeratorState()
static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids)
{
// Get a list of participants from VoiceClient
LLVoiceClient::participantMap *voice_map = gVoiceClient->getParticipantList();
if (voice_map)
std::vector<LLUUID> participants = LLVoiceClient::getInstance()->getParticipantList();
for (std::vector<LLUUID>::const_iterator iter = participants.begin();
iter != participants.end(); ++iter)
{
for (LLVoiceClient::participantMap::const_iterator iter = voice_map->begin();
iter != voice_map->end(); ++iter)
{
LLUUID id = (*iter).second->mAvatarID;
speakers_uuids.push_back(id);
}
speakers_uuids.push_back(*iter);
}
}
void LLCallFloater::initParticipantsVoiceState()
@ -567,7 +564,7 @@ void LLCallFloater::updateParticipantsVoiceState()
std::vector<LLUUID>::iterator speakers_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), participant_id);
lldebugs << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << llendl;
LL_DEBUGS("Voice") << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << LL_ENDL;
// If an avatarID assigned to a panel is found in a speakers list
// obtained from VoiceClient we assign the JOINED status to the owner
@ -611,7 +608,7 @@ void LLCallFloater::updateParticipantsVoiceState()
}
else
{
llwarns << "Unsupported (" << getState(participant_id) << ") state: " << item->getAvatarName() << llendl;
llwarns << "Unsupported (" << getState(participant_id) << ") state: " << item->getAvatarName() << LL_ENDL;
}
}
}

View File

@ -266,8 +266,18 @@ LLSD LLFloaterAbout::getInfo()
info["J2C_VERSION"] = LLImageJ2C::getEngineInfo();
bool want_fullname = true;
info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD();
info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : LLTrans::getString("NotConnected");
if(LLVoiceClient::getInstance()->voiceEnabled())
{
LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion();
std::ostringstream version_string;
version_string << version.serverType << " " << version.serverVersion << std::endl;
info["VOICE_VERSION"] = version_string.str();
}
else
{
info["VOICE_VERSION"] = LLTrans::getString("NotConnected");
}
// TODO: Implement media plugin version query
info["QT_WEBKIT_VERSION"] = "4.5.2 (version number hard-coded)";

View File

@ -343,7 +343,7 @@ LLFloaterChatterBox* LLFloaterChatterBox::getInstance()
//static
LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater()
{
if (!LLVoiceClient::voiceEnabled())
if (!LLVoiceClient::getInstance()->voiceEnabled())
{
return NULL;
}

View File

@ -64,9 +64,6 @@ LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings()
// grab "live" mic volume level
mMicVolume = gSavedSettings.getF32("AudioLevelMic");
// ask for new device enumeration
// now do this in onOpen() instead...
//gVoiceClient->refreshDeviceLists();
}
LLPanelVoiceDeviceSettings::~LLPanelVoiceDeviceSettings()
@ -105,12 +102,12 @@ void LLPanelVoiceDeviceSettings::draw()
refresh();
// let user know that volume indicator is not yet available
bool is_in_tuning_mode = gVoiceClient->inTuningMode();
bool is_in_tuning_mode = LLVoiceClient::getInstance()->inTuningMode();
childSetVisible("wait_text", !is_in_tuning_mode);
LLPanel::draw();
F32 voice_power = gVoiceClient->tuningGetEnergy();
F32 voice_power = LLVoiceClient::getInstance()->tuningGetEnergy();
S32 discrete_power = 0;
if (!is_in_tuning_mode)
@ -193,13 +190,13 @@ void LLPanelVoiceDeviceSettings::refresh()
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
// set mic volume tuning slider based on last mic volume setting
F32 current_volume = (F32)volume_slider->getValue().asReal();
gVoiceClient->tuningSetMicVolume(current_volume);
LLVoiceClient::getInstance()->tuningSetMicVolume(current_volume);
// Fill in popup menus
mCtrlInputDevices = getChild<LLComboBox>("voice_input_device");
mCtrlOutputDevices = getChild<LLComboBox>("voice_output_device");
if(!gVoiceClient->deviceSettingsAvailable())
if(!LLVoiceClient::getInstance()->deviceSettingsAvailable())
{
// The combo boxes are disabled, since we can't get the device settings from the daemon just now.
// Put the currently set default (ONLY) in the box, and select it.
@ -218,17 +215,16 @@ void LLPanelVoiceDeviceSettings::refresh()
}
else if (!mDevicesUpdated)
{
LLVoiceClient::deviceList *devices;
LLVoiceClient::deviceList::iterator iter;
LLVoiceDeviceList::const_iterator iter;
if(mCtrlInputDevices)
{
mCtrlInputDevices->removeall();
mCtrlInputDevices->add( getString("default_text"), ADD_BOTTOM );
devices = gVoiceClient->getCaptureDevices();
for(iter=devices->begin(); iter != devices->end(); iter++)
for(iter=LLVoiceClient::getInstance()->getCaptureDevices().begin();
iter != LLVoiceClient::getInstance()->getCaptureDevices().end();
iter++)
{
mCtrlInputDevices->add( *iter, ADD_BOTTOM );
}
@ -244,8 +240,8 @@ void LLPanelVoiceDeviceSettings::refresh()
mCtrlOutputDevices->removeall();
mCtrlOutputDevices->add( getString("default_text"), ADD_BOTTOM );
devices = gVoiceClient->getRenderDevices();
for(iter=devices->begin(); iter != devices->end(); iter++)
for(iter= LLVoiceClient::getInstance()->getRenderDevices().begin();
iter != LLVoiceClient::getInstance()->getRenderDevices().end(); iter++)
{
mCtrlOutputDevices->add( *iter, ADD_BOTTOM );
}
@ -267,34 +263,34 @@ void LLPanelVoiceDeviceSettings::initialize()
mDevicesUpdated = FALSE;
// ask for new device enumeration
gVoiceClient->refreshDeviceLists();
LLVoiceClient::getInstance()->refreshDeviceLists();
// put voice client in "tuning" mode
gVoiceClient->tuningStart();
LLVoiceClient::getInstance()->tuningStart();
LLVoiceChannel::suspend();
}
void LLPanelVoiceDeviceSettings::cleanup()
{
gVoiceClient->tuningStop();
LLVoiceClient::getInstance()->tuningStop();
LLVoiceChannel::resume();
}
// static
void LLPanelVoiceDeviceSettings::onCommitInputDevice(LLUICtrl* ctrl, void* user_data)
{
if(gVoiceClient)
if(LLVoiceClient::getInstance())
{
gVoiceClient->setCaptureDevice(ctrl->getValue().asString());
LLVoiceClient::getInstance()->setCaptureDevice(ctrl->getValue().asString());
}
}
// static
void LLPanelVoiceDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user_data)
{
if(gVoiceClient)
if(LLVoiceClient::getInstance())
{
gVoiceClient->setRenderDevice(ctrl->getValue().asString());
LLVoiceClient::getInstance()->setRenderDevice(ctrl->getValue().asString());
}
}

View File

@ -300,7 +300,7 @@ void LLFloaterIMPanel::onVolumeChange(LLUICtrl* source, void* user_data)
LLFloaterIMPanel* floaterp = (LLFloaterIMPanel*)user_data;
if (floaterp)
{
gVoiceClient->setUserVolume(floaterp->mOtherParticipantUUID, (F32)source->getValue().asReal());
LLVoiceClient::getInstance()->setUserVolume(floaterp->mOtherParticipantUUID, (F32)source->getValue().asReal());
}
}
@ -312,7 +312,7 @@ void LLFloaterIMPanel::draw()
BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "")
&& mSessionInitialized
&& LLVoiceClient::voiceEnabled()
&& LLVoiceClient::getInstance()->voiceEnabled()
&& mCallBackEnabled;
// hide/show start call and end call buttons
@ -320,8 +320,8 @@ void LLFloaterIMPanel::draw()
if (!voice_channel)
return;
childSetVisible("end_call_btn", LLVoiceClient::voiceEnabled() && voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
childSetVisible("start_call_btn", LLVoiceClient::voiceEnabled() && voice_channel->getState() < LLVoiceChannel::STATE_CALL_STARTED);
childSetVisible("end_call_btn", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
childSetVisible("start_call_btn", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->getState() < LLVoiceChannel::STATE_CALL_STARTED);
childSetEnabled("start_call_btn", enable_connect);
childSetEnabled("send_btn", !childGetValue("chat_editor").asString().empty());
@ -384,11 +384,11 @@ void LLFloaterIMPanel::draw()
else
{
// refresh volume and mute checkbox
childSetVisible("speaker_volume", LLVoiceClient::voiceEnabled() && voice_channel->isActive());
childSetValue("speaker_volume", gVoiceClient->getUserVolume(mOtherParticipantUUID));
childSetVisible("speaker_volume", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->isActive());
childSetValue("speaker_volume", LLVoiceClient::getInstance()->getUserVolume(mOtherParticipantUUID));
childSetValue("mute_btn", LLMuteList::getInstance()->isMuted(mOtherParticipantUUID, LLMute::flagVoiceChat));
childSetVisible("mute_btn", LLVoiceClient::voiceEnabled() && voice_channel->isActive());
childSetVisible("mute_btn", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->isActive());
}
LLFloater::draw();
}

View File

@ -331,13 +331,13 @@ LLIMModel::LLIMSession::~LLIMSession()
mSpeakers = NULL;
// End the text IM session if necessary
if(gVoiceClient && mOtherParticipantID.notNull())
if(LLVoiceClient::getInstance() && mOtherParticipantID.notNull())
{
switch(mType)
{
case IM_NOTHING_SPECIAL:
case IM_SESSION_P2P_INVITE:
gVoiceClient->endUserIMSession(mOtherParticipantID);
LLVoiceClient::getInstance()->endUserIMSession(mOtherParticipantID);
break;
default:
@ -857,7 +857,7 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id)))
{
// User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice.
sent = gVoiceClient->sendTextMessage(other_participant_id, utf8_text);
sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text);
}
if(!sent)
@ -1723,7 +1723,11 @@ bool LLIncomingCallDialog::lifetimeHasExpired()
void LLIncomingCallDialog::onLifetimeExpired()
{
// check whether a call is valid or not
if (LLVoiceClient::getInstance()->findSession(mPayload["caller_id"].asUUID()))
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mPayload["session_id"].asUUID());
if(channelp &&
(channelp->getState() != LLVoiceChannel::STATE_NO_CHANNEL_INFO) &&
(channelp->getState() != LLVoiceChannel::STATE_ERROR) &&
(channelp->getState() != LLVoiceChannel::STATE_HUNG_UP))
{
// restart notification's timer if call is still valid
mLifetimeTimer.start();
@ -1952,10 +1956,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response)
{
if (type == IM_SESSION_P2P_INVITE)
{
if(gVoiceClient)
if(LLVoiceClient::getInstance())
{
std::string s = mPayload["session_handle"].asString();
gVoiceClient->declineInvite(s);
LLVoiceClient::getInstance()->declineInvite(s);
}
}
else
@ -2043,11 +2047,8 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response)
{
if (type == IM_SESSION_P2P_INVITE)
{
if(gVoiceClient)
{
std::string s = payload["session_handle"].asString();
gVoiceClient->declineInvite(s);
}
std::string s = payload["session_handle"].asString();
LLVoiceClient::getInstance()->declineInvite(s);
}
else
{
@ -3156,7 +3157,7 @@ public:
return;
}
if(!LLVoiceClient::voiceEnabled())
if(!LLVoiceClient::getInstance()->voiceEnabled())
{
// Don't display voice invites unless the user has voice enabled.
return;

View File

@ -517,7 +517,7 @@ void LLInspectAvatar::updateVolumeSlider()
// By convention, we only display and toggle voice mutes, not all mutes
bool is_muted = LLMuteList::getInstance()->
isMuted(mAvatarID, LLMute::flagVoiceChat);
bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID);
bool voice_enabled = LLVoiceClient::getInstance()->getVoiceEnabled(mAvatarID);
bool is_self = (mAvatarID == gAgent.getID());
LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn");
@ -544,7 +544,7 @@ void LLInspectAvatar::updateVolumeSlider()
else
{
// actual volume
volume = gVoiceClient->getUserVolume(mAvatarID);
volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID);
// *HACK: Voice client doesn't have any data until user actually
// says something.
@ -578,7 +578,7 @@ void LLInspectAvatar::onClickMuteVolume()
void LLInspectAvatar::onVolumeChange(const LLSD& data)
{
F32 volume = (F32)data.asReal();
gVoiceClient->setUserVolume(mAvatarID, volume);
LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume);
}
void LLInspectAvatar::nameUpdatedCallback(

View File

@ -150,6 +150,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
requested_options.append("buddy-list");
requested_options.append("ui-config");
#endif
requested_options.append("voice-config");
requested_options.append("tutorial_setting");
requested_options.append("login-flags");
requested_options.append("global-textures");

View File

@ -119,7 +119,7 @@ void LLOutputMonitorCtrl::draw()
{
// Copied from llmediaremotectrl.cpp
// *TODO: Give the LLOutputMonitorCtrl an agent-id to monitor, then
// call directly into gVoiceClient to ask if that agent-id is muted, is
// call directly into LLVoiceClient::getInstance() to ask if that agent-id is muted, is
// speaking, and what power. This avoids duplicating data, which can get
// out of sync.
const F32 LEVEL_0 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL / 3.f;
@ -128,14 +128,14 @@ void LLOutputMonitorCtrl::draw()
if (getVisible() && mAutoUpdate && !mIsMuted && mSpeakerId.notNull())
{
setPower(gVoiceClient->getCurrentPower(mSpeakerId));
setPower(LLVoiceClient::getInstance()->getCurrentPower(mSpeakerId));
if(mIsAgentControl)
{
setIsTalking(gVoiceClient->getUserPTTState());
setIsTalking(LLVoiceClient::getInstance()->getUserPTTState());
}
else
{
setIsTalking(gVoiceClient->getIsSpeaking(mSpeakerId));
setIsTalking(LLVoiceClient::getInstance()->getIsSpeaking(mSpeakerId));
}
}

View File

@ -112,7 +112,7 @@ private:
LLPointer<LLUIImage> mImageLevel2;
LLPointer<LLUIImage> mImageLevel3;
/** whether to deal with gVoiceClient directly */
/** whether to deal with LLVoiceClient::getInstance() directly */
bool mAutoUpdate;
/** uuid of a speaker being monitored */

View File

@ -258,7 +258,7 @@ void LLOverlayBar::refresh()
{
// update "remotes"
childSetVisible("media_remote_container", TRUE);
childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled());
childSetVisible("voice_remote_container", LLVoiceClient::getInstance()->voiceEnabled());
childSetVisible("state_buttons", TRUE);
}

View File

@ -92,7 +92,7 @@ BOOL LLPanelChatControlPanel::postBuild()
void LLPanelChatControlPanel::draw()
{
// hide/show start call and end call buttons
bool voice_enabled = LLVoiceClient::voiceEnabled();
bool voice_enabled = LLVoiceClient::getInstance()->voiceEnabled();
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId);
if (!session) return;

View File

@ -336,7 +336,6 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
{
if (mExcludeAgent && gAgent.getID() == avatar_id) return;
if (mAvatarList->contains(avatar_id)) return;
mAvatarList->getIDs().push_back(avatar_id);
mAvatarList->setDirty();
adjustParticipant(avatar_id);
@ -622,7 +621,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD&
}
else if (item == "can_call")
{
return LLVoiceClient::voiceEnabled();
return LLVoiceClient::getInstance()->voiceEnabled();
}
return true;

View File

@ -59,9 +59,9 @@ LLSpeakButton::Params::Params()
void LLSpeakButton::draw()
{
// gVoiceClient is the authoritative global source of info regarding our open-mic state, we merely reflect that state.
bool openmic = gVoiceClient->getUserPTTState();
bool voiceenabled = gVoiceClient->voiceEnabled();
// LLVoiceClient::getInstance() is the authoritative global source of info regarding our open-mic state, we merely reflect that state.
bool openmic = LLVoiceClient::getInstance()->getUserPTTState();
bool voiceenabled = LLVoiceClient::getInstance()->voiceEnabled();
mSpeakBtn->setToggleState(openmic && voiceenabled);
mOutputMonitor->setIsMuted(!voiceenabled);
LLUICtrl::draw();
@ -166,11 +166,11 @@ void LLSpeakButton::setLabelVisible(bool visible)
void LLSpeakButton::onMouseDown_SpeakBtn()
{
bool down = true;
gVoiceClient->inputUserControlState(down); // this method knows/care about whether this translates into a toggle-to-talk or down-to-talk
LLVoiceClient::getInstance()->inputUserControlState(down); // this method knows/care about whether this translates into a toggle-to-talk or down-to-talk
}
void LLSpeakButton::onMouseUp_SpeakBtn()
{
bool down = false;
gVoiceClient->inputUserControlState(down);
LLVoiceClient::getInstance()->inputUserControlState(down);
}

View File

@ -72,7 +72,7 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy
mDisplayName = name;
}
gVoiceClient->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id));
LLVoiceClient::getInstance()->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id));
mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
}
@ -210,7 +210,7 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin
void LLSpeakerMgr::update(BOOL resort_ok)
{
if (!gVoiceClient)
if (!LLVoiceClient::getInstance())
{
return;
}
@ -224,7 +224,7 @@ void LLSpeakerMgr::update(BOOL resort_ok)
}
// update status of all current speakers
BOOL voice_channel_active = (!mVoiceChannel && gVoiceClient->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive());
BOOL voice_channel_active = (!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive());
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end();)
{
LLUUID speaker_id = speaker_it->first;
@ -232,21 +232,21 @@ void LLSpeakerMgr::update(BOOL resort_ok)
speaker_map_t::iterator cur_speaker_it = speaker_it++;
if (voice_channel_active && gVoiceClient->getVoiceEnabled(speaker_id))
if (voice_channel_active && LLVoiceClient::getInstance()->getVoiceEnabled(speaker_id))
{
speakerp->mSpeechVolume = gVoiceClient->getCurrentPower(speaker_id);
BOOL moderator_muted_voice = gVoiceClient->getIsModeratorMuted(speaker_id);
speakerp->mSpeechVolume = LLVoiceClient::getInstance()->getCurrentPower(speaker_id);
BOOL moderator_muted_voice = LLVoiceClient::getInstance()->getIsModeratorMuted(speaker_id);
if (moderator_muted_voice != speakerp->mModeratorMutedVoice)
{
speakerp->mModeratorMutedVoice = moderator_muted_voice;
speakerp->fireEvent(new LLSpeakerVoiceModerationEvent(speakerp));
}
if (gVoiceClient->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice)
if (LLVoiceClient::getInstance()->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice)
{
speakerp->mStatus = LLSpeaker::STATUS_MUTED;
}
else if (gVoiceClient->getIsSpeaking(speaker_id))
else if (LLVoiceClient::getInstance()->getIsSpeaking(speaker_id))
{
// reset inactivity expiration
if (speakerp->mStatus != LLSpeaker::STATUS_SPEAKING)
@ -341,19 +341,20 @@ void LLSpeakerMgr::update(BOOL resort_ok)
void LLSpeakerMgr::updateSpeakerList()
{
// are we bound to the currently active voice channel?
if ((!mVoiceChannel && gVoiceClient->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()))
if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()))
{
LLVoiceClient::participantMap* participants = gVoiceClient->getParticipantList();
if(participants)
std::vector<LLUUID> participants = LLVoiceClient::getInstance()->getParticipantList();
// add new participants to our list of known speakers
for (std::vector<LLUUID>::iterator participant_it = participants.begin();
participant_it != participants.end();
++participant_it)
{
LLVoiceClient::participantMap::iterator participant_it;
setSpeaker(*participant_it,
LLVoiceClient::getInstance()->getDisplayName(*participant_it),
LLSpeaker::STATUS_VOICE_ACTIVE,
(LLVoiceClient::getInstance()->isParticipantAvatar(*participant_it)?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL));
// add new participants to our list of known speakers
for (participant_it = participants->begin(); participant_it != participants->end(); ++participant_it)
{
LLVoiceClient::participantState* participantp = participant_it->second;
setSpeaker(participantp->mAvatarID, participantp->mDisplayName, LLSpeaker::STATUS_VOICE_ACTIVE, (participantp->isAvatar()?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL));
}
}
}
}
@ -414,7 +415,7 @@ void LLSpeakerMgr::speakerChatted(const LLUUID& speaker_id)
BOOL LLSpeakerMgr::isVoiceActive()
{
// mVoiceChannel = NULL means current voice channel, whatever it is
return LLVoiceClient::voiceEnabled() && mVoiceChannel && mVoiceChannel->isActive();
return LLVoiceClient::getInstance()->voiceEnabled() && mVoiceChannel && mVoiceChannel->isActive();
}

View File

@ -189,6 +189,7 @@
#include "llinventorybridge.h"
#include "llappearancemgr.h"
#include "llavatariconctrl.h"
#include "llvoicechannel.h"
#include "lllogin.h"
#include "llevents.h"
@ -1157,7 +1158,11 @@ bool idle_startup()
if(process_login_success_response())
{
// Pass the user information to the voice chat server interface.
gVoiceClient->userAuthorized(gUserCredential->userID(), gAgentID);
LLVoiceClient::getInstance()->userAuthorized(gUserCredential->userID(), gAgentID);
// create the default proximal channel
LLVoiceChannel::initClass();
// update the voice settings
LLVoiceClient::getInstance()->updateSettings();
LLGridManager::getInstance()->setFavorite();
LLStartUp::setStartupState( STATE_WORLD_INIT);
}
@ -3008,7 +3013,44 @@ bool process_login_success_response()
//setup map of datetime strings to codes and slt & local time offset from utc
LLStringOps::setupDatetimeInfo(pacific_daylight_time);
}
static const char* CONFIG_OPTIONS[] = {"voice-config"};
for (int i = 0; i < sizeof(CONFIG_OPTIONS)/sizeof(CONFIG_OPTIONS[0]); i++)
{
LLSD options = response[CONFIG_OPTIONS[i]];
if (!options.isArray() && (options.size() < 1) && !options[0].isMap())
{
continue;
}
llinfos << "config option " << CONFIG_OPTIONS[i][0] << "response " << options << llendl;
for(LLSD::map_iterator option_it = options[0].beginMap();
option_it != options[0].endMap();
option_it++)
{
llinfos << "trying option " << option_it->first << llendl;
LLPointer<LLControlVariable> control = gSavedSettings.getControl(option_it->first);
if(control.notNull())
{
if(control->isType(TYPE_BOOLEAN))
{
llinfos << "Setting BOOL from login " << option_it->first << " " << option_it->second << llendl;
gSavedSettings.setBOOL(option_it->first, !((option_it->second == "F") ||
(option_it->second == "false") ||
(!option_it->second)));
}
else if (control->isType(TYPE_STRING))
{
llinfos << "Setting String from login " << option_it->first << " " << option_it->second << llendl;
gSavedSettings.setString(option_it->first, option_it->second);
}
// we don't support other types now
}
}
}
LLSD initial_outfit = response["initial-outfit"][0];
if(initial_outfit.size())
{

View File

@ -286,5 +286,11 @@ const char * LLURL::getFullPath()
return(sReturnString);
}
const char * LLURL::getAuthority()
{
strncpy(LLURL::sReturnString,mAuthority, LL_MAX_PATH -1); /* Flawfinder: ignore */
LLURL::sReturnString[LL_MAX_PATH -1] = '\0';
return(sReturnString);
}
char LLURL::sReturnString[LL_MAX_PATH] = "";

View File

@ -79,6 +79,7 @@ public:
virtual const char *getFQURL() const;
virtual const char *getFullPath();
virtual const char *getAuthority();
virtual const char *updateRelativePath(const LLURL &url);

View File

@ -156,21 +156,21 @@ void audio_update_volume(bool force_update)
LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume );
// Voice
if (gVoiceClient)
if (LLVoiceClient::getInstance())
{
F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice");
voice_volume = mute_volume * master_volume * voice_volume;
BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice");
gVoiceClient->setVoiceVolume(voice_mute ? 0.f : voice_volume);
gVoiceClient->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic"));
LLVoiceClient::getInstance()->setVoiceVolume(voice_mute ? 0.f : voice_volume);
LLVoiceClient::getInstance()->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic"));
if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized")))
{
gVoiceClient->setMuteMic(true);
LLVoiceClient::getInstance()->setMuteMic(true);
}
else
{
gVoiceClient->setMuteMic(false);
LLVoiceClient::getInstance()->setMuteMic(false);
}
}
}

View File

@ -441,9 +441,9 @@ bool handleHighResSnapshotChanged(const LLSD& newvalue)
bool handleVoiceClientPrefsChanged(const LLSD& newvalue)
{
if(gVoiceClient)
if(LLVoiceClient::getInstance())
{
gVoiceClient->updateSettings();
LLVoiceClient::getInstance()->updateSettings();
}
return true;
}

View File

@ -813,7 +813,7 @@ BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK m
BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
{
BOOL down = TRUE;
gVoiceClient->middleMouseState(true);
LLVoiceClient::getInstance()->middleMouseState(true);
handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_MIDDLE,down);
// Always handled as far as the OS is concerned.
@ -823,7 +823,7 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS
BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
{
BOOL down = FALSE;
gVoiceClient->middleMouseState(false);
LLVoiceClient::getInstance()->middleMouseState(false);
handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_MIDDLE,down);
// Always handled as far as the OS is concerned.
@ -939,7 +939,7 @@ void LLViewerWindow::handleFocusLost(LLWindow *window)
BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
{
// Let the voice chat code check for its PTT key. Note that this never affects event processing.
gVoiceClient->keyDown(key, mask);
LLVoiceClient::getInstance()->keyDown(key, mask);
if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
{
@ -961,7 +961,7 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key, MASK mask)
{
// Let the voice chat code check for its PTT key. Note that this never affects event processing.
gVoiceClient->keyUp(key, mask);
LLVoiceClient::getInstance()->keyUp(key, mask);
return FALSE;
}

View File

@ -1271,7 +1271,7 @@ void LLVOAvatar::initInstance(void)
//VTPause(); // VTune
mVoiceVisualizer->setVoiceEnabled( gVoiceClient->getVoiceEnabled( mID ) );
mVoiceVisualizer->setVoiceEnabled( LLVoiceClient::getInstance()->getVoiceEnabled( mID ) );
}
const LLVector3 LLVOAvatar::getRenderPosition() const
@ -2192,7 +2192,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
// store off last frame's root position to be consistent with camera position
LLVector3 root_pos_last = mRoot.getWorldPosition();
BOOL detailed_update = updateCharacter(agent);
BOOL voice_enabled = gVoiceClient->getVoiceEnabled( mID ) && gVoiceClient->inProximalChannel();
BOOL voice_enabled = LLVoiceClient::getInstance()->getVoiceEnabled( mID ) && LLVoiceClient::getInstance()->inProximalChannel();
if (gNoRender)
{
@ -2260,7 +2260,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
// Notice the calls to "gAwayTimer.reset()". This resets the timer that determines how long the avatar has been
// "away", so that the avatar doesn't lapse into away-mode (and slump over) while the user is still talking.
//-----------------------------------------------------------------------------------------------------------------
if (gVoiceClient->getIsSpeaking( mID ))
if (LLVoiceClient::getInstance()->getIsSpeaking( mID ))
{
if (!mVoiceVisualizer->getCurrentlySpeaking())
{
@ -2269,7 +2269,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
//printf( "gAwayTimer.reset();\n" );
}
mVoiceVisualizer->setSpeakingAmplitude( gVoiceClient->getCurrentPower( mID ) );
mVoiceVisualizer->setSpeakingAmplitude( LLVoiceClient::getInstance()->getCurrentPower( mID ) );
if( isSelf() )
{
@ -2498,7 +2498,7 @@ F32 LLVOAvatar::calcMorphAmount()
void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
{
// Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync
if ( voice_enabled && (gVoiceClient->lipSyncEnabled()) && gVoiceClient->getIsSpeaking( mID ) )
if ( voice_enabled && (LLVoiceClient::getInstance()->lipSyncEnabled()) && LLVoiceClient::getInstance()->getIsSpeaking( mID ) )
{
F32 ooh_morph_amount = 0.0f;
F32 aah_morph_amount = 0.0f;

View File

@ -72,9 +72,9 @@ private:
void LLVoiceCallCapResponder::error(U32 status, const std::string& reason)
{
llwarns << "LLVoiceCallCapResponder::error("
LL_WARNS("Voice") << "LLVoiceCallCapResponder::error("
<< status << ": " << reason << ")"
<< llendl;
<< LL_ENDL;
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID);
if ( channelp )
{
@ -104,8 +104,8 @@ void LLVoiceCallCapResponder::result(const LLSD& content)
LLSD::map_const_iterator iter;
for(iter = content.beginMap(); iter != content.endMap(); ++iter)
{
llinfos << "LLVoiceCallCapResponder::result got "
<< iter->first << llendl;
LL_DEBUGS("Voice") << "LLVoiceCallCapResponder::result got "
<< iter->first << LL_ENDL;
}
channelp->setChannelInfo(
@ -130,18 +130,16 @@ LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& sess
{
// a voice channel already exists for this session id, so this instance will be orphaned
// the end result should simply be the failure to make voice calls
llwarns << "Duplicate voice channels registered for session_id " << session_id << llendl;
LL_WARNS("Voice") << "Duplicate voice channels registered for session_id " << session_id << LL_ENDL;
}
LLVoiceClient::getInstance()->addObserver(this);
}
LLVoiceChannel::~LLVoiceChannel()
{
// Don't use LLVoiceClient::getInstance() here -- this can get called during atexit() time and that singleton MAY have already been destroyed.
if(gVoiceClient)
if(LLVoiceClient::getInstance())
{
gVoiceClient->removeObserver(this);
LLVoiceClient::getInstance()->removeObserver(this);
}
sVoiceChannelMap.erase(mSessionID);
@ -161,13 +159,13 @@ void LLVoiceChannel::setChannelInfo(
if (mURI.empty())
{
LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs);
llwarns << "Received empty URI for channel " << mSessionName << llendl;
LL_WARNS("Voice") << "Received empty URI for channel " << mSessionName << LL_ENDL;
deactivate();
}
else if (mCredentials.empty())
{
LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs);
llwarns << "Received empty credentials for channel " << mSessionName << llendl;
LL_WARNS("Voice") << "Received empty credentials for channel " << mSessionName << LL_ENDL;
deactivate();
}
else
@ -282,13 +280,14 @@ void LLVoiceChannel::deactivate()
//Default mic is OFF when leaving voice calls
if (gSavedSettings.getBOOL("AutoDisengageMic") &&
sCurrentVoiceChannel == this &&
gVoiceClient->getUserPTTState())
LLVoiceClient::getInstance()->getUserPTTState())
{
gSavedSettings.setBOOL("PTTCurrentlyEnabled", true);
gVoiceClient->inputUserControlState(true);
LLVoiceClient::getInstance()->inputUserControlState(true);
}
}
LLVoiceClient::getInstance()->removeObserver(this);
if (sCurrentVoiceChannel == this)
{
// default channel is proximal channel
@ -328,7 +327,9 @@ void LLVoiceChannel::activate()
{
setState(STATE_CALL_STARTED);
}
LLVoiceClient::getInstance()->addObserver(this);
//do not send earlier, channel should be initialized, should not be in STATE_NO_CHANNEL_INFO state
sCurrentVoiceChannelChangedSignal(this->mSessionID);
}
@ -370,6 +371,11 @@ LLVoiceChannel* LLVoiceChannel::getChannelByURI(std::string uri)
}
}
LLVoiceChannel* LLVoiceChannel::getCurrentVoiceChannel()
{
return sCurrentVoiceChannel;
}
void LLVoiceChannel::updateSessionID(const LLUUID& new_session_id)
{
sVoiceChannelMap.erase(sVoiceChannelMap.find(mSessionID));
@ -418,7 +424,6 @@ void LLVoiceChannel::initClass()
sCurrentVoiceChannel = LLVoiceChannelProximal::getInstance();
}
//static
void LLVoiceChannel::suspend()
{
@ -434,7 +439,7 @@ void LLVoiceChannel::resume()
{
if (sSuspended)
{
if (gVoiceClient->voiceEnabled())
if (LLVoiceClient::getInstance()->voiceEnabled())
{
if (sSuspendedVoiceChannel)
{
@ -504,9 +509,9 @@ void LLVoiceChannelGroup::activate()
#endif
//Mic default state is OFF on initiating/joining Ad-Hoc/Group calls
if (gVoiceClient->getUserPTTState() && gVoiceClient->getPTTIsToggle())
if (LLVoiceClient::getInstance()->getUserPTTState() && LLVoiceClient::getInstance()->getPTTIsToggle())
{
gVoiceClient->inputUserControlState(true);
LLVoiceClient::getInstance()->inputUserControlState(true);
}
}
@ -553,7 +558,7 @@ void LLVoiceChannelGroup::setChannelInfo(
else
{
//*TODO: notify user
llwarns << "Received invalid credentials for channel " << mSessionName << llendl;
LL_WARNS("Voice") << "Received invalid credentials for channel " << mSessionName << LL_ENDL;
deactivate();
}
}
@ -651,7 +656,6 @@ void LLVoiceChannelGroup::setState(EState state)
LLVoiceChannelProximal::LLVoiceChannelProximal() :
LLVoiceChannel(LLUUID::null, LLStringUtil::null)
{
activate();
}
BOOL LLVoiceChannelProximal::isActive()
@ -663,13 +667,13 @@ void LLVoiceChannelProximal::activate()
{
if (callStarted()) return;
LLVoiceChannel::activate();
if (callStarted())
if((LLVoiceChannel::sCurrentVoiceChannel != this) && (LLVoiceChannel::getState() == STATE_CONNECTED))
{
// this implicitly puts you back in the spatial channel
LLVoiceClient::getInstance()->leaveNonSpatialChannel();
// we're connected to a non-spatial channel, so disconnect.
LLVoiceClient::getInstance()->leaveNonSpatialChannel();
}
LLVoiceChannel::activate();
}
void LLVoiceChannelProximal::onChange(EStatusType type, const std::string &channelURI, bool proximal)
@ -754,7 +758,7 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string
void LLVoiceChannelP2P::handleStatusChange(EStatusType type)
{
llinfos << "P2P CALL CHANNEL STATUS CHANGE: incoming=" << int(mReceivedCall) << " newstatus=" << LLVoiceClientStatusObserver::status2string(type) << " (mState=" << mState << ")" << llendl;
LL_INFOS("Voice") << "P2P CALL CHANNEL STATUS CHANGE: incoming=" << int(mReceivedCall) << " newstatus=" << LLVoiceClientStatusObserver::status2string(type) << " (mState=" << mState << ")" << LL_ENDL;
// status updates
switch(type)
@ -824,9 +828,9 @@ void LLVoiceChannelP2P::activate()
LLRecentPeople::instance().add(mOtherUserID);
//Default mic is ON on initiating/joining P2P calls
if (!gVoiceClient->getUserPTTState() && gVoiceClient->getPTTIsToggle())
if (!LLVoiceClient::getInstance()->getUserPTTState() && LLVoiceClient::getInstance()->getPTTIsToggle())
{
gVoiceClient->inputUserControlState(true);
LLVoiceClient::getInstance()->inputUserControlState(true);
}
}
}
@ -889,7 +893,7 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s
void LLVoiceChannelP2P::setState(EState state)
{
llinfos << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << llendl;
LL_INFOS("Voice") << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << LL_ENDL;
if (mReceivedCall) // incoming call
{

View File

@ -98,7 +98,8 @@ public:
static LLVoiceChannel* getChannelByID(const LLUUID& session_id);
static LLVoiceChannel* getChannelByURI(std::string uri);
static LLVoiceChannel* getCurrentVoiceChannel() { return sCurrentVoiceChannel; }
static LLVoiceChannel* getCurrentVoiceChannel();
static void initClass();
static void suspend();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,905 @@
/**
* @file llvoicevivox.h
* @brief Declaration of LLDiamondwareVoiceClient class which is the interface to the voice client process.
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_VOICE_VIVOX_H
#define LL_VOICE_VIVOX_H
class LLVOAvatar;
class LLVivoxProtocolParser;
#include "lliopipe.h"
#include "llpumpio.h"
#include "llchainio.h"
#include "lliosocket.h"
#include "v3math.h"
#include "llframetimer.h"
#include "llviewerregion.h"
#include "llcallingcard.h" // for LLFriendObserver
#ifdef LL_STANDALONE
# include "expat.h"
#else
# include "expat/expat.h"
#endif
#include "llvoiceclient.h"
class LLVivoxVoiceAccountProvisionResponder;
class LLVivoxVoiceClientMuteListObserver;
class LLVivoxVoiceClientFriendsObserver;
class LLVivoxVoiceClientParticipantObserver
{
public:
virtual ~LLVivoxVoiceClientParticipantObserver() { }
virtual void onChange() = 0;
};
class LLVivoxVoiceClient: public LLSingleton<LLVivoxVoiceClient>, virtual public LLVoiceModuleInterface
{
LOG_CLASS(LLVivoxVoiceClient);
public:
LLVivoxVoiceClient();
virtual ~LLVivoxVoiceClient();
/// @name LLVoiceModuleInterface virtual implementations
/// @see LLVoiceModuleInterface
//@{
virtual void init(LLPumpIO *pump); // Call this once at application startup (creates connector)
virtual void terminate(); // Call this to clean up during shutdown
virtual const LLVoiceVersionInfo& getVersion();
virtual void updateSettings(); // call after loading settings and whenever they change
/////////////////////
/// @name Tuning
//@{
virtual void tuningStart();
virtual void tuningStop();
virtual bool inTuningMode();
virtual void tuningSetMicVolume(float volume);
virtual void tuningSetSpeakerVolume(float volume);
virtual float tuningGetEnergy(void);
//@}
/////////////////////
/// @name Devices
//@{
// This returns true when it's safe to bring up the "device settings" dialog in the prefs.
// i.e. when the daemon is running and connected, and the device lists are populated.
virtual bool deviceSettingsAvailable();
// Requery the vivox daemon for the current list of input/output devices.
// If you pass true for clearCurrentList, deviceSettingsAvailable() will be false until the query has completed
// (use this if you want to know when it's done).
// If you pass false, you'll have no way to know when the query finishes, but the device lists will not appear empty in the interim.
virtual void refreshDeviceLists(bool clearCurrentList = true);
virtual void setCaptureDevice(const std::string& name);
virtual void setRenderDevice(const std::string& name);
virtual LLVoiceDeviceList& getCaptureDevices();
virtual LLVoiceDeviceList& getRenderDevices();
//@}
virtual std::vector<LLUUID> getParticipantList(void);
// Send a text message to the specified user, initiating the session if necessary.
virtual BOOL sendTextMessage(const LLUUID& participant_id, const std::string& message);
// close any existing text IM session with the specified user
virtual void endUserIMSession(const LLUUID &uuid);
// Returns true if calling back the session URI after the session has closed is possible.
// Currently this will be false only for PSTN P2P calls.
// NOTE: this will return true if the session can't be found.
virtual BOOL isSessionCallBackPossible(const LLUUID &session_id);
// Returns true if the session can accepte text IM's.
// Currently this will be false only for PSTN P2P calls.
// NOTE: this will return true if the session can't be found.
virtual BOOL isSessionTextIMPossible(const LLUUID &session_id);
////////////////////////////
/// @name Channel stuff
//@{
// returns true iff the user is currently in a proximal (local spatial) channel.
// Note that gestures should only fire if this returns true.
virtual bool inProximalChannel();
virtual void setNonSpatialChannel(const std::string &uri,
const std::string &credentials);
virtual void setSpatialChannel(const std::string &uri,
const std::string &credentials);
virtual void leaveNonSpatialChannel();
virtual void leaveChannel(void);
// Returns the URI of the current channel, or an empty string if not currently in a channel.
// NOTE that it will return an empty string if it's in the process of joining a channel.
virtual std::string getCurrentChannel();
//@}
//////////////////////////
/// @name invitations
//@{
// start a voice channel with the specified user
virtual void callUser(const LLUUID &uuid);
virtual bool answerInvite(std::string &channelHandle);
virtual void declineInvite(std::string &channelHandle);
//@}
/////////////////////////
/// @name Volume/gain
//@{
virtual void setVoiceVolume(F32 volume);
virtual void setMicGain(F32 volume);
//@}
/////////////////////////
/// @name enable disable voice and features
//@{
virtual bool voiceEnabled();
virtual void setVoiceEnabled(bool enabled);
virtual BOOL lipSyncEnabled();
virtual void setLipSyncEnabled(BOOL enabled);
virtual void setMuteMic(bool muted); // Use this to mute the local mic (for when the client is minimized, etc), ignoring user PTT state.
//@}
////////////////////////
/// @name PTT
//@{
virtual void setUserPTTState(bool ptt);
virtual bool getUserPTTState();
virtual void setUsePTT(bool usePTT);
virtual void setPTTIsToggle(bool PTTIsToggle);
virtual bool getPTTIsToggle();
virtual void inputUserControlState(bool down); // interpret any sort of up-down mic-open control input according to ptt-toggle prefs
virtual void toggleUserPTTState(void);
virtual void keyDown(KEY key, MASK mask);
virtual void keyUp(KEY key, MASK mask);
virtual void middleMouseState(bool down);
//@}
//////////////////////////
/// @name nearby speaker accessors
//@{
virtual BOOL getVoiceEnabled(const LLUUID& id); // true if we've received data for this avatar
virtual std::string getDisplayName(const LLUUID& id);
virtual BOOL isOnlineSIP(const LLUUID &id);
virtual BOOL isParticipantAvatar(const LLUUID &id);
virtual BOOL getIsSpeaking(const LLUUID& id);
virtual BOOL getIsModeratorMuted(const LLUUID& id);
virtual F32 getCurrentPower(const LLUUID& id); // "power" is related to "amplitude" in a defined way. I'm just not sure what the formula is...
virtual BOOL getOnMuteList(const LLUUID& id);
virtual F32 getUserVolume(const LLUUID& id);
virtual void setUserVolume(const LLUUID& id, F32 volume); // set's volume for specified agent, from 0-1 (where .5 is nominal)
//@}
// authorize the user
virtual void userAuthorized(const std::string& user_id,
const LLUUID &agentID);
//////////////////////////////
/// @name Status notification
//@{
virtual void addObserver(LLVoiceClientStatusObserver* observer);
virtual void removeObserver(LLVoiceClientStatusObserver* observer);
virtual void addObserver(LLFriendObserver* observer);
virtual void removeObserver(LLFriendObserver* observer);
virtual void addObserver(LLVoiceClientParticipantObserver* observer);
virtual void removeObserver(LLVoiceClientParticipantObserver* observer);
//@}
virtual std::string sipURIFromID(const LLUUID &id);
//@}
protected:
//////////////////////
// Vivox Specific definitions
friend class LLVivoxVoiceAccountProvisionResponder;
friend class LLVivoxVoiceClientMuteListObserver;
friend class LLVivoxVoiceClientFriendsObserver;
enum streamState
{
streamStateUnknown = 0,
streamStateIdle = 1,
streamStateConnected = 2,
streamStateRinging = 3,
};
struct participantState
{
public:
participantState(const std::string &uri);
bool updateMuteState();
bool isAvatar();
std::string mURI;
LLUUID mAvatarID;
std::string mAccountName;
std::string mDisplayName;
LLFrameTimer mSpeakingTimeout;
F32 mLastSpokeTimestamp;
F32 mPower;
int mVolume;
std::string mGroupID;
int mUserVolume;
bool mPTT;
bool mIsSpeaking;
bool mIsModeratorMuted;
bool mOnMuteList; // true if this avatar is on the user's mute list (and should be muted)
bool mVolumeDirty; // true if this participant needs a volume command sent (either mOnMuteList or mUserVolume has changed)
bool mAvatarIDValid;
bool mIsSelf;
};
typedef std::map<const std::string, participantState*> participantMap;
typedef std::map<const LLUUID, participantState*> participantUUIDMap;
struct sessionState
{
public:
sessionState();
~sessionState();
participantState *addParticipant(const std::string &uri);
// Note: after removeParticipant returns, the participant* that was passed to it will have been deleted.
// Take care not to use the pointer again after that.
void removeParticipant(participantState *participant);
void removeAllParticipants();
participantState *findParticipant(const std::string &uri);
participantState *findParticipantByID(const LLUUID& id);
bool isCallBackPossible();
bool isTextIMPossible();
std::string mHandle;
std::string mGroupHandle;
std::string mSIPURI;
std::string mAlias;
std::string mName;
std::string mAlternateSIPURI;
std::string mHash; // Channel password
std::string mErrorStatusString;
std::queue<std::string> mTextMsgQueue;
LLUUID mIMSessionID;
LLUUID mCallerID;
int mErrorStatusCode;
int mMediaStreamState;
int mTextStreamState;
bool mCreateInProgress; // True if a Session.Create has been sent for this session and no response has been received yet.
bool mMediaConnectInProgress; // True if a Session.MediaConnect has been sent for this session and no response has been received yet.
bool mVoiceInvitePending; // True if a voice invite is pending for this session (usually waiting on a name lookup)
bool mTextInvitePending; // True if a text invite is pending for this session (usually waiting on a name lookup)
bool mSynthesizedCallerID; // True if the caller ID is a hash of the SIP URI -- this means we shouldn't do a name lookup.
bool mIsChannel; // True for both group and spatial channels (false for p2p, PSTN)
bool mIsSpatial; // True for spatial channels
bool mIsP2P;
bool mIncoming;
bool mVoiceEnabled;
bool mReconnect; // Whether we should try to reconnect to this session if it's dropped
// Set to true when the mute state of someone in the participant list changes.
// The code will have to walk the list to find the changed participant(s).
bool mVolumeDirty;
bool mParticipantsChanged;
participantMap mParticipantsByURI;
participantUUIDMap mParticipantsByUUID;
};
// internal state for a simple state machine. This is used to deal with the asynchronous nature of some of the messages.
// Note: if you change this list, please make corresponding changes to LLVivoxVoiceClient::state2string().
enum state
{
stateDisableCleanup,
stateDisabled, // Voice is turned off.
stateStart, // Class is initialized, socket is created
stateDaemonLaunched, // Daemon has been launched
stateConnecting, // connect() call has been issued
stateConnected, // connection to the daemon has been made, send some initial setup commands.
stateIdle, // socket is connected, ready for messaging
stateMicTuningStart,
stateMicTuningRunning,
stateMicTuningStop,
stateConnectorStart, // connector needs to be started
stateConnectorStarting, // waiting for connector handle
stateConnectorStarted, // connector handle received
stateLoginRetry, // need to retry login (failed due to changing password)
stateLoginRetryWait, // waiting for retry timer
stateNeedsLogin, // send login request
stateLoggingIn, // waiting for account handle
stateLoggedIn, // account handle received
stateCreatingSessionGroup, // Creating the main session group
stateNoChannel, //
stateJoiningSession, // waiting for session handle
stateSessionJoined, // session handle received
stateRunning, // in session, steady state
stateLeavingSession, // waiting for terminate session response
stateSessionTerminated, // waiting for terminate session response
stateLoggingOut, // waiting for logout response
stateLoggedOut, // logout response received
stateConnectorStopping, // waiting for connector stop
stateConnectorStopped, // connector stop received
// We go to this state if the login fails because the account needs to be provisioned.
// error states. No way to recover from these yet.
stateConnectorFailed,
stateConnectorFailedWaiting,
stateLoginFailed,
stateLoginFailedWaiting,
stateJoinSessionFailed,
stateJoinSessionFailedWaiting,
stateJail // Go here when all else has failed. Nothing will be retried, we're done.
};
typedef std::map<std::string, sessionState*> sessionMap;
///////////////////////////////////////////////////////
// Private Member Functions
//////////////////////////////////////////////////////
//////////////////////////////
/// @name TVC/Server management and communication
//@{
// Call this if the connection to the daemon terminates unexpectedly. It will attempt to reset everything and relaunch.
void daemonDied();
// Call this if we're just giving up on voice (can't provision an account, etc.). It will clean up and go away.
void giveUp();
// write to the tvc
bool writeString(const std::string &str);
void connectorCreate();
void connectorShutdown();
void closeSocket(void);
void requestVoiceAccountProvision(S32 retries = 3);
void login(
const std::string& account_name,
const std::string& password,
const std::string& voice_sip_uri_hostname,
const std::string& voice_account_server_uri);
void loginSendMessage();
void logout();
void logoutSendMessage();
//@}
//------------------------------------
// tuning
void tuningRenderStartSendMessage(const std::string& name, bool loop);
void tuningRenderStopSendMessage();
void tuningCaptureStartSendMessage(int duration);
void tuningCaptureStopSendMessage();
bool inTuningStates();
//----------------------------------
// devices
void clearCaptureDevices();
void addCaptureDevice(const std::string& name);
void clearRenderDevices();
void addRenderDevice(const std::string& name);
void buildSetAudioDevices(std::ostringstream &stream);
void getCaptureDevicesSendMessage();
void getRenderDevicesSendMessage();
// local audio updates
void buildLocalAudioUpdates(std::ostringstream &stream);
/////////////////////////////
// Response/Event handlers
void connectorCreateResponse(int statusCode, std::string &statusString, std::string &connectorHandle, std::string &versionID);
void loginResponse(int statusCode, std::string &statusString, std::string &accountHandle, int numberOfAliases);
void sessionCreateResponse(std::string &requestId, int statusCode, std::string &statusString, std::string &sessionHandle);
void sessionGroupAddSessionResponse(std::string &requestId, int statusCode, std::string &statusString, std::string &sessionHandle);
void sessionConnectResponse(std::string &requestId, int statusCode, std::string &statusString);
void logoutResponse(int statusCode, std::string &statusString);
void connectorShutdownResponse(int statusCode, std::string &statusString);
void accountLoginStateChangeEvent(std::string &accountHandle, int statusCode, std::string &statusString, int state);
void mediaStreamUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, int statusCode, std::string &statusString, int state, bool incoming);
void textStreamUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, bool enabled, int state, bool incoming);
void sessionAddedEvent(std::string &uriString, std::string &alias, std::string &sessionHandle, std::string &sessionGroupHandle, bool isChannel, bool incoming, std::string &nameString, std::string &applicationString);
void sessionGroupAddedEvent(std::string &sessionGroupHandle);
void sessionRemovedEvent(std::string &sessionHandle, std::string &sessionGroupHandle);
void participantAddedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString, std::string &displayNameString, int participantType);
void participantRemovedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString);
void participantUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, bool isModeratorMuted, bool isSpeaking, int volume, F32 energy);
void auxAudioPropertiesEvent(F32 energy);
void buddyPresenceEvent(std::string &uriString, std::string &alias, std::string &statusString, std::string &applicationString);
void messageEvent(std::string &sessionHandle, std::string &uriString, std::string &alias, std::string &messageHeader, std::string &messageBody, std::string &applicationString);
void sessionNotificationEvent(std::string &sessionHandle, std::string &uriString, std::string &notificationType);
void subscriptionEvent(std::string &buddyURI, std::string &subscriptionHandle, std::string &alias, std::string &displayName, std::string &applicationString, std::string &subscriptionType);
void buddyListChanged();
void muteListChanged();
void updateFriends(U32 mask);
/////////////////////////////
// Sending updates of current state
void updatePosition(void);
void setCameraPosition(const LLVector3d &position, const LLVector3 &velocity, const LLMatrix3 &rot);
void setAvatarPosition(const LLVector3d &position, const LLVector3 &velocity, const LLMatrix3 &rot);
bool channelFromRegion(LLViewerRegion *region, std::string &name);
void setEarLocation(S32 loc);
/////////////////////////////
// Accessors for data related to nearby speakers
// MBW -- XXX -- Not sure how to get this data out of the TVC
BOOL getUsingPTT(const LLUUID& id);
std::string getGroupID(const LLUUID& id); // group ID if the user is in group chat (empty string if not applicable)
/////////////////////////////
BOOL getAreaVoiceDisabled(); // returns true if the area the avatar is in is speech-disabled.
// Use this to determine whether to show a "no speech" icon in the menu bar.
// PTT
void setPTTKey(std::string &key);
/////////////////////////////
// Recording controls
void recordingLoopStart(int seconds = 3600, int deltaFramesPerControlFrame = 200);
void recordingLoopSave(const std::string& filename);
void recordingStop();
// Playback controls
void filePlaybackStart(const std::string& filename);
void filePlaybackStop();
void filePlaybackSetPaused(bool paused);
void filePlaybackSetMode(bool vox = false, float speed = 1.0f);
participantState *findParticipantByID(const LLUUID& id);
////////////////////////////////////////
// voice sessions.
typedef std::set<sessionState*> sessionSet;
typedef sessionSet::iterator sessionIterator;
sessionIterator sessionsBegin(void);
sessionIterator sessionsEnd(void);
sessionState *findSession(const std::string &handle);
sessionState *findSessionBeingCreatedByURI(const std::string &uri);
sessionState *findSession(const LLUUID &participant_id);
sessionState *findSessionByCreateID(const std::string &create_id);
sessionState *addSession(const std::string &uri, const std::string &handle = LLStringUtil::null);
void setSessionHandle(sessionState *session, const std::string &handle = LLStringUtil::null);
void setSessionURI(sessionState *session, const std::string &uri);
void deleteSession(sessionState *session);
void deleteAllSessions(void);
void verifySessionState(void);
void joinedAudioSession(sessionState *session);
void leftAudioSession(sessionState *session);
// This is called in several places where the session _may_ need to be deleted.
// It contains logic for whether to delete the session or keep it around.
void reapSession(sessionState *session);
// Returns true if the session seems to indicate we've moved to a region on a different voice server
bool sessionNeedsRelog(sessionState *session);
//////////////////////////////////////
// buddy list stuff, needed for SLIM later
struct buddyListEntry
{
buddyListEntry(const std::string &uri);
std::string mURI;
std::string mDisplayName;
LLUUID mUUID;
bool mOnlineSL;
bool mOnlineSLim;
bool mCanSeeMeOnline;
bool mHasBlockListEntry;
bool mHasAutoAcceptListEntry;
bool mNameResolved;
bool mInSLFriends;
bool mInVivoxBuddies;
bool mNeedsNameUpdate;
};
typedef std::map<std::string, buddyListEntry*> buddyListMap;
// This should be called when parsing a buddy list entry sent by SLVoice.
void processBuddyListEntry(const std::string &uri, const std::string &displayName);
buddyListEntry *addBuddy(const std::string &uri);
buddyListEntry *addBuddy(const std::string &uri, const std::string &displayName);
buddyListEntry *findBuddy(const std::string &uri);
buddyListEntry *findBuddy(const LLUUID &id);
buddyListEntry *findBuddyByDisplayName(const std::string &name);
void deleteBuddy(const std::string &uri);
void deleteAllBuddies(void);
void deleteAllBlockRules(void);
void addBlockRule(const std::string &blockMask, const std::string &presenceOnly);
void deleteAllAutoAcceptRules(void);
void addAutoAcceptRule(const std::string &autoAcceptMask, const std::string &autoAddAsBuddy);
void accountListBlockRulesResponse(int statusCode, const std::string &statusString);
void accountListAutoAcceptRulesResponse(int statusCode, const std::string &statusString);
/////////////////////////////
// session control messages
void accountListBlockRulesSendMessage();
void accountListAutoAcceptRulesSendMessage();
void sessionGroupCreateSendMessage();
void sessionCreateSendMessage(sessionState *session, bool startAudio = true, bool startText = false);
void sessionGroupAddSessionSendMessage(sessionState *session, bool startAudio = true, bool startText = false);
void sessionMediaConnectSendMessage(sessionState *session); // just joins the audio session
void sessionTextConnectSendMessage(sessionState *session); // just joins the text session
void sessionTerminateSendMessage(sessionState *session);
void sessionGroupTerminateSendMessage(sessionState *session);
void sessionMediaDisconnectSendMessage(sessionState *session);
void sessionTextDisconnectSendMessage(sessionState *session);
// Pokes the state machine to leave the audio session next time around.
void sessionTerminate();
// Pokes the state machine to shut down the connector and restart it.
void requestRelog();
// Does the actual work to get out of the audio session
void leaveAudioSession();
void lookupName(const LLUUID &id);
static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
void avatarNameResolved(const LLUUID &id, const std::string &name);
private:
LLVoiceVersionInfo mVoiceVersion;
state mState;
bool mSessionTerminateRequested;
bool mRelogRequested;
void setState(state inState);
state getState(void) { return mState; };
std::string state2string(state inState);
void stateMachine();
static void idle(void *user_data);
LLHost mDaemonHost;
LLSocket::ptr_t mSocket;
bool mConnected;
LLPumpIO *mPump;
friend class LLVivoxProtocolParser;
std::string mAccountName;
std::string mAccountPassword;
std::string mAccountDisplayName;
bool mTuningMode;
float mTuningEnergy;
std::string mTuningAudioFile;
int mTuningMicVolume;
bool mTuningMicVolumeDirty;
int mTuningSpeakerVolume;
bool mTuningSpeakerVolumeDirty;
state mTuningExitState; // state to return to when we leave tuning mode.
std::string mSpatialSessionURI;
std::string mSpatialSessionCredentials;
std::string mMainSessionGroupHandle; // handle of the "main" session group.
std::string mChannelName; // Name of the channel to be looked up
bool mAreaVoiceDisabled;
sessionState *mAudioSession; // Session state for the current audio session
bool mAudioSessionChanged; // set to true when the above pointer gets changed, so observers can be notified.
sessionState *mNextAudioSession; // Session state for the audio session we're trying to join
// std::string mSessionURI; // URI of the session we're in.
// std::string mSessionHandle; // returned by ?
S32 mCurrentParcelLocalID; // Used to detect parcel boundary crossings
std::string mCurrentRegionName; // Used to detect parcel boundary crossings
std::string mConnectorHandle; // returned by "Create Connector" message
std::string mAccountHandle; // returned by login message
int mNumberOfAliases;
U32 mCommandCookie;
std::string mVoiceAccountServerURI;
std::string mVoiceSIPURIHostName;
int mLoginRetryCount;
sessionMap mSessionsByHandle; // Active sessions, indexed by session handle. Sessions which are being initiated may not be in this map.
sessionSet mSessions; // All sessions, not indexed. This is the canonical session list.
bool mBuddyListMapPopulated;
bool mBlockRulesListReceived;
bool mAutoAcceptRulesListReceived;
buddyListMap mBuddyListMap;
LLVoiceDeviceList mCaptureDevices;
LLVoiceDeviceList mRenderDevices;
std::string mCaptureDevice;
std::string mRenderDevice;
bool mCaptureDeviceDirty;
bool mRenderDeviceDirty;
// This should be called when the code detects we have changed parcels.
// It initiates the call to the server that gets the parcel channel.
void parcelChanged();
void switchChannel(std::string uri = std::string(), bool spatial = true, bool no_reconnect = false, bool is_p2p = false, std::string hash = "");
void joinSession(sessionState *session);
std::string nameFromAvatar(LLVOAvatar *avatar);
std::string nameFromID(const LLUUID &id);
bool IDFromName(const std::string name, LLUUID &uuid);
std::string displayNameFromAvatar(LLVOAvatar *avatar);
std::string sipURIFromAvatar(LLVOAvatar *avatar);
std::string sipURIFromName(std::string &name);
// Returns the name portion of the SIP URI if the string looks vaguely like a SIP URI, or an empty string if not.
std::string nameFromsipURI(const std::string &uri);
bool inSpatialChannel(void);
std::string getAudioSessionURI();
std::string getAudioSessionHandle();
void sendPositionalUpdate(void);
void buildSetCaptureDevice(std::ostringstream &stream);
void buildSetRenderDevice(std::ostringstream &stream);
void clearAllLists();
void checkFriend(const LLUUID& id);
void sendFriendsListUpdates();
// start a text IM session with the specified user
// This will be asynchronous, the session may be established at a future time.
sessionState* startUserIMSession(const LLUUID& uuid);
void sendQueuedTextMessages(sessionState *session);
void enforceTether(void);
bool mSpatialCoordsDirty;
LLVector3d mCameraPosition;
LLVector3d mCameraRequestedPosition;
LLVector3 mCameraVelocity;
LLMatrix3 mCameraRot;
LLVector3d mAvatarPosition;
LLVector3 mAvatarVelocity;
LLMatrix3 mAvatarRot;
bool mPTTDirty;
bool mPTT;
bool mUsePTT;
bool mPTTIsMiddleMouse;
KEY mPTTKey;
bool mPTTIsToggle;
bool mUserPTTState;
bool mMuteMic;
// Set to true when the friends list is known to have changed.
bool mFriendsListDirty;
enum
{
earLocCamera = 0, // ear at camera
earLocAvatar, // ear at avatar
earLocMixed // ear at avatar location/camera direction
};
S32 mEarLocation;
bool mSpeakerVolumeDirty;
bool mSpeakerMuteDirty;
int mSpeakerVolume;
int mMicVolume;
bool mMicVolumeDirty;
bool mVoiceEnabled;
bool mWriteInProgress;
std::string mWriteString;
size_t mWriteOffset;
LLTimer mUpdateTimer;
BOOL mLipSyncEnabled;
typedef std::set<LLVoiceClientParticipantObserver*> observer_set_t;
observer_set_t mParticipantObservers;
void notifyParticipantObservers();
typedef std::set<LLVoiceClientStatusObserver*> status_observer_set_t;
status_observer_set_t mStatusObservers;
void notifyStatusObservers(LLVoiceClientStatusObserver::EStatusType status);
typedef std::set<LLFriendObserver*> friend_observer_set_t;
friend_observer_set_t mFriendObservers;
void notifyFriendObservers();
};
/**
* @class LLVivoxProtocolParser
* @brief This class helps construct new LLIOPipe specializations
* @see LLIOPipe
*
* THOROUGH_DESCRIPTION
*/
class LLVivoxProtocolParser : public LLIOPipe
{
LOG_CLASS(LLVivoxProtocolParser);
public:
LLVivoxProtocolParser();
virtual ~LLVivoxProtocolParser();
protected:
/* @name LLIOPipe virtual implementations
*/
//@{
/**
* @brief Process the data in buffer
*/
virtual EStatus process_impl(
const LLChannelDescriptors& channels,
buffer_ptr_t& buffer,
bool& eos,
LLSD& context,
LLPumpIO* pump);
//@}
std::string mInput;
// Expat control members
XML_Parser parser;
int responseDepth;
bool ignoringTags;
bool isEvent;
int ignoreDepth;
// Members for processing responses. The values are transient and only valid within a call to processResponse().
bool squelchDebugOutput;
int returnCode;
int statusCode;
std::string statusString;
std::string requestId;
std::string actionString;
std::string connectorHandle;
std::string versionID;
std::string accountHandle;
std::string sessionHandle;
std::string sessionGroupHandle;
std::string alias;
std::string applicationString;
// Members for processing events. The values are transient and only valid within a call to processResponse().
std::string eventTypeString;
int state;
std::string uriString;
bool isChannel;
bool incoming;
bool enabled;
std::string nameString;
std::string audioMediaString;
std::string deviceString;
std::string displayNameString;
int participantType;
bool isLocallyMuted;
bool isModeratorMuted;
bool isSpeaking;
int volume;
F32 energy;
std::string messageHeader;
std::string messageBody;
std::string notificationType;
bool hasText;
bool hasAudio;
bool hasVideo;
bool terminated;
std::string blockMask;
std::string presenceOnly;
std::string autoAcceptMask;
std::string autoAddAsBuddy;
int numberOfAliases;
std::string subscriptionHandle;
std::string subscriptionType;
// Members for processing text between tags
std::string textBuffer;
bool accumulateText;
void reset();
void processResponse(std::string tag);
static void XMLCALL ExpatStartTag(void *data, const char *el, const char **attr);
static void XMLCALL ExpatEndTag(void *data, const char *el);
static void XMLCALL ExpatCharHandler(void *data, const XML_Char *s, int len);
void StartTag(const char *tag, const char **attr);
void EndTag(const char *tag);
void CharData(const char *buffer, int length);
};
#endif //LL_VIVOX_VOICE_CLIENT_H

View File

@ -49,7 +49,7 @@ libcurl Version: [LIBCURL_VERSION]
J2C Decoder Version: [J2C_VERSION]
Audio Driver Version: [AUDIO_DRIVER_VERSION]
Qt Webkit Version: [QT_WEBKIT_VERSION]
Vivox Version: [VIVOX_VERSION]
Voice Server Version: [VOICE_VERSION]
</floater.string>
<floater.string
name="none">

View File

@ -397,6 +397,15 @@ class WindowsManifest(ViewerManifest):
self.disable_manifest_check()
# Diamondware Runtimes
if self.prefix(src="diamondware-runtime/i686-win32", dst=""):
self.path("SLVoice_dwTVC.exe")
self.path("libcurl.dll")
self.path("libeay32.dll")
self.path("ssleay32.dll")
self.path("zlib1.dll")
self.end_prefix()
# pull in the crash logger and updater from other projects
# tag:"crash-logger" here as a cue to the exporter
self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'],
@ -606,6 +615,9 @@ class DarwinManifest(ViewerManifest):
self.path("vivox-runtime/universal-darwin/libvivoxsdk.dylib", "libvivoxsdk.dylib")
self.path("vivox-runtime/universal-darwin/libvivoxplatform.dylib", "libvivoxplatform.dylib")
self.path("vivox-runtime/universal-darwin/SLVoice", "SLVoice")
# DiamondWare runtime
self.path("diamondware-runtime/universal-darwin/SLVoice_dwTVC","SLVoice_dwTVC")
self.path("diamondware-runtime/universal-darwin/libfmodex.dylib", "libfmodex.dylib")
libdir = "../../libraries/universal-darwin/lib_release"
dylibs = {}
@ -898,6 +910,11 @@ class Linux_i686Manifest(LinuxManifest):
pass
self.end_prefix("lib")
# Diamondware runtimes
if self.prefix(src="diamondware-runtime/i686-linux", dst="bin"):
self.path("SLVoice_dwTVC")
self.end_prefix()
# Vivox runtimes
if self.prefix(src="vivox-runtime/i686-linux", dst="bin"):
self.path("SLVoice")

View File

@ -131,6 +131,7 @@ void LLLogin::Impl::connect(const std::string& uri, const LLSD& login_params)
std::string coroname =
LLCoros::instance().launch("LLLogin::Impl::login_",
boost::bind(&Impl::login_, this, _1, uri, login_params));
LL_DEBUGS("LLLogin") << " connected with uri '" << uri << "', login_params " << login_params << LL_ENDL;
}
void LLLogin::Impl::login_(LLCoros::self& self, std::string uri, LLSD login_params)