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


C++ LLViewerMediaImpl::isMediaTimeBased方法代码示例

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


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

示例1: updateControls

void LLPanelNearByMedia::updateControls()
{
	LLUUID selected_media_id = mMediaList->getValue().asUUID();
	
	if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID)
	{
		if (!LLViewerMedia::hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic"))
		{
			// disable controls if audio streaming music is disabled from preference
			showDisabledControls();
		}
		else {
			showTimeBasedControls(LLViewerMedia::isParcelAudioPlaying(),
							  false, // include_zoom
							  false, // is_zoomed
							  gSavedSettings.getBOOL("MuteMusic"), 
							  gSavedSettings.getF32("AudioLevelMusic") );
		}
	}
	else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID)
	{
		if (!LLViewerMedia::hasParcelMedia() || !gSavedSettings.getBOOL("AudioStreamingMedia"))
		{
			// disable controls if audio streaming media is disabled from preference
			showDisabledControls();
		}
		else {
			LLViewerMediaImpl* impl = LLViewerParcelMedia::getParcelMedia();
			if (NULL == impl)
			{
				// Just means it hasn't started yet
				showBasicControls(false, false, false, false, 0);
			}
			else if (impl->isMediaTimeBased())
			{
				showTimeBasedControls(impl->isMediaPlaying(), 
									  false, // include_zoom
									  false, // is_zoomed
									  impl->getVolume() == 0.0,
									  impl->getVolume() );
			}
			else {
				// non-time-based parcel media
				showBasicControls(LLViewerMedia::isParcelMediaPlaying(), 
							      false, 
								  false, 
								  impl->getVolume() == 0.0, 
								  impl->getVolume());
			}
		}
	}
	else {
		LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
		
		if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia"))
		{
			showDisabledControls();
		}
		else {
			if (impl->isMediaTimeBased())
			{
				showTimeBasedControls(impl->isMediaPlaying(), 
									  ! impl->isParcelMedia(),  // include_zoom
									  LLViewerMediaFocus::getInstance()->isZoomed(),
									  impl->getVolume() == 0.0,
									  impl->getVolume());
			}
			else {
				showBasicControls(!impl->isMediaDisabled(), 
								  ! impl->isParcelMedia(),  // include_zoom
								  LLViewerMediaFocus::getInstance()->isZoomed(),
								  impl->getVolume() == 0.0,
								  impl->getVolume());
			}
		}
	}
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:77,代码来源:llpanelnearbymedia.cpp

示例2: refreshParcelItems

void LLPanelNearByMedia::refreshParcelItems()
{
	//
	// First add/remove the "fake" items Parcel Media and Parcel Audio.
	// These items will have special UUIDs 
	//    PARCEL_MEDIA_LIST_ITEM_UUID
	//    PARCEL_AUDIO_LIST_ITEM_UUID
	//
	// Get the filter choice.
	const LLSD &choice_llsd = mShowCtrl->getSelectedValue();
	MediaClass choice = (MediaClass)choice_llsd.asInteger();
	// Only show "special parcel items" if "All" or "Within" filter
	// (and if media is "enabled")
	bool should_include = (choice == MEDIA_CLASS_ALL || choice == MEDIA_CLASS_WITHIN_PARCEL);
	
	// First Parcel Media: add or remove it as necessary
	if (gSavedSettings.getBOOL("AudioStreamingMedia") &&should_include && LLViewerMedia::hasParcelMedia())
	{
		// Yes, there is parcel media.
		if (NULL == mParcelMediaItem)
		{
			mParcelMediaItem = addListItem(PARCEL_MEDIA_LIST_ITEM_UUID);
			mMediaList->setNeedsSort(true);
		}
	}
	else {
		if (NULL != mParcelMediaItem) {
			removeListItem(PARCEL_MEDIA_LIST_ITEM_UUID);
			mParcelMediaItem = NULL;
			mMediaList->setNeedsSort(true);	
		}
	}
	
	// ... then update it
	if (NULL != mParcelMediaItem)
	{
		std::string name, url, tooltip;
		getNameAndUrlHelper(LLViewerParcelMedia::getParcelMedia(), name, url, "");
		if (name.empty() || name == url)
		{
			tooltip = url;
		}
		else
		{
			tooltip = name + " : " + url;
		}
		LLViewerMediaImpl *impl = LLViewerParcelMedia::getParcelMedia();
		updateListItem(mParcelMediaItem,
					   mParcelMediaName,
					   tooltip,
					   -2, // Proximity closer than anything else, before Parcel Audio
					   impl == NULL || impl->isMediaDisabled(),
					   impl != NULL && !LLViewerParcelMedia::getURL().empty(),
					   impl != NULL && impl->isMediaTimeBased() &&	impl->isMediaPlaying(),
					   MEDIA_CLASS_ALL,
					   "parcel media");
	}
	
	// Next Parcel Audio: add or remove it as necessary (don't show if disabled in prefs)
	if (should_include && LLViewerMedia::hasParcelAudio() && gSavedSettings.getBOOL("AudioStreamingMusic"))
	{
		// Yes, there is parcel audio.
		if (NULL == mParcelAudioItem)
		{
			mParcelAudioItem = addListItem(PARCEL_AUDIO_LIST_ITEM_UUID);
			mMediaList->setNeedsSort(true);
		}
	}
	else {
		if (NULL != mParcelAudioItem) {
			removeListItem(PARCEL_AUDIO_LIST_ITEM_UUID);
			mParcelAudioItem = NULL;
			mMediaList->setNeedsSort(true);
		}
	}
	
	// ... then update it
	if (NULL != mParcelAudioItem)
	{
		bool is_playing = LLViewerMedia::isParcelAudioPlaying();
	
		std::string url;
        url = LLViewerMedia::getParcelAudioURL();

		updateListItem(mParcelAudioItem,
					   mParcelAudioName,
					   url,
					   -1, // Proximity after Parcel Media, but closer than anything else
					   (!is_playing),
					   is_playing,
					   is_playing,
					   MEDIA_CLASS_ALL,
					   "parcel audio");
	}
}
开发者ID:,项目名称:,代码行数:95,代码来源:


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