summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelimcontrolpanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelimcontrolpanel.cpp')
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index 21e88b6d07..80b29c4fa7 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -59,6 +59,14 @@ void LLPanelChatControlPanel::onOpenVoiceControlsClicked()
// TODO: implement Voice Control Panel opening
}
+void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state)
+{
+ bool is_call_started = ( new_state >= LLVoiceChannel::STATE_CALL_STARTED );
+ childSetVisible("end_call_btn", is_call_started);
+ childSetVisible("voice_ctrls_btn", is_call_started);
+ childSetVisible("call_btn", ! is_call_started);
+}
+
BOOL LLPanelChatControlPanel::postBuild()
{
childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this));
@@ -76,15 +84,6 @@ void LLPanelChatControlPanel::draw()
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId);
if (!session) return;
- LLVoiceChannel* voice_channel = session->mVoiceChannel;
- if (voice_channel && voice_enabled)
- {
- bool is_call_started = ( voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED );
- childSetVisible("end_call_btn", is_call_started);
- childSetVisible("voice_ctrls_btn", is_call_started);
- childSetVisible("call_btn", ! is_call_started);
- }
-
bool session_initialized = session->mSessionInitialized;
bool callback_enabled = session->mCallBackEnabled;
LLViewerRegion* region = gAgent.getRegion();
@@ -98,6 +97,15 @@ void LLPanelChatControlPanel::draw()
LLPanel::draw();
}
+void LLPanelChatControlPanel::setSessionId(const LLUUID& session_id)
+{
+ //Method is called twice for AdHoc and Group chat. Second time when server init reply received
+ mSessionId = session_id;
+ LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionId);
+ if(voice_channel)
+ voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2));
+}
+
LLPanelIMControlPanel::LLPanelIMControlPanel()
{
}
@@ -214,6 +222,12 @@ void LLPanelGroupControlPanel::onSortMenuItemClicked(const LLSD& userdata)
}
+void LLPanelGroupControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state)
+{
+ LLPanelChatControlPanel::onVoiceChannelStateChanged(old_state, new_state);
+ mAvatarList->setSpeakingIndicatorsVisible(new_state >= LLVoiceChannel::STATE_CALL_STARTED);
+}
+
void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id)
{
LLPanelChatControlPanel::setSessionId(session_id);