summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicechannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicechannel.cpp')
-rw-r--r--indra/newview/llvoicechannel.cpp64
1 files changed, 30 insertions, 34 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 338bc12f04..fac7fa6a18 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -72,9 +72,9 @@ private:
void LLVoiceCallCapResponder::error(U32 status, const std::string& reason)
{
- LL_WARNS("Voice") << "LLVoiceCallCapResponder::error("
+ llwarns << "LLVoiceCallCapResponder::error("
<< status << ": " << reason << ")"
- << LL_ENDL;
+ << llendl;
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)
{
- LL_DEBUGS("Voice") << "LLVoiceCallCapResponder::result got "
- << iter->first << LL_ENDL;
+ llinfos << "LLVoiceCallCapResponder::result got "
+ << iter->first << llendl;
}
channelp->setChannelInfo(
@@ -131,8 +131,10 @@ 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
- LL_WARNS("Voice") << "Duplicate voice channels registered for session_id " << session_id << LL_ENDL;
+ llwarns << "Duplicate voice channels registered for session_id " << session_id << llendl;
}
+
+ LLVoiceClient::getInstance()->addObserver(this);
}
LLVoiceChannel::~LLVoiceChannel()
@@ -143,7 +145,7 @@ LLVoiceChannel::~LLVoiceChannel()
// later in other destructors anyway). EXT-5524
if(LLVoiceClient::instanceExists())
{
- LLVoiceClient::getInstance()->removeObserver(this);
+ gVoiceClient->removeObserver(this);
}
sVoiceChannelMap.erase(mSessionID);
@@ -163,13 +165,13 @@ void LLVoiceChannel::setChannelInfo(
if (mURI.empty())
{
LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs);
- LL_WARNS("Voice") << "Received empty URI for channel " << mSessionName << LL_ENDL;
+ llwarns << "Received empty URI for channel " << mSessionName << llendl;
deactivate();
}
else if (mCredentials.empty())
{
LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs);
- LL_WARNS("Voice") << "Received empty credentials for channel " << mSessionName << LL_ENDL;
+ llwarns << "Received empty credentials for channel " << mSessionName << llendl;
deactivate();
}
else
@@ -284,14 +286,13 @@ void LLVoiceChannel::deactivate()
//Default mic is OFF when leaving voice calls
if (gSavedSettings.getBOOL("AutoDisengageMic") &&
sCurrentVoiceChannel == this &&
- LLVoiceClient::getInstance()->getUserPTTState())
+ gVoiceClient->getUserPTTState())
{
gSavedSettings.setBOOL("PTTCurrentlyEnabled", true);
- LLVoiceClient::getInstance()->inputUserControlState(true);
+ gVoiceClient->inputUserControlState(true);
}
}
- LLVoiceClient::getInstance()->removeObserver(this);
-
+
if (sCurrentVoiceChannel == this)
{
// default channel is proximal channel
@@ -331,9 +332,7 @@ 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);
}
@@ -375,11 +374,6 @@ LLVoiceChannel* LLVoiceChannel::getChannelByURI(std::string uri)
}
}
-LLVoiceChannel* LLVoiceChannel::getCurrentVoiceChannel()
-{
- return sCurrentVoiceChannel;
-}
-
void LLVoiceChannel::updateSessionID(const LLUUID& new_session_id)
{
sVoiceChannelMap.erase(sVoiceChannelMap.find(mSessionID));
@@ -431,6 +425,7 @@ void LLVoiceChannel::initClass()
sCurrentVoiceChannel = LLVoiceChannelProximal::getInstance();
}
+
//static
void LLVoiceChannel::suspend()
{
@@ -446,7 +441,7 @@ void LLVoiceChannel::resume()
{
if (sSuspended)
{
- if (LLVoiceClient::getInstance()->voiceEnabled())
+ if (gVoiceClient->voiceEnabled())
{
if (sSuspendedVoiceChannel)
{
@@ -516,9 +511,9 @@ void LLVoiceChannelGroup::activate()
#endif
//Mic default state is OFF on initiating/joining Ad-Hoc/Group calls
- if (LLVoiceClient::getInstance()->getUserPTTState() && LLVoiceClient::getInstance()->getPTTIsToggle())
+ if (gVoiceClient->getUserPTTState() && gVoiceClient->getPTTIsToggle())
{
- LLVoiceClient::getInstance()->inputUserControlState(true);
+ gVoiceClient->inputUserControlState(true);
}
}
@@ -565,7 +560,7 @@ void LLVoiceChannelGroup::setChannelInfo(
else
{
//*TODO: notify user
- LL_WARNS("Voice") << "Received invalid credentials for channel " << mSessionName << LL_ENDL;
+ llwarns << "Received invalid credentials for channel " << mSessionName << llendl;
deactivate();
}
}
@@ -664,6 +659,7 @@ void LLVoiceChannelGroup::setState(EState state)
LLVoiceChannelProximal::LLVoiceChannelProximal() :
LLVoiceChannel(LLUUID::null, LLStringUtil::null)
{
+ activate();
}
BOOL LLVoiceChannelProximal::isActive()
@@ -675,13 +671,13 @@ void LLVoiceChannelProximal::activate()
{
if (callStarted()) return;
- if((LLVoiceChannel::sCurrentVoiceChannel != this) && (LLVoiceChannel::getState() == STATE_CONNECTED))
+ LLVoiceChannel::activate();
+
+ if (callStarted())
{
- // we're connected to a non-spatial channel, so disconnect.
- LLVoiceClient::getInstance()->leaveNonSpatialChannel();
+ // this implicitly puts you back in the spatial channel
+ LLVoiceClient::getInstance()->leaveNonSpatialChannel();
}
- LLVoiceChannel::activate();
-
}
void LLVoiceChannelProximal::onChange(EStatusType type, const std::string &channelURI, bool proximal)
@@ -711,7 +707,7 @@ void LLVoiceChannelProximal::handleStatusChange(EStatusType status)
return;
case STATUS_VOICE_DISABLED:
//skip showing "Voice not available at your current location" when agent voice is disabled (EXT-4749)
- if(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking())
+ if(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking())
{
//TODO: remove or redirect this call status notification
// LLCallInfoDialog::show("unavailable", mNotifyArgs);
@@ -771,7 +767,7 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string
void LLVoiceChannelP2P::handleStatusChange(EStatusType type)
{
- LL_INFOS("Voice") << "P2P CALL CHANNEL STATUS CHANGE: incoming=" << int(mReceivedCall) << " newstatus=" << LLVoiceClientStatusObserver::status2string(type) << " (mState=" << mState << ")" << LL_ENDL;
+ llinfos << "P2P CALL CHANNEL STATUS CHANGE: incoming=" << int(mReceivedCall) << " newstatus=" << LLVoiceClientStatusObserver::status2string(type) << " (mState=" << mState << ")" << llendl;
// status updates
switch(type)
@@ -845,9 +841,9 @@ void LLVoiceChannelP2P::activate()
LLRecentPeople::instance().add(mOtherUserID);
//Default mic is ON on initiating/joining P2P calls
- if (!LLVoiceClient::getInstance()->getUserPTTState() && LLVoiceClient::getInstance()->getPTTIsToggle())
+ if (!gVoiceClient->getUserPTTState() && gVoiceClient->getPTTIsToggle())
{
- LLVoiceClient::getInstance()->inputUserControlState(true);
+ gVoiceClient->inputUserControlState(true);
}
}
}
@@ -910,7 +906,7 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s
void LLVoiceChannelP2P::setState(EState state)
{
- LL_INFOS("Voice") << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << LL_ENDL;
+ llinfos << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << llendl;
if (mReceivedCall) // incoming call
{