コード例 #1
0
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)
	{
		LL_DEBUGS("SpeakingIndicator") << "Looking for indicator: " << *it_uuid << LL_ENDL;
		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;

			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 && !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);
			}
		}
	}
}
コード例 #2
0
void SpeakingIndicatorManager::onParticipantsChanged()
{
	LL_DEBUGS("SpeakingIndicator") << "Voice participant list was changed, updating indicators" << LL_ENDL;

	speaker_ids_t speakers_uuids;
	LLVoiceClient::getInstance()->getParticipantList(speakers_uuids);

	LL_DEBUGS("SpeakingIndicator") << "Switching all OFF, count: " << mSwitchedIndicatorsOn.size() << LL_ENDL;
	// switch all indicators off
	switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE);
	mSwitchedIndicatorsOn.clear();

	LL_DEBUGS("SpeakingIndicator") << "Switching all ON, count: " << speakers_uuids.size() << LL_ENDL;
	// then switch current voice participants indicators on
	switchSpeakerIndicators(speakers_uuids, TRUE);
}
コード例 #3
0
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)
	{
		LL_DEBUGS("SpeakingIndicator") << "Looking for indicator: " << *it_uuid << LL_ENDL;
		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;
			was_switched_on = was_switched_on || switch_on;

			indicator->switchIndicator(switch_on);
		}

		if (was_found)
		{
			LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators were found" << LL_ENDL;

			if (switch_on && !was_switched_on)
			{
				LL_DEBUGS("SpeakingIndicator") << "but none of them were switched on" << LL_ENDL;
			}

			if (was_switched_on)
			{
				// store switched on indicator to be able switch it off
				mSwitchedIndicatorsOn.insert(*it_uuid);
			}
		}
	}
}
コード例 #4
0
void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/)
{
	switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE);
	mSwitchedIndicatorsOn.clear();
}