⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clips_runtime.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 3 页
字号:
/***************************************************************************************
*  Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile: clips_runtime.c$
*
* Description:
* ========
*
*
****************************************************************************************/

/***************************************************************************************
*	 Include files
****************************************************************************************/

/***************************************************************************************
* 	Private Named constants
****************************************************************************************/
/***************************************************************************************
* 	Private Macros
****************************************************************************************/
#define _AudioNumSystemToUser(wCurrAudioNum)	(wCurrAudioNum+1)

/***************************************************************************************
* 	Private typdef definitions.
****************************************************************************************/


/***************************************************************************************
* 	Private static functions declaration
****************************************************************************************/
#ifdef D_GUI_SINGLE_LINE_COMPONENT
#ifdef USE_AUX_SUBTITLES
#if 0
STATIC BOOL _LayoutAuxSubtitles(void);
#endif
#endif //USE_AUX_SUBTITLES
STATIC BOOL _LayoutRuntime(void);
#endif //D_GUI_SINGLE_LINE_COMPONENT
STATIC MS_OP _RunTimeOperation(MSO_OBJECT __NEAR* pObject, MS_OP MsOp, UINT32 lParam);
//STATIC MS_OP _PopupContainerOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC BOOL _IsPlayingFileType (CLIPTYPE  wRequestType);

#ifdef D_GUI_ITEM_ACCESS
static MS_OP _ItemAccessComponentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static void _RuntimeItemAccessGetDisplayItem(UINT16* pItem, UINT16* pTotalItems, UINT16* pItemType);
#endif 


#ifdef D_GUI_SINGLE_LINE_COMPONENT
#ifdef USE_AUX_SUBTITLES
/***************************************************************************************
* 	OSD layout areas definition
****************************************************************************************/
STATIC CONST OSD_LAYOUT_AREA OsdLayoutAreaAuxSubtitles = {
	OSD_LAYOUT_AREA_AUX_SUBTITLES_X,
	OSD_LAYOUT_AREA_AUX_SUBTITLES_Y,
	OSD_AREA_END_X(OSD_LAYOUT_AREA_AUX_SUBTITLES_X, OSD_LAYOUT_AREA_AUX_SUBTITLES_W),
	OSD_AREA_END_Y(OSD_LAYOUT_AREA_AUX_SUBTITLES_Y, OSD_LAYOUT_AREA_AUX_SUBTITLES_H),
	OSD_COLOR_PALETTE_AUX_SUBTITLE 
};

/***************************************************************************************
*	Function 	: 	_LayoutAuxSubtitles
*
*	In		: 	None
*
*	Out		: 	TRUE if successful.
*
*	Desc 	:	Sets layout for the menu.
 ****************************************************************************************/
#if 0
STATIC BOOL _LayoutAuxSubtitles(void)
{
	go_CurrentLayout.m_bBigMemMap = OSD_LAYOUT_MEM_MAP_MEDIUM;
	OSDAdaptPixResolutionToProgressive();
	OSDClearArea();
	OSDAddArea(&OsdLayoutAreaAuxSubtitles);
	OSDSetLayout();
	OSDAdaptDisplayRangeToVideoStandard();

	return 1;
}
#endif
#endif //USE_AUX_SUBTITLES

/***************************************************************************************
*	Function 	: 	_LayoutRuntime
*
*	In		: 	None
*
*	Out		: 	TRUE if successful.
*
*	Desc 	:	Sets layout for the menu.
 ****************************************************************************************/
STATIC BOOL _LayoutRuntime(void)
{
	go_CurrentLayout.m_bBigMemMap 	= OSD_LAYOUT_MEM_MAP_MEDIUM;

	OSDAdaptPixResolutionToProgressive();
#ifdef D_CD_GRAPHIC_ENABLED
	go_CurrentLayout.m_bOSDBufferNum = OSD_BUFFER_0;
#endif//D_CD_GRAPHIC_ENABLED

	OSDClearArea();
	OSDAddArea(&OsdMessageLayoutArea);
	OSDAddArea(&gOsdLayoutAreaPopup);
	OSDAddArea(&OsdLayoutAreaAuxSubtitles);
	//OSDAddArea(&OsdDisplayLayoutArea);
	OSDSetLayout();
	OSDAdaptDisplayRangeToVideoStandard();	

	return(TRUE);
}

