PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llspeakingindicatormanager.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 83 lines | 21 code | 8 blank | 54 comment | 0 complexity | f2512b85b5c2e1c0023cbd51b5ae5f21 MD5 | raw file
 1/** 
 2 * @file llspeakingindicatormanager.h
 3 * @author Mike Antipov
 4 * @brief Interfeace of LLSpeackerIndicator class to be processed depend on avatars are in the same voice channel.
 5 * Also register/unregister methods for this class are declared
 6 *
 7 * $LicenseInfo:firstyear=2010&license=viewerlgpl$
 8 * Second Life Viewer Source Code
 9 * Copyright (C) 2010, Linden Research, Inc.
10 * 
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation;
14 * version 2.1 of the License only.
15 * 
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 * Lesser General Public License for more details.
20 * 
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 * 
25 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
26 * $/LicenseInfo$
27 */
28
29#ifndef LL_LLSPEAKINGINDICATORMANAGER_H
30#define LL_LLSPEAKINGINDICATORMANAGER_H
31
32class SpeakingIndicatorManager;
33
34class LLSpeakingIndicator
35{
36public:
37	virtual ~LLSpeakingIndicator(){}
38	virtual void switchIndicator(bool switch_on) = 0;
39
40private:
41	friend class SpeakingIndicatorManager;
42	// Accessors for target voice session UUID.
43	// They are intended to be used only from SpeakingIndicatorManager to ensure target session is 
44	// the same indicator was registered with.
45	void setTargetSessionID(const LLUUID& session_id) { mTargetSessionID = session_id; }
46	const LLUUID& getTargetSessionID() { return mTargetSessionID; }
47
48	/**
49	 * session UUID for which indicator should be shown only.
50	 *		If it is set, registered indicator will be shown only in voice channel
51	 *		which has the same session id (EXT-5562).
52	 */
53	LLUUID mTargetSessionID;
54};
55
56// See EXT-3976.
57namespace LLSpeakingIndicatorManager
58{
59	/**
60	 * Stores passed speaking indicator to control its visibility.
61	 *
62	 * Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent.
63	 * It ignores instances of Agent's indicator.
64	 *
65	 * @param speaker_id LLUUID of an avatar whose speaker indicator is registered.
66	 * @param speaking_indicator instance of the speaker indicator to be registered.
67	 * @param session_id session UUID for which indicator should be shown only.
68	 *		If this parameter is set registered indicator will be shown only in voice channel
69	 *		which has the same session id (EXT-5562).
70	 */
71	void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
72								   const LLUUID& session_id);
73
74	/**
75	 * Removes passed speaking indicator from observing.
76	 *
77	 * @param speaker_id LLUUID of an avatar whose speaker indicator should be unregistered.
78	 * @param speaking_indicator instance of the speaker indicator to be unregistered.
79	 */
80	void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator);
81}
82
83#endif // LL_LLSPEAKINGINDICATORMANAGER_H