commit
a4589431d9
|
|
@ -329,7 +329,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is
|
|||
{
|
||||
LLAvatarListItem* item = new LLAvatarListItem();
|
||||
item->setName(name);
|
||||
item->setAvatarId(id, mIgnoreOnlineStatus);
|
||||
item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus);
|
||||
item->setOnline(mIgnoreOnlineStatus ? true : is_online);
|
||||
item->showLastInteractionTime(mShowLastInteractionTime);
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ public:
|
|||
bool contains(const LLUUID& id);
|
||||
|
||||
void setContextMenu(LLAvatarListItem::ContextMenu* menu) { mContextMenu = menu; }
|
||||
void setSessionID(const LLUUID& session_id) { mSessionID = session_id; }
|
||||
const LLUUID& getSessionID() { return mSessionID; }
|
||||
|
||||
void toggleIcons();
|
||||
void setSpeakingIndicatorsVisible(bool visible);
|
||||
|
|
@ -119,6 +121,7 @@ private:
|
|||
std::string mIconParamName;
|
||||
std::string mNameFilter;
|
||||
uuid_vector_t mIDs;
|
||||
LLUUID mSessionID;
|
||||
|
||||
LLAvatarListItem::ContextMenu* mContextMenu;
|
||||
|
||||
|
|
|
|||
|
|
@ -211,14 +211,14 @@ void LLAvatarListItem::setState(EItemState item_style)
|
|||
mAvatarIcon->setColor(item_icon_color_map[item_style]);
|
||||
}
|
||||
|
||||
void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes)
|
||||
void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes)
|
||||
{
|
||||
if (mAvatarId.notNull())
|
||||
LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarId, this);
|
||||
|
||||
mAvatarId = id;
|
||||
mAvatarIcon->setValue(id);
|
||||
mSpeakingIndicator->setSpeakerId(id);
|
||||
mSpeakingIndicator->setSpeakerId(id, session_id);
|
||||
|
||||
// We'll be notified on avatar online status changes
|
||||
if (!ignore_status_changes && mAvatarId.notNull())
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public:
|
|||
void setName(const std::string& name);
|
||||
void setHighlight(const std::string& highlight);
|
||||
void setState(EItemState item_style);
|
||||
void setAvatarId(const LLUUID& id, bool ignore_status_changes = false);
|
||||
void setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes = false);
|
||||
void setLastInteractionTime(U32 secs_since);
|
||||
//Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly
|
||||
void setShowProfileBtn(bool show);
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ void LLOutputMonitorCtrl::draw()
|
|||
gl_rect_2d(0, monh, monw, 0, sColorBound, FALSE);
|
||||
}
|
||||
|
||||
void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id)
|
||||
void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/)
|
||||
{
|
||||
if (speaker_id.isNull() && mSpeakerId.notNull())
|
||||
{
|
||||
|
|
@ -263,7 +263,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id)
|
|||
}
|
||||
|
||||
mSpeakerId = speaker_id;
|
||||
LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this);
|
||||
LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this, session_id);
|
||||
|
||||
//mute management
|
||||
if (mAutoUpdate)
|
||||
|
|
@ -303,7 +303,7 @@ void LLOutputMonitorCtrl::switchIndicator(bool switch_on)
|
|||
}
|
||||
|
||||
// otherwise remember necessary state and mark itself as dirty.
|
||||
// State will be applied i next draw when parents chain became visible.
|
||||
// State will be applied in next draw when parents chain becomes visible.
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL;
|
||||
|
|
@ -317,7 +317,7 @@ void LLOutputMonitorCtrl::switchIndicator(bool switch_on)
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
void LLOutputMonitorCtrl::notifyParentVisibilityChanged()
|
||||
{
|
||||
LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << " ,new_visibility: " << getVisible() << LL_ENDL;
|
||||
LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << ", new_visibility: " << getVisible() << LL_ENDL;
|
||||
|
||||
LLSD params = LLSD().with("visibility_changed", getVisible());
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,15 @@ public:
|
|||
|
||||
void setIsTalking(bool val) { mIsTalking = val; }
|
||||
|
||||
void setSpeakerId(const LLUUID& speaker_id);
|
||||
/**
|
||||
* Sets avatar UUID to interact with voice channel.
|
||||
*
|
||||
* @param speaker_id LLUUID of an avatar whose voice level is displayed.
|
||||
* @param session_id session UUID for which indicator should be shown only. Passed to LLSpeakingIndicatorManager
|
||||
* If this parameter is set registered indicator will be shown only in voice channel
|
||||
* which has the same session id (EXT-5562).
|
||||
*/
|
||||
void setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null);
|
||||
|
||||
//called by mute list
|
||||
virtual void onChange();
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
|
|||
mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator");
|
||||
|
||||
mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
|
||||
LL_DEBUGS("SpeakingIndicator") << "Set session for speaking indicators: " << mSpeakerMgr->getSessionID() << LL_ENDL;
|
||||
mAvatarList->setSessionID(mSpeakerMgr->getSessionID());
|
||||
mAvatarListDoubleClickConnection = mAvatarList->setItemDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, _1));
|
||||
mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2));
|
||||
// Set onAvatarListDoubleClicked as default on_return action.
|
||||
|
|
|
|||
|
|
@ -65,8 +65,12 @@ public:
|
|||
*
|
||||
* @param speaker_id LLUUID of an avatar whose speaking indicator is registered.
|
||||
* @param speaking_indicator instance of the speaking indicator to be registered.
|
||||
* @param session_id session UUID for which indicator should be shown only.
|
||||
* If this parameter is set registered indicator will be shown only in voice channel
|
||||
* which has the same session id (EXT-5562).
|
||||
*/
|
||||
void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator);
|
||||
void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
|
||||
const LLUUID& session_id = LLUUID::null);
|
||||
|
||||
/**
|
||||
* Removes passed speaking indicator from observing.
|
||||
|
|
@ -138,15 +142,18 @@ private:
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
// PUBLIC SECTION
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator)
|
||||
void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
|
||||
const LLUUID& session_id)
|
||||
{
|
||||
// do not exclude agent's indicators. They should be processed in the same way as others. See EXT-3889.
|
||||
|
||||
LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << "|"<< speaking_indicator << LL_ENDL;
|
||||
LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << "|"<< speaking_indicator << ", session: " << session_id << LL_ENDL;
|
||||
|
||||
|
||||
ensureInstanceDoesNotExist(speaking_indicator);
|
||||
|
||||
speaking_indicator->setTargetSessionID(session_id);
|
||||
|
||||
speaking_indicator_value_t value_type(speaker_id, speaking_indicator);
|
||||
mSpeakingIndicators.insert(value_type);
|
||||
|
||||
|
|
@ -217,6 +224,13 @@ void SpeakingIndicatorManager::onChange()
|
|||
|
||||
void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on)
|
||||
{
|
||||
LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
|
||||
LLUUID session_id;
|
||||
if (voice_channel)
|
||||
{
|
||||
session_id = voice_channel->getSessionID();
|
||||
}
|
||||
|
||||
speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin();
|
||||
for (; it_uuid != speakers_uuids.end(); ++it_uuid)
|
||||
{
|
||||
|
|
@ -224,18 +238,36 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea
|
|||
indicator_range_t it_range = mSpeakingIndicators.equal_range(*it_uuid);
|
||||
indicator_const_iterator it_indicator = it_range.first;
|
||||
bool was_found = false;
|
||||
bool was_switched_on = false;
|
||||
for (; it_indicator != it_range.second; ++it_indicator)
|
||||
{
|
||||
was_found = true;
|
||||
LLSpeakingIndicator* indicator = (*it_indicator).second;
|
||||
indicator->switchIndicator(switch_on);
|
||||
|
||||
BOOL switch_current_on = switch_on;
|
||||
|
||||
// we should show indicator for specified voice session only if this is current channel. EXT-5562.
|
||||
if (switch_current_on && indicator->getTargetSessionID().notNull())
|
||||
{
|
||||
switch_current_on = indicator->getTargetSessionID() == session_id;
|
||||
LL_DEBUGS("SpeakingIndicator") << "Session: " << session_id << ", target: " << indicator->getTargetSessionID() << ", the same? = " << switch_current_on << LL_ENDL;
|
||||
}
|
||||
was_switched_on = was_switched_on || switch_current_on;
|
||||
|
||||
indicator->switchIndicator(switch_current_on);
|
||||
|
||||
}
|
||||
|
||||
if (was_found)
|
||||
{
|
||||
LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL;
|
||||
|
||||
if (switch_on)
|
||||
if (switch_on && !was_switched_on)
|
||||
{
|
||||
LL_DEBUGS("SpeakingIndicator") << "but non of them where switched on" << LL_ENDL;
|
||||
}
|
||||
|
||||
if (was_switched_on)
|
||||
{
|
||||
// store switched on indicator to be able switch it off
|
||||
mSwitchedIndicatorsOn.insert(*it_uuid);
|
||||
|
|
@ -274,9 +306,10 @@ void SpeakingIndicatorManager::ensureInstanceDoesNotExist(LLSpeakingIndicator* c
|
|||
/* LLSpeakingIndicatorManager namespace implementation */
|
||||
/************************************************************************/
|
||||
|
||||
void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator)
|
||||
void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
|
||||
const LLUUID& session_id)
|
||||
{
|
||||
SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator);
|
||||
SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator, session_id);
|
||||
}
|
||||
|
||||
void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator)
|
||||
|
|
|
|||
|
|
@ -35,10 +35,28 @@
|
|||
#ifndef LL_LLSPEAKINGINDICATORMANAGER_H
|
||||
#define LL_LLSPEAKINGINDICATORMANAGER_H
|
||||
|
||||
class SpeakingIndicatorManager;
|
||||
|
||||
class LLSpeakingIndicator
|
||||
{
|
||||
public:
|
||||
virtual ~LLSpeakingIndicator(){}
|
||||
virtual void switchIndicator(bool switch_on) = 0;
|
||||
|
||||
private:
|
||||
friend class SpeakingIndicatorManager;
|
||||
// Accessors for target voice session UUID.
|
||||
// They are intended to be used only from SpeakingIndicatorManager to ensure target session is
|
||||
// the same indicator was registered with.
|
||||
void setTargetSessionID(const LLUUID& session_id) { mTargetSessionID = session_id; }
|
||||
const LLUUID& getTargetSessionID() { return mTargetSessionID; }
|
||||
|
||||
/**
|
||||
* session UUID for which indicator should be shown only.
|
||||
* If it is set, registered indicator will be shown only in voice channel
|
||||
* which has the same session id (EXT-5562).
|
||||
*/
|
||||
LLUUID mTargetSessionID;
|
||||
};
|
||||
|
||||
// See EXT-3976.
|
||||
|
|
@ -52,8 +70,12 @@ namespace LLSpeakingIndicatorManager
|
|||
*
|
||||
* @param speaker_id LLUUID of an avatar whose speaker indicator is registered.
|
||||
* @param speaking_indicator instance of the speaker indicator to be registered.
|
||||
* @param session_id session UUID for which indicator should be shown only.
|
||||
* If this parameter is set registered indicator will be shown only in voice channel
|
||||
* which has the same session id (EXT-5562).
|
||||
*/
|
||||
void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator);
|
||||
void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
|
||||
const LLUUID& session_id);
|
||||
|
||||
/**
|
||||
* Removes passed speaking indicator from observing.
|
||||
|
|
|
|||
Loading…
Reference in New Issue