#endif //D_GUI_SINGLE_LINE_COMPONENT

/***************************************************************************************
* 	Objects definition
****************************************************************************************/

/***************************************************************************************
*	Descriptor 	: 	oDescriptorClipsRuntime
*
*	Purpose	 	:	THE Run time Menu. 
 ****************************************************************************************/
CONST MS_DESCRIPTOR_CONTAINER oDescriptorClipsRuntime =
{
	{
		sizeof(MSO_CONTAINER),
			MS_NAV_NULL ,	// no wrapping, need to handle paning in post-processing.
			MS_ATTR_CONTAINER | MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_1, 
		{
			AREA_RUNTIME_X,
			AREA_RUNTIME_Y,
			AREA_RUNTIME_W,
			AREA_RUNTIME_H,
		},
		_RunTimeOperation,
		mpfFillOsdSegNull,
		mpParamNull,
	},
	maContentsNull,
	mwNbrContentsNull,
};


/***************************************************************************************
*	Descriptor 	: 	oItemAccessDescriptor
*
*	Purpose	 	:	This descriptor is mainly for clips Runtime
 ****************************************************************************************/
#ifdef D_GUI_ITEM_ACCESS
static CONST MS_DESCRIPTOR_ITEM_ACCESS oItemAccessDescriptor =
{
	{// MS_DESCRIPTOR
       	sizeof(MSO_ITEM_ACCESS),
        	MS_NAV_NULL,
        	MS_ATTR_OSD_LAYER_1 |MS_ATTR_FOCUSABLE,
        	{
            		0,
            		0,
            		AREA_ITEM_ACCESS_COMPONENT_W,
            		AREA_ITEM_ACCESS_COMPONENT_H
        	},
        	OITEMACCESS_Operation,
        	OITEMACCESS_FillOSDSeg,
        	mpParamNull
    	},
    	(MS_X_Y_ALIGN *)&oCenterAlignToContainer,
	(MS_BITMAP_SET *)&oButtonBitmapSet,
	FONT_ITEM_ACCSESS,
	_RuntimeItemAccessGetDisplayItem, 
};

#define NBR_ITEM_ACCESS_CONTENTS		1

static CONST MS_DESCRIPTOR* CONST apContainerContents[NBR_ITEM_ACCESS_CONTENTS] = {
	(MS_DESCRIPTOR*)&oItemAccessDescriptor
};

CONST  MS_DESCRIPTOR_ITEM_ACCESS_COMPONENT oItemAccessComponentDescriptor =
{
	{// MS_DESCRIPTOR_COMPONENT
		{// MS_DESCRIPTOR_CONTAINER
			{// MS_DESCRIPTOR
				sizeof(MSO_ITEM_ACCESS_COMPONENT),
				MS_NAV_NULL,
				MS_ATTR_CONTAINER | MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_2,
				{
					AREA_ITEM_ACCESS_COMPONENT_X, 
					AREA_ITEM_ACCESS_COMPONENT_Y, 
					AREA_ITEM_ACCESS_COMPONENT_W, 
					AREA_ITEM_ACCESS_COMPONENT_H
	           		 },
				_ItemAccessComponentOperation,
				mpfFillOsdSegNull,
				mpParamNull,
			},
			(CONST MS_DESCRIPTOR**)apContainerContents,
			NBR_ITEM_ACCESS_CONTENTS,
		},
		(MS_DESCRIPTOR*)&oItemAccessDescriptor,
	},
	BMP_BG_ITEM_ACCESS_COMPONENT,
};
#endif //D_GUI_ITEM_ACCESS


