summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp44
1 files changed, 30 insertions, 14 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 3a07e4bb90..e8d64cabf6 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -289,10 +289,8 @@ void LLVoiceClient::setNonSpatialVoiceModule(const std::string &voice_server_typ
void LLVoiceClient::setHidden(bool hidden)
{
- if (mSpatialVoiceModule)
- {
- mSpatialVoiceModule->setHidden(hidden);
- }
+ LLWebRTCVoiceClient::getInstance()->setHidden(hidden);
+ LLVivoxVoiceClient::getInstance()->setHidden(hidden);
}
void LLVoiceClient::terminate()
@@ -462,7 +460,7 @@ const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()
//--------------------------------------------------
// participants
-void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants)
+void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants) const
{
#if !__FreeBSD__
LLWebRTCVoiceClient::getInstance()->getParticipantList(participants);
@@ -470,7 +468,7 @@ void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants)
LLVivoxVoiceClient::getInstance()->getParticipantList(participants);
}
-bool LLVoiceClient::isParticipant(const LLUUID &speaker_id)
+bool LLVoiceClient::isParticipant(const LLUUID &speaker_id) const
{
return
#if !__FreeBSD__
@@ -791,12 +789,12 @@ void LLVoiceClient::toggleUserPTTState(void)
//-------------------------------------------
// nearby speaker accessors
-bool LLVoiceClient::getVoiceEnabled(const LLUUID& id)
+bool LLVoiceClient::getVoiceEnabled(const LLUUID& id) const
{
return isParticipant(id);
}
-std::string LLVoiceClient::getDisplayName(const LLUUID& id)
+std::string LLVoiceClient::getDisplayName(const LLUUID& id) const
{
#if __FreeBSD__
return LLVivoxVoiceClient::getInstance()->getDisplayName(id);
@@ -897,9 +895,15 @@ void LLVoiceClient::addObserver(LLVoiceClientStatusObserver* observer)
void LLVoiceClient::removeObserver(LLVoiceClientStatusObserver* observer)
{
- LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+ if (LLVivoxVoiceClient::instanceExists())
+ {
+ LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+ }
#if !__FreeBSD__
- LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
+ if (LLWebRTCVoiceClient::instanceExists())
+ {
+ LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
+ }
#endif
}
@@ -913,9 +917,15 @@ void LLVoiceClient::addObserver(LLFriendObserver* observer)
void LLVoiceClient::removeObserver(LLFriendObserver* observer)
{
- LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+ if (LLVivoxVoiceClient::instanceExists())
+ {
+ LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+ }
#if !__FreeBSD__
- LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
+ if (LLWebRTCVoiceClient::instanceExists())
+ {
+ LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
+ }
#endif
}
@@ -929,9 +939,15 @@ void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer)
void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer)
{
- LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+ if (LLVivoxVoiceClient::instanceExists())
+ {
+ LLVivoxVoiceClient::getInstance()->removeObserver(observer);
+ }
#if !__FreeBSD__
- LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
+ if (LLWebRTCVoiceClient::instanceExists())
+ {
+ LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
+ }
#endif
}