From 0bf77e227553eee4221cda5ddbe937399f6f61bb Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 28 Dec 2009 17:21:13 +0200 Subject: Work on low task EXT-3682 (Dedicated icon is required for AvaLine callers in the VCP) -- refactored processing of voice participants in the "Voice control panel". Now list is filled only when voice channel is in CONNECTED state and is cleared otherwise. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 85 +++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 24 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1b4c274bfb..8a8bab6ab8 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -48,6 +48,7 @@ #include "llparticipantlist.h" #include "llspeakers.h" #include "lltransientfloatermgr.h" +#include "llvoicechannel.h" static void get_voice_participants_uuids(std::vector& speakers_uuids); @@ -99,6 +100,8 @@ BOOL LLCallFloater::LLAvatarListItemRemoveTimer::tick() return TRUE; } +LLVoiceChannel* LLCallFloater::sCurrentVoiceCanel = NULL; + LLCallFloater::LLCallFloater(const LLSD& key) : LLDockableFloater(NULL, false, key) , mSpeakerManager(NULL) @@ -128,6 +131,7 @@ LLCallFloater::~LLCallFloater() mParticipants = NULL; mAvatarListRefreshConnection.disconnect(); + mVoiceChannelStateChangeConnection.disconnect(); // Don't use LLVoiceClient::getInstance() here // singleton MAY have already been destroyed. @@ -148,6 +152,7 @@ BOOL LLCallFloater::postBuild() childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); mNonAvatarCaller = getChild("non_avatar_caller"); + mNonAvatarCaller->setVisible(FALSE); LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_panel"); @@ -157,8 +162,8 @@ BOOL LLCallFloater::postBuild() initAgentData(); - // update list for current session - updateSession(); + + connectToChannel(LLVoiceChannel::getCurrentVoiceChannel()); return TRUE; } @@ -306,17 +311,6 @@ void LLCallFloater::updateSession() void LLCallFloater::refreshParticipantList() { - // lets forget states from the previous session - // for timers... - resetVoiceRemoveTimers(); - - // ...and for speaker state - mSpeakerStateMap.clear(); - - delete mParticipants; - mParticipants = NULL; - mAvatarList->clear(); - bool non_avatar_caller = false; if (VC_PEER_TO_PEER == mVoiceType) { @@ -361,21 +355,19 @@ void LLCallFloater::onAvatarListRefreshed() } } +// static void LLCallFloater::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) { - // Don't update participant list if no channel info is available. - // Fix for ticket EXT-3427 - // @see LLParticipantList::~LLParticipantList() - if(LLVoiceChannel::getCurrentVoiceChannel() && - LLVoiceChannel::STATE_NO_CHANNEL_INFO == LLVoiceChannel::getCurrentVoiceChannel()->getState()) - { - return; - } + LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel(); + + // *NOTE: if signal was sent for voice channel with LLVoiceChannel::STATE_NO_CHANNEL_INFO + // it sill be sent for the same channel again (when state is changed). + // So, lets ignore this call. + if (channel == sCurrentVoiceCanel) return; + LLCallFloater* call_floater = LLFloaterReg::getTypedInstance("voice_controls"); - // Forget speaker manager from the previous session to avoid using it after session was destroyed. - call_floater->mSpeakerManager = NULL; - call_floater->updateSession(); + call_floater->connectToChannel(channel); } void LLCallFloater::updateTitle() @@ -721,4 +713,49 @@ bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) return std::find(speakers.begin(), speakers.end(), speaker_id) != speakers.end(); } +void LLCallFloater::connectToChannel(LLVoiceChannel* channel) +{ + mVoiceChannelStateChangeConnection.disconnect(); + + sCurrentVoiceCanel = channel; + + mVoiceChannelStateChangeConnection = sCurrentVoiceCanel->setStateChangedCallback(boost::bind(&LLCallFloater::onVoiceChannelStateChanged, this, _1, _2)); + + updateState(channel->getState()); +} + +void LLCallFloater::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) +{ + updateState(new_state); +} + +void LLCallFloater::updateState(const LLVoiceChannel::EState& new_state) +{ + LL_DEBUGS("Voice") << "Updating state: " << new_state << ", session name: " << sCurrentVoiceCanel->getSessionName() << LL_ENDL; + if (LLVoiceChannel::STATE_CONNECTED == new_state) + { + updateSession(); + } + else + { + reset(); + } +} + +void LLCallFloater::reset() +{ + // lets forget states from the previous session + // for timers... + resetVoiceRemoveTimers(); + + // ...and for speaker state + mSpeakerStateMap.clear(); + + delete mParticipants; + mParticipants = NULL; + mAvatarList->clear(); + + mSpeakerManager = NULL; +} + //EOF -- cgit v1.2.3 From 2acc694f2193e64d0665aa904dfec6cf532c8efb Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 28 Dec 2009 17:41:08 +0200 Subject: Work on low task EXT-3682 (Dedicated icon is required for AvaLine callers in the VCP) -- updated processing of "Loading" state while switching between voice sessions. ("Loading..." is shown until channel is in CONNECTED state) --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 8a8bab6ab8..f9e3a3da36 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -755,6 +755,11 @@ void LLCallFloater::reset() mParticipants = NULL; mAvatarList->clear(); + // update floater to show Loading while waiting for data. + mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); + mAvatarList->setVisible(TRUE); + mNonAvatarCaller->setVisible(FALSE); + mSpeakerManager = NULL; } -- cgit v1.2.3 From 79fba14bd4ba88dfe71546f5f679ed79fdeff66a Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 28 Dec 2009 18:14:27 +0200 Subject: Code cleanup: Updated method name. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index f9e3a3da36..44108fa0ca 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -618,16 +618,16 @@ void LLCallFloater::setState(LLAvatarListItem* item, ESpeakerState state) switch (state) { case STATE_INVITED: - item->setStyle(LLAvatarListItem::IS_VOICE_INVITED); + item->setState(LLAvatarListItem::IS_VOICE_INVITED); break; case STATE_JOINED: removeVoiceRemoveTimer(item->getAvatarId()); - item->setStyle(LLAvatarListItem::IS_VOICE_JOINED); + item->setState(LLAvatarListItem::IS_VOICE_JOINED); break; case STATE_LEFT: { setVoiceRemoveTimer(item->getAvatarId()); - item->setStyle(LLAvatarListItem::IS_VOICE_LEFT); + item->setState(LLAvatarListItem::IS_VOICE_LEFT); } break; default: -- cgit v1.2.3 From a9453573d2d510ad6db875acbee08539d02d9cbd Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 29 Dec 2009 16:18:51 +0200 Subject: Fixed normal bug (EXT-3356) Dock Voice control panel to Speak button chevron, not to middle of Speak button. - Changed VCP docking anchor to the right segment of the Speak button. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 44108fa0ca..b988af3b50 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -154,7 +154,7 @@ BOOL LLCallFloater::postBuild() mNonAvatarCaller = getChild("non_avatar_caller"); mNonAvatarCaller->setVisible(FALSE); - LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_panel"); + LLView *anchor_panel = LLBottomTray::getInstance()->getChild("right"); setDockControl(new LLDockControl( anchor_panel, this, -- cgit v1.2.3 From f669b484ac1c18c8a18aecb7890419c5768a0a04 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 29 Dec 2009 16:40:17 +0200 Subject: Fixed low bug EXT-3677 (Resident doesn't appear in the nearby voice list after enabling voice) -- made participant dimmed for a few seconds before disappearing --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index b988af3b50..651dac6635 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -565,23 +565,15 @@ void LLCallFloater::updateParticipantsVoiceState() // HAS LEFT the call. if ((getState(participant_id) == STATE_JOINED)) { - if (mVoiceType == VC_LOCAL_CHAT) + setState(item, STATE_LEFT); + + LLPointer speaker = mSpeakerManager->findSpeaker(item->getAvatarId()); + if (speaker.isNull()) { - // Don't display avatars that aren't in our nearby chat range anymore as "left". Remove them immediately. - removeVoiceLeftParticipant(participant_id); + continue; } - else - { - setState(item, STATE_LEFT); - LLPointer speaker = mSpeakerManager->findSpeaker(item->getAvatarId()); - if (speaker.isNull()) - { - continue; - } - - speaker->mHasLeftCurrentCall = TRUE; - } + speaker->mHasLeftCurrentCall = TRUE; } // If an avatarID is not found in a speakers list from VoiceClient and // a panel with this ID has a LEFT status this means that this person -- cgit v1.2.3 From a395edd9a08406526a09dcda6e14d3d3c9542985 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 29 Dec 2009 17:00:41 +0200 Subject: (EXT-3356) Dock Voice control panel to Speak button chevron, not to middle of Speak button. - Renamed Speak button parts in XML to avoid widget names confusion. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 651dac6635..334bdd14b4 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -154,7 +154,7 @@ BOOL LLCallFloater::postBuild() mNonAvatarCaller = getChild("non_avatar_caller"); mNonAvatarCaller->setVisible(FALSE); - LLView *anchor_panel = LLBottomTray::getInstance()->getChild("right"); + LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_flyout_btn"); setDockControl(new LLDockControl( anchor_panel, this, -- cgit v1.2.3 From b798a63d120dcfe4751d0bb56f6a2fcaafdd9966 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 29 Dec 2009 17:49:35 +0200 Subject: Fixed nice-to-have bug EXT-3706 - Redundant spacing in the voice controls panel. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 97 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 334bdd14b4..89c62b52a3 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -48,6 +48,7 @@ #include "llparticipantlist.h" #include "llspeakers.h" #include "lltransientfloatermgr.h" +#include "llviewerwindow.h" #include "llvoicechannel.h" static void get_voice_participants_uuids(std::vector& speakers_uuids); @@ -216,6 +217,15 @@ void LLCallFloater::onChange() } } +S32 LLCallFloater::notifyParent(const LLSD& info) +{ + if("size_changes" == info["action"]) + { + reshapeToFitContent(); + return 1; + } + return LLDockableFloater::notifyParent(info); +} ////////////////////////////////////////////////////////////////////////// /// PRIVATE SECTION @@ -755,4 +765,91 @@ void LLCallFloater::reset() mSpeakerManager = NULL; } +void reshape_floater(LLCallFloater* floater, S32 delta_height) +{ + // Try to update floater top side if it is docked(to bottom bar). + // Try to update floater bottom side or top side if it is un-docked. + // If world rect is too small, floater will not be reshaped at all. + + LLRect floater_rect = floater->getRect(); + LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); + + // floater is docked to bottom bar + if(floater->isDocked()) + { + // can update floater top side + if(floater_rect.mTop + delta_height < world_rect.mTop) + { + floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height, + floater_rect.mRight, floater_rect.mBottom); + } + } + // floater is un-docked + else + { + // can update floater bottom side + if( floater_rect.mBottom - delta_height >= world_rect.mBottom ) + { + floater_rect.set(floater_rect.mLeft, floater_rect.mTop, + floater_rect.mRight, floater_rect.mBottom - delta_height); + } + // could not update floater bottom side, check if we can update floater top side + else if( floater_rect.mTop + delta_height < world_rect.mTop ) + { + floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height, + floater_rect.mRight, floater_rect.mBottom); + } + } + + floater->reshape(floater_rect.getWidth(), floater_rect.getHeight()); + floater->setRect(floater_rect); +} + +void LLCallFloater::reshapeToFitContent() +{ + const S32 ITEM_HEIGHT = getParticipantItemHeight(); + static const S32 MAX_VISIBLE_ITEMS = getMaxVisibleItems(); + + static S32 items_pad = mAvatarList->getItemsPad(); + S32 list_height = mAvatarList->getRect().getHeight(); + S32 items_height = mAvatarList->getItemsRect().getHeight(); + if(items_height <= 0) + { + // make "no one near" text visible + items_height = ITEM_HEIGHT + items_pad; + } + S32 max_list_height = MAX_VISIBLE_ITEMS * ITEM_HEIGHT + items_pad * (MAX_VISIBLE_ITEMS - 1); + max_list_height += 2* mAvatarList->getBorderWidth(); + + S32 delta = items_height - list_height; + // too many items, don't reshape floater anymore, let scroll bar appear. + if(items_height > max_list_height) + { + delta = max_list_height - list_height; + } + + reshape_floater(this, delta); +} + +S32 LLCallFloater::getParticipantItemHeight() +{ + std::vector items; + mAvatarList->getItems(items); + if(items.size() > 0) + { + return items[0]->getRect().getHeight(); + } + else + { + return getChild("non_avatar_caller")->getRect().getHeight(); + } +} + +S32 LLCallFloater::getMaxVisibleItems() +{ + S32 value = 5; // default value, in case convertToS32() fails. + LLStringUtil::convertToS32(getString("max_visible_items"), value); + return value; +} + //EOF -- cgit v1.2.3 From 6a4ec2873fb3e518a2428071a37d9116ba5dccc4 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 29 Dec 2009 17:55:20 +0200 Subject: =?UTF-8?q?fixed=20EXT-3742=20=E2=80=9CVoice=20Control=20Panel=20s?= =?UTF-8?q?hould=20auto-hide=E2=80=9D,=20made=20VCP=20as=20transient=20doc?= =?UTF-8?q?kable=20floater;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 334bdd14b4..56911562e4 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -103,7 +103,7 @@ BOOL LLCallFloater::LLAvatarListItemRemoveTimer::tick() LLVoiceChannel* LLCallFloater::sCurrentVoiceCanel = NULL; LLCallFloater::LLCallFloater(const LLSD& key) -: LLDockableFloater(NULL, false, key) +: LLTransientDockableFloater(NULL, false, key) , mSpeakerManager(NULL) , mParticipants(NULL) , mAvatarList(NULL) @@ -145,7 +145,7 @@ LLCallFloater::~LLCallFloater() // virtual BOOL LLCallFloater::postBuild() { - LLDockableFloater::postBuild(); + LLTransientDockableFloater::postBuild(); mAvatarList = getChild("speakers_list"); mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLCallFloater::onAvatarListRefreshed, this)); @@ -197,7 +197,7 @@ void LLCallFloater::draw() if (mParticipants) mParticipants->updateRecentSpeakersOrder(); - LLDockableFloater::draw(); + LLTransientDockableFloater::draw(); } // virtual -- cgit v1.2.3