/***************************************************************************************
* 	Operation functions
****************************************************************************************/
STATIC MS_OP _RunTimeOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	// Pre-processing
	switch(MsOp)
	{
	case MS_OP_FOCUS_CHANGE:
		{
			if (MS_IsFocused(pThis) && MS_IsContentFrozen(pThis))
			{
#ifdef D_GUI_SINGLE_LINE_COMPONENT
				//switch to runtime layout
				OSDTurnOff();
				usleep(10000);
				_LayoutRuntime();
				VPU_SetOSDStatus(VPU_OSD_STATUS_START_E);
#endif // D_GUI_SINGLE_LINE_COMPONENT
				
				MS_SEND_OP_OBJECT(pThis, MS_OP_DEFROST, lParam);
				
				// TODO: do it on init, here set to prev focus	
				MS_ScreenSetFocusObject(((MSO_CONTAINER __NEAR*)pThis)->mpOlist);
				//MS_DisplayObject(pThis);
				return MS_OP_NONE;
			}
			else if (!MS_IsFocused(pThis) && !MS_IsContentFrozen(pThis))
			{
				MS_SEND_OP_OBJECT(pThis, MS_OP_FREEZE, lParam);
				MS_DisplayObject(pThis);
				return MS_OP_NONE;
			}
		}
		break;

	// TODO: do this in the aux subtitle on MS_OP_PREPARE_FOR_FREEZE
	case MS_OP_FREEZE:
		{
#ifdef D_GUI_COMPONENT_SEARCH_DISPLAY
			MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oSearchDisplayDescriptor, FALSE);
#endif
#ifdef USE_AUX_SUBTITLES				
			//remove child object
			MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oDescriptorAuxSubtSelection, FALSE);
			MS_ComponentClose((MS_DESCRIPTOR_COMPONENT *)&oAuxSubtDescriptor, FALSE);
#endif //#ifdef USE_AUX_SUBTITLES					
#ifdef AVI_DRM_SUPPORT
			MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oDRMRentalConfirmDescriptor, FALSE);
			MS_ComponentClose((MS_DESCRIPTOR_COMPONENT *)&oDRMRentalExpiredDescriptor, FALSE);
			MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oDRMAuthorErrorDescriptor, FALSE);
#endif //AVI_DRM_SUPPORT
		}		
		break;	

	case MS_OP_MENU_ON_EJECT:
		//before close menu set it invisible to erasure some components from screen.
		//that can avoid some pop-up components keeping on screen several seconds 
		//when switch to runtime menu and logo on screen.
		MS_SetInvisible(pThis);
		MS_DisplayObject(pThis);
		break;
	case MS_OP_JUMP_TO_TIMEINDEX:
		{
			MS_SendOperation((MSO_OBJECT __NEAR*)MS_GetParentPtr(pThis), MsOp, lParam);
		}
		return MS_OP_NONE;

	case MS_OP_REPEAT:	// Fall Through !!!
#ifdef D_DIVX6_SUPPORT
			// Prohibit PAUSE while a DivX6 menu is playing.
			if(CoreAPI_IsDivX6TitleDomainPlay())
			{
				PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
				return MS_OP_NONE;
			}
#endif // D_DIVX6_SUPPORT

	case MS_OP_SEARCH: 	// Fall Through !!!
	case MS_OP_ZOOM: 	// Fall Through !!!
		{
#ifdef D_DIVX6_SUPPORT
			// Prohibit PAUSE while a DivX6 menu is playing.
			if(ActionEngine_CurrItemIsDivX6(FgActionEnginePtr) && ! CoreAPI_IsDivX6TitleDomainPlay())
			{
				PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
				return MS_OP_NONE;
			}
#endif // D_DIVX6_SUPPORT
		} // Fall Through !!!
		
	case MS_OP_SETUP:
#ifdef USE_AUX_SUBTITLES		
		if (NULL != MS_FindDescendant(pThis, &oDescriptorAuxSubtSelection))
		{
			PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
			return MS_OP_NONE;
		}	
#endif //USE_AUX_SUBTITLES
#ifdef AVI_DRM_SUPPORT
		if 	(	(NULL != MS_FindDescendant(pThis, &oDRMRentalConfirmDescriptor)) 
			|| 	(NULL != MS_FindDescendant(pThis, &oDRMRentalExpiredDescriptor)) 
			|| 	(NULL != MS_FindDescendant(pThis, &oDRMAuthorErrorDescriptor))
			)
		{
			PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
			return MS_OP_NONE;
		}	
