diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-11-27 13:34:24 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-11-27 13:34:24 +0200 |
commit | e88219b5e363f9535ac1193b2041da35ba5dd702 (patch) | |
tree | 79373615380051a32d75ac37e857e02e40d2fb17 /indra/newview/llcallfloater.cpp | |
parent | 8b802a69c7c836e179336576df9de04a9cad5de3 (diff) |
Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel))
-- improved logic to update Participant List for session. Now it uses current voice channel.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 57 |
1 files changed, 47 insertions, 10 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 4a24b558c9..17d59f86bb 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -73,25 +73,62 @@ BOOL LLCallFloater::postBuild() } // virtual -void LLCallFloater::onOpen(const LLSD& key) +void LLCallFloater::onOpen(const LLSD& /*key*/) { - // by default let show nearby chat participants - mSpeakerManager = LLLocalSpeakerMgr::getInstance(); + updateSession(); +} + +////////////////////////////////////////////////////////////////////////// +/// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// +void LLCallFloater::updateSession() +{ + LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + if (voice_channel) + { + lldebugs << "Current voice channel: " << voice_channel->getSessionID() << llendl; + + if (mSpeakerManager && voice_channel->getSessionID() == mSpeakerManager->getSessionID()) + { + lldebugs << "Speaker manager is already set for session: " << voice_channel->getSessionID() << llendl; + return; + } + else + { + mSpeakerManager = NULL; + } + } + + const LLUUID& session_id = voice_channel->getSessionID(); + lldebugs << "Set speaker manager for session: " << session_id << llendl; - const LLUUID& session_id = key.asUUID(); LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); if (im_session) { mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id); } - delete mPaticipants; - mAvatarList->clear(); - mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, false); + if (NULL == mSpeakerManager) + { + setDefaultSession(); + } + + refreshPartisipantList(); } -////////////////////////////////////////////////////////////////////////// -/// PRIVATE SECTION -////////////////////////////////////////////////////////////////////////// +void LLCallFloater::setDefaultSession() +{ + // by default let show nearby chat participants + mSpeakerManager = LLLocalSpeakerMgr::getInstance(); + lldebugs << "Set DEFAULT speaker manager" << llendl; +} +void LLCallFloater::refreshPartisipantList() +{ + delete mPaticipants; + mAvatarList->clear(); + + bool is_local_chat_session = LLLocalSpeakerMgr::getInstance() == mSpeakerManager; + mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, is_local_chat_session); +} //EOF |