From b8cb1e4f50b209a018b27d3d2d8e24af61aeb6e1 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 27 Nov 2009 14:53:46 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- implemented refreshing of the participant list when Voice Channel is changed --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 22 +++++++++++++--------- indra/newview/llcallfloater.h | 12 +++++++++++- 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c8d50ceb10..b41f962ffa 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -69,13 +69,17 @@ BOOL LLCallFloater::postBuild() anchor_panel, this, getDockTongue(), LLDockControl::TOP)); + // update list for current session + updateSession(); + + // subscribe to to be notified Voice Channel is changed + LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1)); return TRUE; } // virtual void LLCallFloater::onOpen(const LLSD& /*key*/) { - updateSession(); } ////////////////////////////////////////////////////////////////////////// @@ -110,19 +114,14 @@ void LLCallFloater::updateSession() if (NULL == mSpeakerManager) { - setDefaultSession(); + // by default let show nearby chat participants + mSpeakerManager = LLLocalSpeakerMgr::getInstance(); + lldebugs << "Set DEFAULT speaker manager" << llendl; } refreshPartisipantList(); } -void LLCallFloater::setDefaultSession() -{ - // by default let show nearby chat participants - mSpeakerManager = LLLocalSpeakerMgr::getInstance(); - lldebugs << "Set DEFAULT speaker manager" << llendl; -} - void LLCallFloater::refreshPartisipantList() { delete mPaticipants; @@ -131,4 +130,9 @@ void LLCallFloater::refreshPartisipantList() bool do_not_use_context_menu_in_local_chat = LLLocalSpeakerMgr::getInstance() != mSpeakerManager; mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, do_not_use_context_menu_in_local_chat); } + +void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/) +{ + updateSession(); +} //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index db33f17839..bfaa1075c4 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -61,9 +61,19 @@ public: /*virtual*/ void onOpen(const LLSD& key); private: + /** + * Updates mSpeakerManager and list according to current Voice Channel + * + * It compares mSpeakerManager & current Voice Channel session IDs. + * If they are different gets Speaker manager related to current channel and updates channel participant list. + */ void updateSession(); - void setDefaultSession(); + + /** + * Refreshes participant list according to current Voice Channel + */ void refreshPartisipantList(); + void onCurrentChannelChanged(const LLUUID& session_id); private: LLSpeakerMgr* mSpeakerManager; -- cgit v1.2.3