summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2009-11-27 13:34:24 +0200
committerMike Antipov <mantipov@productengine.com>2009-11-27 13:34:24 +0200
commite88219b5e363f9535ac1193b2041da35ba5dd702 (patch)
tree79373615380051a32d75ac37e857e02e40d2fb17
parent8b802a69c7c836e179336576df9de04a9cad5de3 (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
-rw-r--r--indra/newview/llcallfloater.cpp57
-rw-r--r--indra/newview/llcallfloater.h4
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp2
3 files changed, 52 insertions, 11 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
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index 0b86a6ee92..db33f17839 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -60,6 +60,10 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
+private:
+ void updateSession();
+ void setDefaultSession();
+ void refreshPartisipantList();
private:
LLSpeakerMgr* mSpeakerManager;
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index 741f42f9d5..405c95fc22 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -60,7 +60,7 @@ void LLPanelChatControlPanel::onEndCallButtonClicked()
void LLPanelChatControlPanel::onOpenVoiceControlsClicked()
{
- LLFloaterReg::showInstance("voice_controls", getSessionId());
+ LLFloaterReg::showInstance("voice_controls");
}
void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state)