summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-11-15 18:07:57 -0800
committerMerov Linden <merov@lindenlab.com>2012-11-15 18:07:57 -0800
commitec5d1e48c4071500400b885e5893373bab0e3d99 (patch)
tree25d879b78fd415ec5271f1948f49718c4cdd072a /indra/newview
parentbd62d1d33717536e71f5fbb5ab4a477a69494c77 (diff)
CHUI-479 : WIP : Introduce a publicly available LLSpeakingIndicatorManager::updateSpeakingIndicators() method so to reset all indicators when creating new dialogs.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llconversationview.cpp25
-rw-r--r--indra/newview/lloutputmonitorctrl.cpp5
-rw-r--r--indra/newview/llspeakingindicatormanager.cpp28
-rw-r--r--indra/newview/llspeakingindicatormanager.h5
4 files changed, 35 insertions, 28 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index cc7a76e353..d971c943f0 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -307,7 +307,9 @@ void LLConversationViewSession::refresh()
mSessionTitle->setText(vmi->getDisplayName());
}
- // Note: for the moment, all that needs to be done is done by LLFolderViewItem::refresh()
+ // Update all speaking indicators
+ llinfos << "Merov debug : LLConversationViewSession::refresh, updateSpeakingIndicators" << llendl;
+ LLSpeakingIndicatorManager::updateSpeakingIndicators();
// Do the regular upstream refresh
LLFolderViewFolder::refresh();
@@ -327,7 +329,6 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi
mSpeakingIndicator->setSpeakerId(is_active ? gAgentID : LLUUID::null);
}
- llinfos << "Merov debug : onCurrentVoiceSessionChanged, switchIndicator is_active = " << is_active << llendl;
mSpeakingIndicator->switchIndicator(is_active);
mCallIconLayoutPanel->setVisible(is_active);
}
@@ -456,34 +457,32 @@ void LLConversationViewParticipant::onCurrentVoiceSessionChanged(const LLUUID& s
{
llinfos << "Merov debug : onCurrentVoiceSessionChanged begin, uuid = " << mUUID << ", session_id = " << session_id << llendl;
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
- //llinfos << "Merov debug : onCurrentVoiceSessionChanged participant_model = " << participant_model << llendl;
if (participant_model)
{
- //llinfos << "Merov debug : onCurrentVoiceSessionChanged enter if 1" << llendl;
LLConversationItemSession* parent_session = participant_model->getParentSession();
- //llinfos << "Merov debug : onCurrentVoiceSessionChanged parent_session = " << parent_session << llendl;
if (parent_session)
{
- //llinfos << "Merov debug : onCurrentVoiceSessionChanged enter if 2" << llendl;
bool is_active = (parent_session->getUUID() == session_id);
- //llinfos << "Merov debug : onCurrentVoiceSessionChanged, is_active = " << is_active << llendl;
mSpeakingIndicator->switchIndicator(is_active);
- //llinfos << "Merov debug : onCurrentVoiceSessionChanged switchIndicator done" << llendl;
}
}
- //llinfos << "Merov debug : onCurrentVoiceSessionChanged end" << llendl;
}
void LLConversationViewParticipant::refresh()
{
// Refresh the participant view from its model data
- LLConversationItemParticipant* vmi = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
- vmi->resetRefresh();
+ LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
+ participant_model->resetRefresh();
// *TODO: We should also do something with vmi->isModerator() to echo that state in the UI somewhat
- mSpeakingIndicator->setIsMuted(vmi->isMuted());
- //mSpeakingIndicator->switchIndicator(true);
+ mSpeakingIndicator->setIsMuted(participant_model->isMuted());
+ //LLConversationItemSession* parent_session = participant_model->getParentSession();
+ //if (parent_session)
+ //{
+ // bool is_active = (parent_session->getUUID() == session_id);
+ // mSpeakingIndicator->switchIndicator(is_active);
+ //}
// Do the regular upstream refresh
LLFolderViewItem::refresh();
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index 063b90e76b..536f1fbd73 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -346,11 +346,6 @@ void LLOutputMonitorCtrl::onChange()
void LLOutputMonitorCtrl::switchIndicator(bool switch_on)
{
llinfos << "Merov debug : switchIndicator, mSpeakerId = " << mSpeakerId << ", switch_on = " << switch_on << llendl;
- bool test_on = (mSpeakerId == test_uuid);
- if (test_on && !switch_on)
- {
- llinfos << "Merov debug : switching agent off!" << llendl;
- }
// ensure indicator is visible in case it is not in visible chain
// to be called when parent became visible next time to notify parent that visibility is changed.
setVisible(TRUE);
diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp
index 752218c776..d9f9ed5966 100644
--- a/indra/newview/llspeakingindicatormanager.cpp
+++ b/indra/newview/llspeakingindicatormanager.cpp
@@ -74,6 +74,16 @@ public:
*/
void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator);
+ /**
+ * Callback of changing voice participant list (from LLVoiceClientParticipantObserver).
+ *
+ * Switches off indicators had been switched on and switches on indicators of current participants list.
+ * There is only a few indicators in lists should be switched off/on.
+ * So, method does not calculate difference between these list it only switches off already
+ * switched on indicators and switches on indicators of voice channel participants
+ */
+ void onParticipantsChanged();
+
private:
typedef std::set<LLUUID> speaker_ids_t;
typedef std::multimap<LLUUID, LLSpeakingIndicator*> speaking_indicators_mmap_t;
@@ -94,16 +104,6 @@ private:
void sOnCurrentChannelChanged(const LLUUID& session_id);
/**
- * Callback of changing voice participant list (from LLVoiceClientParticipantObserver).
- *
- * Switches off indicators had been switched on and switches on indicators of current participants list.
- * There is only a few indicators in lists should be switched off/on.
- * So, method does not calculate difference between these list it only switches off already
- * switched on indicators and switches on indicators of voice channel participants
- */
- void onParticipantsChanged();
-
- /**
* Changes state of indicators specified by LLUUIDs
*
* @param speakers_uuids - avatars' LLUUIDs whose speaking indicators should be switched
@@ -321,5 +321,13 @@ void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speak
}
}
+void LLSpeakingIndicatorManager::updateSpeakingIndicators()
+{
+ if(SpeakingIndicatorManager::instanceExists())
+ {
+ SpeakingIndicatorManager::instance().onParticipantsChanged();
+ }
+}
+
// EOF
diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h
index c2cf2a3702..8ee368e258 100644
--- a/indra/newview/llspeakingindicatormanager.h
+++ b/indra/newview/llspeakingindicatormanager.h
@@ -78,6 +78,11 @@ namespace LLSpeakingIndicatorManager
* @param speaking_indicator instance of the speaker indicator to be unregistered.
*/
void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator);
+
+ /**
+ * Switch on/off registered speaking indicator according to the most current voice client status
+ */
+ void updateSpeakingIndicators();
}
#endif // LL_LLSPEAKINGINDICATORMANAGER_H