summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelimcontrolpanel.cpp
diff options
context:
space:
mode:
authorEugene Kondrashev <ekondrashev@productengine.com>2009-11-04 21:33:14 +0200
committerEugene Kondrashev <ekondrashev@productengine.com>2009-11-04 21:33:14 +0200
commiteb02d77ff5d20b99cc35fe9082cf5a22f634a7e1 (patch)
tree80d2e9bb12e6633655b9fa50c52f57105cff2bc1 /indra/newview/llpanelimcontrolpanel.cpp
parentfbf314cb5593a678e337092186c0e36fed59dbab (diff)
Implemented major sub-task EXT-2131 - Output monitor contols should only be shown for Group Chat and Adhoc Chat when in a Voice Call. Added onStateChange callback support for voice channel. Added showing/hiding logic of speaking indicator.
--HG-- branch : product-engine
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);