From ff52ac089f9ed67410f80fe66d0b997f0f2dafcc Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 15 Jul 2009 21:50:42 +0000 Subject: DEV-34822 viewer 1.23 merge DEV-32649 Merge the diamondware/vivox voice code -r124876 -r125220 --- indra/newview/llcallfloater.cpp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1468f6d584..38782226d6 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -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& speakers_uuids) { // Get a list of participants from VoiceClient - LLVoiceClient::participantMap *voice_map = gVoiceClient->getParticipantList(); - if (voice_map) + std::vector participants = LLVoiceClient::getInstance()->getParticipantList(); + + for (std::vector::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::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; } } } -- cgit v1.2.3 From 114e5ca0839bace7f247a6eadb6e06a28597501d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 29 Mar 2010 16:33:35 -0400 Subject: EXT-5940 : Typedef all vector's Superficial cleanup to change all typedef std::vector to use a common typedef uuid_vec_t instead. --- indra/newview/llcallfloater.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c8552de66a..4ea3c61ab2 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -54,7 +54,7 @@ #include "llvoicechannel.h" #include "llviewerparcelmgr.h" -static void get_voice_participants_uuids(std::vector& speakers_uuids); +static void get_voice_participants_uuids(uuid_vec_t& speakers_uuids); void reshape_floater(LLCallFloater* floater, S32 delta_height); class LLNonAvatarCaller : public LLAvatarListItem @@ -213,9 +213,9 @@ void LLCallFloater::onChange() updateParticipantsVoiceState(); // Add newly joined participants. - std::vector speakers_uuids; + uuid_vec_t speakers_uuids; get_voice_participants_uuids(speakers_uuids); - for (std::vector::const_iterator it = speakers_uuids.begin(); it != speakers_uuids.end(); it++) + for (uuid_vec_t::const_iterator it = speakers_uuids.begin(); it != speakers_uuids.end(); it++) { mParticipants->addAvatarIDExceptAgent(*it); } @@ -469,7 +469,7 @@ void LLCallFloater::updateAgentModeratorState() mAgentPanel->childSetValue("user_text", name); } -static void get_voice_participants_uuids(std::vector& speakers_uuids) +static void get_voice_participants_uuids(uuid_vec_t& speakers_uuids) { // Get a list of participants from VoiceClient LLVoiceClient::participantMap *voice_map = gVoiceClient->getParticipantList(); @@ -494,7 +494,7 @@ void LLCallFloater::initParticipantsVoiceState() it_end = items.end(); - std::vector speakers_uuids; + uuid_vec_t speakers_uuids; get_voice_participants_uuids(speakers_uuids); for(; it != it_end; ++it) @@ -505,7 +505,7 @@ void LLCallFloater::initParticipantsVoiceState() LLUUID speaker_id = item->getAvatarId(); - std::vector::const_iterator speaker_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), speaker_id); + uuid_vec_t::const_iterator speaker_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), speaker_id); // If an avatarID assigned to a panel is found in a speakers list // obtained from VoiceClient we assign the JOINED status to the owner @@ -534,10 +534,10 @@ void LLCallFloater::initParticipantsVoiceState() void LLCallFloater::updateParticipantsVoiceState() { - std::vector speakers_list; + uuid_vec_t speakers_list; // Get a list of participants from VoiceClient - std::vector speakers_uuids; + uuid_vec_t speakers_uuids; get_voice_participants_uuids(speakers_uuids); // Updating the status for each participant already in list. @@ -555,7 +555,7 @@ void LLCallFloater::updateParticipantsVoiceState() const LLUUID participant_id = item->getAvatarId(); bool found = false; - std::vector::iterator speakers_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), participant_id); + uuid_vec_t::iterator speakers_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), participant_id); lldebugs << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << llendl; @@ -695,7 +695,7 @@ bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) case VC_LOCAL_CHAT: { // A nearby chat speaker is considered valid it it's known to LLVoiceClient (i.e. has enabled voice). - std::vector speakers; + uuid_vec_t speakers; get_voice_participants_uuids(speakers); is_valid = std::find(speakers.begin(), speakers.end(), speaker_id) != speakers.end(); } -- cgit v1.2.3 From 947bd994885ec59c138a2e3835b940a22ebaea1e Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 1 Apr 2010 21:07:49 -0700 Subject: Incorporate Aimees code review comments --- indra/newview/llcallfloater.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index f1b1efc2e0..25b4671f91 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -131,9 +131,7 @@ LLCallFloater::~LLCallFloater() mAvatarListRefreshConnection.disconnect(); mVoiceChannelStateChangeConnection.disconnect(); - // Don't use LLVoiceClient::getInstance() here - // singleton MAY have already been destroyed. - if(LLVoiceClient::getInstance()) + if(LLVoiceClient::instanceExists()) { LLVoiceClient::getInstance()->removeObserver(this); } -- cgit v1.2.3 From 568d6ed229e6d8a32d761482e06828ccc61209a4 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 2 Apr 2010 15:19:44 -0400 Subject: EXT-5940 : INFRASTRUCTURE: Typedef all vector's Fixed some more typedefs that I missed in first checkin. --- indra/newview/llcallfloater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 132e4f0933..df3fe522b5 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -660,8 +660,8 @@ void LLCallFloater::setVoiceRemoveTimer(const LLUUID& voice_speaker_id) bool LLCallFloater::removeVoiceLeftParticipant(const LLUUID& voice_speaker_id) { - LLAvatarList::uuid_vector_t& speaker_uuids = mAvatarList->getIDs(); - LLAvatarList::uuid_vector_t::iterator pos = std::find(speaker_uuids.begin(), speaker_uuids.end(), voice_speaker_id); + uuid_vec_t& speaker_uuids = mAvatarList->getIDs(); + uuid_vec_t::iterator pos = std::find(speaker_uuids.begin(), speaker_uuids.end(), voice_speaker_id); if(pos != speaker_uuids.end()) { speaker_uuids.erase(pos); -- cgit v1.2.3 From 0bb3f144c0a6712a269246975635962b3b5f48d0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 7 Apr 2010 10:37:07 +0100 Subject: Backed out changeset 63b699f90efd --- indra/newview/llcallfloater.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 215f1b95aa..4ea3c61ab2 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -133,9 +133,9 @@ LLCallFloater::~LLCallFloater() // Don't use LLVoiceClient::getInstance() here // singleton MAY have already been destroyed. - if(LLVoiceClient::getInstance()) + if(gVoiceClient) { - LLVoiceClient::getInstance()->removeObserver(this); + gVoiceClient->removeObserver(this); } LLTransientFloaterMgr::getInstance()->removeControlView(this); } @@ -191,7 +191,7 @@ void LLCallFloater::draw() // Seems this is a problem somewhere in Voice Client (LLVoiceClient::participantAddedEvent) // onChange(); - bool is_moderator_muted = LLVoiceClient::getInstance()->getIsModeratorMuted(gAgentID); + bool is_moderator_muted = gVoiceClient->getIsModeratorMuted(gAgentID); if (mIsModeratorMutedVoice != is_moderator_muted) { @@ -209,6 +209,7 @@ void LLCallFloater::draw() void LLCallFloater::onChange() { if (NULL == mParticipants) return; + updateParticipantsVoiceState(); // Add newly joined participants. @@ -238,11 +239,11 @@ void LLCallFloater::updateSession() LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); if (voice_channel) { - LL_DEBUGS("Voice") << "Current voice channel: " << voice_channel->getSessionID() << LL_ENDL; + lldebugs << "Current voice channel: " << voice_channel->getSessionID() << llendl; if (mSpeakerManager && voice_channel->getSessionID() == mSpeakerManager->getSessionID()) { - LL_DEBUGS("Voice") << "Speaker manager is already set for session: " << voice_channel->getSessionID() << LL_ENDL; + lldebugs << "Speaker manager is already set for session: " << voice_channel->getSessionID() << llendl; return; } else @@ -252,6 +253,7 @@ void LLCallFloater::updateSession() } const LLUUID& session_id = voice_channel ? voice_channel->getSessionID() : LLUUID::null; + lldebugs << "Set speaker manager for session: " << session_id << llendl; LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); if (im_session) @@ -291,7 +293,7 @@ void LLCallFloater::updateSession() { // by default let show nearby chat participants mSpeakerManager = LLLocalSpeakerMgr::getInstance(); - LL_DEBUGS("Voice") << "Set DEFAULT speaker manager" << LL_ENDL; + lldebugs << "Set DEFAULT speaker manager" << llendl; mVoiceType = VC_LOCAL_CHAT; } @@ -470,15 +472,16 @@ void LLCallFloater::updateAgentModeratorState() static void get_voice_participants_uuids(uuid_vec_t& speakers_uuids) { // Get a list of participants from VoiceClient - std::set participants; - LLVoiceClient::getInstance()->getParticipantList(participants); - - for (std::set::const_iterator iter = participants.begin(); - iter != participants.end(); ++iter) + LLVoiceClient::participantMap *voice_map = gVoiceClient->getParticipantList(); + if (voice_map) { - speakers_uuids.push_back(*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); + } } - } void LLCallFloater::initParticipantsVoiceState() @@ -554,7 +557,7 @@ void LLCallFloater::updateParticipantsVoiceState() uuid_vec_t::iterator speakers_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), participant_id); - LL_DEBUGS("Voice") << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << LL_ENDL; + lldebugs << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << llendl; // If an avatarID assigned to a panel is found in a speakers list // obtained from VoiceClient we assign the JOINED status to the owner @@ -724,7 +727,7 @@ void LLCallFloater::connectToChannel(LLVoiceChannel* channel) void LLCallFloater::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { // check is voice operational and if it doesn't work hide VCP (EXT-4397) - if(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()) + if(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking()) { updateState(new_state); } -- cgit v1.2.3