当前位置: 首页>>代码示例>>C++>>正文


C++ LLAvatarListItem::getAvatarName方法代码示例

本文整理汇总了C++中LLAvatarListItem::getAvatarName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAvatarListItem::getAvatarName方法的具体用法?C++ LLAvatarListItem::getAvatarName怎么用?C++ LLAvatarListItem::getAvatarName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLAvatarListItem的用法示例。


在下文中一共展示了LLAvatarListItem::getAvatarName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateParticipantsVoiceState

void LLCallFloater::updateParticipantsVoiceState()
{
	uuid_vec_t speakers_list;

	// Get a list of participants from VoiceClient
	uuid_vec_t speakers_uuids;
	get_voice_participants_uuids(speakers_uuids);

	// Updating the status for each participant already in list.
	std::vector<LLPanel*> items;
	mAvatarList->getItems(items);
	std::vector<LLPanel*>::const_iterator
		it = items.begin(),
		it_end = items.end();

	for(; it != it_end; ++it)
	{
		LLAvatarListItem *item = dynamic_cast<LLAvatarListItem*>(*it);
		if (!item) continue;

		const LLUUID participant_id = item->getAvatarId();
		bool found = false;

		uuid_vec_t::iterator speakers_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), participant_id);

		LL_DEBUGS("Voice") << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << LL_ENDL;

		// If an avatarID assigned to a panel is found in a speakers list
		// obtained from VoiceClient we assign the JOINED status to the owner
		// of this avatarID.
		if (speakers_iter != speakers_uuids.end())
		{
			setState(item, STATE_JOINED);

			LLPointer<LLSpeaker> speaker = mSpeakerManager->findSpeaker(participant_id);
			if (speaker.isNull())
				continue;
			speaker->mHasLeftCurrentCall = FALSE;

			speakers_uuids.erase(speakers_iter);
			found = true;
		}

		if (!found)
		{
			updateNotInVoiceParticipantState(item);
		}
	}
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:49,代码来源:llcallfloater.cpp

示例2: mute

void FSParticipantList::FSParticipantListMenu::toggleMute(const LLSD& userdata, U32 flags)
{
	const LLUUID speaker_id = mUUIDs.front();
	BOOL is_muted = LLMuteList::getInstance()->isMuted(speaker_id, flags);
	std::string name;

	//fill in name using voice client's copy of name cache
	LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(speaker_id);
	if (speakerp.isNull())
	{
		LL_WARNS("Speakers") << "Speaker " << speaker_id << " not found" << LL_ENDL;
		return;
	}
	LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(mParent.mAvatarList->getItemByValue(speaker_id));
	if (NULL == item) return;

	name = item->getAvatarName();

	LLMute::EType mute_type;
	switch (speakerp->mType)
	{
		case LLSpeaker::SPEAKER_AGENT:
			mute_type = LLMute::AGENT;
			break;
		case LLSpeaker::SPEAKER_OBJECT:
			mute_type = LLMute::OBJECT;
			break;
		case LLSpeaker::SPEAKER_EXTERNAL:
		default:
			mute_type = LLMute::EXTERNAL;
			break;
	}
	LLMute mute(speaker_id, name, mute_type);

	if (!is_muted)
	{
		LLMuteList::getInstance()->add(mute, flags);
	}
	else
	{
		LLMuteList::getInstance()->remove(mute, flags);
	}
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:43,代码来源:fsparticipantlist.cpp

示例3: onAvatarListRefreshed

void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
{
	LLAvatarList* list = dynamic_cast<LLAvatarList*>(ctrl);
	if (list)
	{
		const std::string moderator_indicator(LLTrans::getString("IM_moderator_label")); 
		const std::size_t moderator_indicator_len = moderator_indicator.length();

		// Firstly remove moderators indicator
		std::set<LLUUID>::const_iterator
			moderator_list_it = mModeratorToRemoveList.begin(),
			moderator_list_end = mModeratorToRemoveList.end();
		for (;moderator_list_it != moderator_list_end; ++moderator_list_it)
		{
			LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it));
			if ( item )
			{
				std::string name = item->getAvatarName();
				std::string tooltip = item->getAvatarToolTip();
				size_t found = name.find(moderator_indicator);
				if (found != std::string::npos)
				{
					name.erase(found, moderator_indicator_len);
					item->setAvatarName(name);
				}
				found = tooltip.find(moderator_indicator);
				if (found != tooltip.npos)
				{
					tooltip.erase(found, moderator_indicator_len);
					item->setAvatarToolTip(tooltip);
				}
			}
		}

		mModeratorToRemoveList.clear();

		// Add moderators indicator
		moderator_list_it = mModeratorList.begin();
		moderator_list_end = mModeratorList.end();
		for (;moderator_list_it != moderator_list_end; ++moderator_list_it)
		{
			LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it));
			if ( item )
			{
				std::string name = item->getAvatarName();
				std::string tooltip = item->getAvatarToolTip();
				size_t found = name.find(moderator_indicator);
				if (found == std::string::npos)
				{
					name += " ";
					name += moderator_indicator;
					item->setAvatarName(name);
				}
				found = tooltip.find(moderator_indicator);
				if (found == std::string::npos)
				{
					tooltip += " ";
					tooltip += moderator_indicator;
					item->setAvatarToolTip(tooltip);
				}
			}
		}

		// update voice mute state of all items. See EXT-7235
		LLSpeakerMgr::speaker_list_t speaker_list;

		// Use also participants which are not in voice session now (the second arg is TRUE).
		// They can already have mModeratorMutedVoice set from the previous voice session
		// and LLSpeakerVoiceModerationEvent will not be sent when speaker manager is updated next time.
		mSpeakerMgr->getSpeakerList(&speaker_list, TRUE);
		for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++)
		{
			const LLPointer<LLSpeaker>& speakerp = *it;

			update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice);
		}
	}
}
开发者ID:OS-Development,项目名称:VW.Zen,代码行数:78,代码来源:llparticipantlist.cpp


注:本文中的LLAvatarListItem::getAvatarName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。