summaryrefslogtreecommitdiff
path: root/indra/newview/llcallfloater.h
diff options
context:
space:
mode:
authorKent Quirk <q@lindenlab.com>2009-12-22 15:37:31 -0500
committerKent Quirk <q@lindenlab.com>2009-12-22 15:37:31 -0500
commit53698d5c10a868abd883a0a4b4222d2e2d4bab96 (patch)
tree9a4c50e17c4d8e0de094c4352ec9df5944240c02 /indra/newview/llcallfloater.h
parent616ca198143e7cc3f925add2c3b83aaf5d2fe244 (diff)
parent0a98034641267ea57360fdd369acb8b94ff9bc20 (diff)
automated merge PE->viewer2.0
Diffstat (limited to 'indra/newview/llcallfloater.h')
-rw-r--r--indra/newview/llcallfloater.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index 21fba433c6..537c57f671 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -57,6 +57,15 @@ class LLSpeakerMgr;
class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver
{
public:
+ struct Params : public LLInitParam::Block<Params, LLDockableFloater::Params>
+ {
+ Optional<S32> voice_left_remove_delay;
+
+ Params();
+ };
+
+ LOG_CLASS(LLCallFloater);
+
LLCallFloater(const LLSD& key);
~LLCallFloater();
@@ -106,6 +115,13 @@ private:
* Refreshes participant list according to current Voice Channel
*/
void refreshPartisipantList();
+
+ /**
+ * Handles event on avatar list is refreshed after it was marked dirty.
+ *
+ * It sets initial participants voice states (once after the first refreshing)
+ * and updates voice states each time anybody is joined/left voice chat in session.
+ */
void onAvatarListRefreshed();
@@ -114,7 +130,21 @@ private:
void setModeratorMutedVoice(bool moderator_muted);
void updateAgentModeratorState();
+ /**
+ * Sets initial participants voice states in avatar list (Invited, Joined, Has Left).
+ *
+ * @see refreshPartisipantList()
+ * @see onAvatarListRefreshed()
+ * @see mInitParticipantsVoiceState
+ */
void initParticipantsVoiceState();
+
+ /**
+ * Updates participants voice states in avatar list (Invited, Joined, Has Left).
+ *
+ * @see onAvatarListRefreshed()
+ * @see onChanged()
+ */
void updateParticipantsVoiceState();
void setState(LLAvatarListItem* item, ESpeakerState state);
@@ -130,6 +160,34 @@ private:
return mSpeakerStateMap[speaker_id];
}
+
+ /**
+ * Instantiates new LLAvatarListItemRemoveTimer and adds it into the map if it is not already created.
+ *
+ * @param voice_speaker_id LLUUID of Avatar List item to be removed from the list when timer expires.
+ */
+ void setVoiceRemoveTimer(const LLUUID& voice_speaker_id);
+
+ /**
+ * Removes specified by UUID Avatar List item.
+ *
+ * @param voice_speaker_id LLUUID of Avatar List item to be removed from the list.
+ */
+ void removeVoiceLeftParticipant(const LLUUID& voice_speaker_id);
+
+ /**
+ * Deletes all timers from the list to prevent started timers from ticking after destruction
+ * and after switching on another voice channel.
+ */
+ void resetVoiceRemoveTimers();
+
+ /**
+ * Removes specified by UUID timer from the map.
+ *
+ * @param voice_speaker_id LLUUID of Avatar List item whose timer should be removed from the map.
+ */
+ void removeVoiceRemoveTimer(const LLUUID& voice_speaker_id);
+
private:
speaker_state_map_t mSpeakerStateMap;
LLSpeakerMgr* mSpeakerManager;
@@ -141,10 +199,45 @@ private:
LLOutputMonitorCtrl* mSpeakingIndicator;
bool mIsModeratorMutedVoice;
+ /**
+ * Flag indicated that participants voice states should be initialized.
+ *
+ * It is used due to Avatar List has delayed refreshing after it content is changed.
+ * Real initializing is performed when Avatar List is first time refreshed.
+ *
+ * @see onAvatarListRefreshed()
+ * @see initParticipantsVoiceState()
+ */
bool mInitParticipantsVoiceState;
boost::signals2::connection mAvatarListRefreshConnection;
+ /**
+ * class LLAvatarListItemRemoveTimer
+ *
+ * Implements a timer that removes avatar list item of a participant
+ * who has left the call.
+ */
+ class LLAvatarListItemRemoveTimer : public LLEventTimer
+ {
+ public:
+ typedef boost::function<void(const LLUUID&)> callback_t;
+
+ LLAvatarListItemRemoveTimer(callback_t remove_cb, F32 period, const LLUUID& speaker_id);
+ virtual ~LLAvatarListItemRemoveTimer() {};
+
+ virtual BOOL tick();
+
+ private:
+ callback_t mRemoveCallback;
+ LLUUID mSpeakerId;
+ };
+
+ typedef std::pair<LLUUID, LLAvatarListItemRemoveTimer*> timer_pair;
+ typedef std::map<LLUUID, LLAvatarListItemRemoveTimer*> timers_map;
+
+ timers_map mVoiceLeftTimersMap;
+ S32 mVoiceLeftRemoveDelay;
};