From d5a0fd7997352c80273ccb172a40250204ee0b34 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 23 Feb 2010 13:20:43 +0200 Subject: Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat Window, when Speakers are in Spatial Chat Only) - updated interfaces of LLSpeakingIndicatorManager::registerSpeakingIndicator & LLOutputMonitorCtrl::setSpeakerId to take a target session id for which registered indicator should be shown. --HG-- branch : product-engine --- indra/newview/lloutputmonitorctrl.cpp | 2 +- indra/newview/lloutputmonitorctrl.h | 10 +++++++++- indra/newview/llspeakingindicatormanager.cpp | 14 ++++++++++---- indra/newview/llspeakingindicatormanager.h | 6 +++++- 4 files changed, 25 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 9857e37bc3..f2253f89aa 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -247,7 +247,7 @@ void LLOutputMonitorCtrl::draw() gl_rect_2d(0, monh, monw, 0, sColorBound, FALSE); } -void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id) +void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/) { if (speaker_id.isNull() && mSpeakerId.notNull()) { diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 2bbfa251e9..b7454a5066 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -86,7 +86,15 @@ public: void setIsTalking(bool val) { mIsTalking = val; } - void setSpeakerId(const LLUUID& speaker_id); + /** + * Sets avatar UUID to interact with voice channel. + * + * @param speaker_id LLUUID of an avatar whose voice level is displayed. + * @param session_id session UUID for which indicator should be shown only. Passed to LLSpeakingIndicatorManager + * If this parameter is set registered indicator will be shown only in voice channel + * which has the same session id (EXT-5562). + */ + void setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null); //called by mute list virtual void onChange(); diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index d33c050ee4..74b45217d3 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -65,8 +65,12 @@ public: * * @param speaker_id LLUUID of an avatar whose speaking indicator is registered. * @param speaking_indicator instance of the speaking indicator to be registered. + * @param session_id session UUID for which indicator should be shown only. + * If this parameter is set registered indicator will be shown only in voice channel + * which has the same session id (EXT-5562). */ - void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); + void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator, + const LLUUID& session_id = LLUUID::null); /** * Removes passed speaking indicator from observing. @@ -138,7 +142,8 @@ private: ////////////////////////////////////////////////////////////////////////// // PUBLIC SECTION ////////////////////////////////////////////////////////////////////////// -void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) +void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator, + const LLUUID& session_id) { // do not exclude agent's indicators. They should be processed in the same way as others. See EXT-3889. @@ -274,9 +279,10 @@ void SpeakingIndicatorManager::ensureInstanceDoesNotExist(LLSpeakingIndicator* c /* LLSpeakingIndicatorManager namespace implementation */ /************************************************************************/ -void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) +void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator, + const LLUUID& session_id/* = LLUUID::null*/) { - SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator); + SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator, session_id); } void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator) diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h index ce0158f7d8..cd72b85bfd 100644 --- a/indra/newview/llspeakingindicatormanager.h +++ b/indra/newview/llspeakingindicatormanager.h @@ -52,8 +52,12 @@ namespace LLSpeakingIndicatorManager * * @param speaker_id LLUUID of an avatar whose speaker indicator is registered. * @param speaking_indicator instance of the speaker indicator to be registered. + * @param session_id session UUID for which indicator should be shown only. + * If this parameter is set registered indicator will be shown only in voice channel + * which has the same session id (EXT-5562). */ - void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); + void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator, + const LLUUID& session_id = LLUUID::null); /** * Removes passed speaking indicator from observing. -- cgit v1.2.3 From 1f8fb3f3bae92b9e632b8793ce4d8f59f9dfc1aa Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 23 Feb 2010 15:33:10 +0200 Subject: Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat Window, when Speakers are in Spatial Chat Only) - updated code to store target session id for which registered indicator should be shown and process it while switching indicators on. --HG-- branch : product-engine --- indra/newview/llspeakingindicatormanager.cpp | 22 +++++++++++++++++++++- indra/newview/llspeakingindicatormanager.h | 11 +++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index 74b45217d3..012e092a7f 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -152,6 +152,8 @@ void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_i ensureInstanceDoesNotExist(speaking_indicator); + speaking_indicator->setTargetSessionID(session_id); + speaking_indicator_value_t value_type(speaker_id, speaking_indicator); mSpeakingIndicators.insert(value_type); @@ -222,6 +224,13 @@ void SpeakingIndicatorManager::onChange() void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on) { + LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + LLUUID session_id; + if (voice_channel) + { + session_id = voice_channel->getSessionID(); + } + speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin(); for (; it_uuid != speakers_uuids.end(); ++it_uuid) { @@ -233,13 +242,24 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea { was_found = true; LLSpeakingIndicator* indicator = (*it_indicator).second; - indicator->switchIndicator(switch_on); + + BOOL switch_current_on = switch_on; + + // we should show indicator for specified voice session only if this is current channel. EXT-5562. + if (switch_current_on && indicator->getTargetSessionID().notNull()) + { + switch_current_on = indicator->getTargetSessionID() == session_id; + } + + indicator->switchIndicator(switch_current_on); } if (was_found) { LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL; + // *TODO: it is possible non of the registered indicators are in the target session + // we can avoid of storing such UUID in the mSwitchedIndicatorsOn map in this case. if (switch_on) { // store switched on indicator to be able switch it off diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h index cd72b85bfd..b75c65c064 100644 --- a/indra/newview/llspeakingindicatormanager.h +++ b/indra/newview/llspeakingindicatormanager.h @@ -38,7 +38,18 @@ class LLSpeakingIndicator { public: + virtual ~LLSpeakingIndicator(){} virtual void switchIndicator(bool switch_on) = 0; + void setTargetSessionID(const LLUUID& session_id) { mTargetSessionID = session_id; } + const LLUUID& getTargetSessionID() { return mTargetSessionID; } + +private: + /** + * session UUID for which indicator should be shown only. + * If it is set, registered indicator will be shown only in voice channel + * which has the same session id (EXT-5562). + */ + LLUUID mTargetSessionID; }; // See EXT-3976. -- cgit v1.2.3 From 022c433d53538350d840125de2733c639261cd4d Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 24 Feb 2010 10:59:52 +0200 Subject: Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat Window, when Speakers are in Spatial Chat Only) - implemented passing of target session UUID for which registered indicator should be shown only. --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 2 +- indra/newview/llavatarlist.h | 3 +++ indra/newview/llavatarlistitem.cpp | 4 ++-- indra/newview/llavatarlistitem.h | 2 +- indra/newview/lloutputmonitorctrl.cpp | 2 +- indra/newview/llparticipantlist.cpp | 2 ++ 6 files changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 6784e6693b..50d8672083 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -329,7 +329,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is { LLAvatarListItem* item = new LLAvatarListItem(); item->setName(name); - item->setAvatarId(id, mIgnoreOnlineStatus); + item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index aeed4fee08..0e4215e91a 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -78,6 +78,8 @@ public: bool contains(const LLUUID& id); void setContextMenu(LLAvatarListItem::ContextMenu* menu) { mContextMenu = menu; } + void setSessionID(const LLUUID& session_id) { mSessionID = session_id; } + const LLUUID& getSessionID() { return mSessionID; } void toggleIcons(); void setSpeakingIndicatorsVisible(bool visible); @@ -119,6 +121,7 @@ private: std::string mIconParamName; std::string mNameFilter; uuid_vector_t mIDs; + LLUUID mSessionID; LLAvatarListItem::ContextMenu* mContextMenu; diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 5011b191f4..9645e75e60 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -211,14 +211,14 @@ void LLAvatarListItem::setState(EItemState item_style) mAvatarIcon->setColor(item_icon_color_map[item_style]); } -void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes) +void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes) { if (mAvatarId.notNull()) LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarId, this); mAvatarId = id; mAvatarIcon->setValue(id); - mSpeakingIndicator->setSpeakerId(id); + mSpeakingIndicator->setSpeakerId(id, session_id); // We'll be notified on avatar online status changes if (!ignore_status_changes && mAvatarId.notNull()) diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 426d80e0a8..cecb64add7 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -100,7 +100,7 @@ public: void setName(const std::string& name); void setHighlight(const std::string& highlight); void setState(EItemState item_style); - void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); + void setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes = false); void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index f2253f89aa..28d24f80fd 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -263,7 +263,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& s } mSpeakerId = speaker_id; - LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this); + LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this, session_id); //mute management if (mAutoUpdate) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 1c4004c37a..2748daaffa 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -70,6 +70,8 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator"); mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); + LL_DEBUGS("SpeakingIndicator") << "Set session for speaking indicators: " << mSpeakerMgr->getSessionID() << LL_ENDL; + mAvatarList->setSessionID(mSpeakerMgr->getSessionID()); mAvatarListDoubleClickConnection = mAvatarList->setItemDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, _1)); mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2)); // Set onAvatarListDoubleClicked as default on_return action. -- cgit v1.2.3 From 2fc5956d9d65b0139549d471b48464090843fdee Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 24 Feb 2010 11:13:52 +0200 Subject: Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat Window, when Speakers are in Spatial Chat Only) -- added more log information -- session uuid can now be set only from SpeakingIndicatorManager to ensure target session is the same indicator was registered with. -- comments cleanup --HG-- branch : product-engine --- indra/newview/lloutputmonitorctrl.cpp | 2 +- indra/newview/llspeakingindicatormanager.cpp | 5 +++-- indra/newview/llspeakingindicatormanager.h | 11 +++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 28d24f80fd..9ab943de9c 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -303,7 +303,7 @@ void LLOutputMonitorCtrl::switchIndicator(bool switch_on) } // otherwise remember necessary state and mark itself as dirty. - // State will be applied i next draw when parents chain became visible. + // State will be applied in next draw when parents chain becomes visible. else { LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL; diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index 012e092a7f..3c660f4d6a 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -147,7 +147,7 @@ void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_i { // do not exclude agent's indicators. They should be processed in the same way as others. See EXT-3889. - LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << "|"<< speaking_indicator << LL_ENDL; + LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << "|"<< speaking_indicator << ", session: " << session_id << LL_ENDL; ensureInstanceDoesNotExist(speaking_indicator); @@ -249,6 +249,7 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea if (switch_current_on && indicator->getTargetSessionID().notNull()) { switch_current_on = indicator->getTargetSessionID() == session_id; + LL_DEBUGS("SpeakingIndicator") << "Session: " << session_id << ", target: " << indicator->getTargetSessionID() << ", the same? = " << switch_current_on << LL_ENDL; } indicator->switchIndicator(switch_current_on); @@ -300,7 +301,7 @@ void SpeakingIndicatorManager::ensureInstanceDoesNotExist(LLSpeakingIndicator* c /************************************************************************/ void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator, - const LLUUID& session_id/* = LLUUID::null*/) + const LLUUID& session_id) { SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator, session_id); } diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h index b75c65c064..8d7aba1d6c 100644 --- a/indra/newview/llspeakingindicatormanager.h +++ b/indra/newview/llspeakingindicatormanager.h @@ -35,15 +35,22 @@ #ifndef LL_LLSPEAKINGINDICATORMANAGER_H #define LL_LLSPEAKINGINDICATORMANAGER_H +class SpeakingIndicatorManager; + class LLSpeakingIndicator { public: virtual ~LLSpeakingIndicator(){} virtual void switchIndicator(bool switch_on) = 0; + +private: + friend class SpeakingIndicatorManager; + // Accessors for target voice session UUID. + // They are intended to be used only from SpeakingIndicatorManager to ensure target session is + // the same indicator was registered with. void setTargetSessionID(const LLUUID& session_id) { mTargetSessionID = session_id; } const LLUUID& getTargetSessionID() { return mTargetSessionID; } -private: /** * session UUID for which indicator should be shown only. * If it is set, registered indicator will be shown only in voice channel @@ -68,7 +75,7 @@ namespace LLSpeakingIndicatorManager * which has the same session id (EXT-5562). */ void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator, - const LLUUID& session_id = LLUUID::null); + const LLUUID& session_id); /** * Removes passed speaking indicator from observing. -- cgit v1.2.3 From 2ad421cef67b12fad0f854b252f9d4d4e9025fd4 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 24 Feb 2010 11:53:10 +0200 Subject: Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat Window, when Speakers are in Spatial Chat Only) Completed -- code improvements: updated condition to store really switched on indicators for future switching off. --HG-- branch : product-engine --- indra/newview/lloutputmonitorctrl.cpp | 2 +- indra/newview/llspeakingindicatormanager.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 9ab943de9c..d6d48a4ead 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -317,7 +317,7 @@ void LLOutputMonitorCtrl::switchIndicator(bool switch_on) ////////////////////////////////////////////////////////////////////////// void LLOutputMonitorCtrl::notifyParentVisibilityChanged() { - LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << " ,new_visibility: " << getVisible() << LL_ENDL; + LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << ", new_visibility: " << getVisible() << LL_ENDL; LLSD params = LLSD().with("visibility_changed", getVisible()); diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index 3c660f4d6a..cc06179481 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -238,6 +238,7 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea indicator_range_t it_range = mSpeakingIndicators.equal_range(*it_uuid); indicator_const_iterator it_indicator = it_range.first; bool was_found = false; + bool was_switched_on = false; for (; it_indicator != it_range.second; ++it_indicator) { was_found = true; @@ -251,17 +252,22 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea switch_current_on = indicator->getTargetSessionID() == session_id; LL_DEBUGS("SpeakingIndicator") << "Session: " << session_id << ", target: " << indicator->getTargetSessionID() << ", the same? = " << switch_current_on << LL_ENDL; } + was_switched_on = was_switched_on || switch_current_on; indicator->switchIndicator(switch_current_on); + } if (was_found) { LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL; - // *TODO: it is possible non of the registered indicators are in the target session - // we can avoid of storing such UUID in the mSwitchedIndicatorsOn map in this case. - if (switch_on) + if (switch_on && !was_switched_on) + { + LL_DEBUGS("SpeakingIndicator") << "but non of them where switched on" << LL_ENDL; + } + + if (was_switched_on) { // store switched on indicator to be able switch it off mSwitchedIndicatorsOn.insert(*it_uuid); -- cgit v1.2.3