#endif
		break;
	// Keep pre-processing for aux_subtitle selection component on screen should close this component.
	case MS_OP_MENU:
		{
			// Return menu close opened component first. so no need to add this case to component operation for close component.
			MS_SendOperation((MSO_OBJECT __NEAR*)MS_GetParentPtr(pThis), MS_OP_MENU_CLOSE_POPUP_COMPONENT, 0);
#ifdef D_DIVX6_SUPPORT
			if(CoreAPI_IsDivX6MenuDomainPlay() || CoreAPI_IsDivX6TitleDomainPlay())
			{
				ActionEngine_CurrItemGotoRootMenu(FgActionEnginePtr);
				return MS_OP_NONE;
			}
			else if(CoreAPI_IsDivX6MenuDomainLoading() || CoreAPI_IsDivX6TitleDomainLoading())
				return MS_OP_NONE;
			else
#endif // D_DIVX6_SUPPORT
				MsOp = MS_OP_STOP;
		} //Fall Through !!!

	case MS_OP_STOP:
#ifdef USE_AUX_SUBTITLES
		{
			MSO_OBJECT __NEAR*pAuxSub = MS_FindDescendant(pThis, &oAuxSubtDescriptor);
			if (NULL != pAuxSub)
			{
				//MS_DisplayObject(pAuxSub);
				MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oAuxSubtDescriptor, FALSE);
				MS_DisplayObject(pAuxSub);
			}
			MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oDescriptorAuxSubtSelection, FALSE);
		}
#endif // USE_AUX_SUBTITLES
		break;

	default:
		break;
	}
	
	MsOp = MS_BasicContainerOperation(pThis, MsOp, lParam);
	// Post-processing for Divx6
#ifdef D_DIVX6_SUPPORT
	switch(MsOp)
	{
	case MS_OP_UP:
		{			
			if(CoreAPI_IsDivX6MenuDomainPlay())
			{
				if(CoreAPI_IsDivX6CurrButtonValid())
					ActionEngine_CurrItemMenuMoveUp(FgActionEnginePtr);

				return MS_OP_NONE;
			}
			else if(CoreAPI_IsDivX6MenuDomainLoading() || CoreAPI_IsDivX6TitleDomainLoading())
				return MS_OP_NONE;
		}
		break;

	case MS_OP_DOWN:
		{
			if(CoreAPI_IsDivX6MenuDomainPlay())
			{
				if(CoreAPI_IsDivX6CurrButtonValid())
					ActionEngine_CurrItemMenuMoveDown(FgActionEnginePtr);

				return MS_OP_NONE;
			}
			else if(CoreAPI_IsDivX6MenuDomainLoading() || CoreAPI_IsDivX6TitleDomainLoading())
				return MS_OP_NONE;
		}
		break;

	case MS_OP_LEFT:
		{
			if(CoreAPI_IsDivX6MenuDomainPlay())
			{
				if(CoreAPI_IsDivX6CurrButtonValid())
					ActionEngine_CurrItemMenuMoveLeft(FgActionEnginePtr);

				return MS_OP_NONE;
			}
			else if(CoreAPI_IsDivX6MenuDomainLoading() || CoreAPI_IsDivX6TitleDomainLoading())
				return MS_OP_NONE;
		}
		break;

	case MS_OP_RIGHT:
		{
			if(CoreAPI_IsDivX6MenuDomainPlay())
			{
				if(CoreAPI_IsDivX6CurrButtonValid())
					ActionEngine_CurrItemMenuMoveRight(FgActionEnginePtr);

				return MS_OP_NONE;
			}
			else if(CoreAPI_IsDivX6MenuDomainLoading() || CoreAPI_IsDivX6TitleDomainLoading())
				return MS_OP_NONE;
		}
		break;

	case MS_OP_PLAY: // Fall Through !!!
	case MS_OP_ENTER:
		{
			if(CoreAPI_IsDivX6MenuDomainPlay())
			{
				if(CoreAPI_IsDivX6CurrButtonValid())
					ActionEngine_CurrItemMenuButtonSelect(FgActionEnginePtr);

				return MS_OP_NONE;
			}
			else if(CoreAPI_IsDivX6MenuDomainLoading() || CoreAPI_IsDivX6TitleDomainLoading())
				return MS_OP_NONE;
		}
		break;

	case MS_OP_RETURN:
		{
			if(FALSE == ActionEngine_CurrItemReturn(FgActionEnginePtr))
				PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
		}
		return MS_OP_NONE;

	case MS_OP_TITLE:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -