From eb02d77ff5d20b99cc35fe9082cf5a22f634a7e1 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 4 Nov 2009 21:33:14 +0200 Subject: 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 --- indra/newview/llpanelimcontrolpanel.cpp | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') 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); -- cgit v1.2.3 From 8c27615aa5c1fc61fa0a5877717699d5df47476d Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 4 Nov 2009 22:17:23 +0200 Subject: Implemented normal sub-task EXT-2144 (IM P2p control panel should contain avatar name under avatar icon aligned to the left side) --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 80b29c4fa7..76612f2dd1 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -123,6 +123,8 @@ BOOL LLPanelIMControlPanel::postBuild() childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); + + return LLPanelChatControlPanel::postBuild(); } @@ -166,6 +168,9 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) getChild("avatar_icon")->setValue(mAvatarID); + // Fetch the currect name + gCacheName->get(mAvatarID, FALSE, boost::bind(&LLPanelIMControlPanel::nameUpdatedCallback, this, _1, _2, _3, _4)); + llwarns << "gCacheName->get" << llendl; // Disable profile button if participant is not realy SL avatar LLIMModel::LLIMSession* im_session = im_model.findIMSession(session_id); @@ -173,6 +178,19 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) childSetEnabled("view_profile_btn", FALSE); } +void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +{ + llwarns << "LLPanelIMControlPanel::nameUpdatedCallback" << llendl; + if ( id == mAvatarID ) + { + llwarns << "LLPanelIMControlPanel::nameUpdatedCallback id == mAvatarID" << llendl; + std::string avatar_name; + avatar_name.assign(first); + avatar_name.append(" "); + avatar_name.append(last); + getChild("avatar_name")->setValue(avatar_name); + } +} LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id) { -- cgit v1.2.3 From 15df55ecafd2f6d72f25988401ddb7ed58030b79 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 4 Nov 2009 22:37:46 +0200 Subject: No ticket, removed unnecessary warnings from 3d35bc1f0cc6 commit. --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 76612f2dd1..c9168670d5 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -170,7 +170,7 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) // Fetch the currect name gCacheName->get(mAvatarID, FALSE, boost::bind(&LLPanelIMControlPanel::nameUpdatedCallback, this, _1, _2, _3, _4)); - llwarns << "gCacheName->get" << llendl; + // Disable profile button if participant is not realy SL avatar LLIMModel::LLIMSession* im_session = im_model.findIMSession(session_id); @@ -180,10 +180,8 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { - llwarns << "LLPanelIMControlPanel::nameUpdatedCallback" << llendl; if ( id == mAvatarID ) { - llwarns << "LLPanelIMControlPanel::nameUpdatedCallback id == mAvatarID" << llendl; std::string avatar_name; avatar_name.assign(first); avatar_name.append(" "); -- cgit v1.2.3