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

📄 o_fta_selection.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 2 页
字号:
	return MsOp;
}
#endif 
/***************************************************************************************
*	Function	: 	_ListItemFillOSDSeg
*
*	In		: 	pThis		=	Pointer to subtitle file list item objects.
*				pAbsArea	=	Absolute area of pThis object.
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	draw external subtitle file list item objects represented by
*                             oSubtListDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__ListItemFillOSDSeg
static BOOL _ListItemFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	MSO_LISTITEM __NEAR* pItem = (MSO_LISTITEM __NEAR*)pThis;
	FORMATED_UNICODE_STRING oFormUniStr;
	CONST UINT8* pBmp = NULL;

	UINT16 wColor = MS_IsSelected(pThis) ? /*pDescriptor->mwTextColor*/CIDX_4 : CIDX_2;

	// Display favorite icon
	if (pItem->moParam.bIsFavorite)
	{
		OSDR_FillOsdSegBitmap(	BMP_FG_MARK_CHECK,
							pAbsArea,
							6,
							14,
							ALIGN_H_LEFT, ALIGN_V_CENTER,
							NULL_EXPANSION, NULL_EXPANSION);
	}

	if( (UINT32)pItem->moParam.eType == FTA_SEL_CHANNEL_TYPE_VIDEO )
	{
		pBmp = BMP_FTA_SELECTION_VIDEO;
	}
	else
	{
		pBmp = BMP_FTA_SELECTION_RADIO;
	}
	if (NULL != pBmp)
	OSDR_FillOsdSegBitmap(pBmp, pAbsArea,
						24,
						(pAbsArea->mwH >> 1) + 2,
						ALIGN_H_LEFT, ALIGN_V_CENTER,
						NULL_EXPANSION, NULL_EXPANSION);


	OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData);

	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
				24+42,
				(pAbsArea->mwH >> 1) + 2,
				ALIGN_H_LEFT,
				ALIGN_V_CENTER,
				wColor);

	if (MS_IsFocused(pThis))
		OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);

	return FALSE;
}
#endif // D_CUSTOM
/***************************************************************************************
*	Function	: 	OpenFTASelection
*
*	In		: 	
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	
****************************************************************************************/
#ifndef D_CUSTOM_OpenFTASelection
MSO_OBJECT __NEAR* OpenFTASelection(MSO_CONTAINER __NEAR* pContainer, FTA_SELECTION_TYPE eType)
{
	MSO_FTA_SELECTION __NEAR* pFTASelet;	
	UINT16 wTotalNumFile; 
	
	if((NULL != pContainer) &&  CoreAPI_IsFtaMenuAllowed())
	{
		pFTASelet = (MSO_FTA_SELECTION __NEAR*)MS_CreateAndAddObject((MS_DESCRIPTOR*)&oDescriptorFTASelection,
						    			pContainer);
		
		if (FTA_SELECTION_FAVORITE == eType) //Open Favorite component. The component name will used in vscoll list refresh.
		{
			wTotalNumFile = CoreAPI_FtaGetCurrFavoriteChNums();
		}
		else
		{
			wTotalNumFile = CoreAPI_FtaGetNumberOfChannels();
		}
		pFTASelet->moParam.mtSelectionType = eType; // Store current component type

		if (0==wTotalNumFile)
		{
			MS_SEND_OP_OBJECT(pFTASelet, MS_OP_CLOSE, 0);
			return NULL;
		}
		MS_SEND_OP_OBJECT(pFTASelet, MS_OP_OPEN, 0);
		MS_SEND_OP_OBJECT(pFTASelet, MS_OP_INIT, 0);
		return (MSO_OBJECT __NEAR*)pFTASelet;
    }
    return NULL;
}
#endif //D_CUSTOM
/***************************************************************************************
*	Function	: 	_SubtSelectWindInitOp
*
*	In		: 	pThis	 = 	point to subtitle selection window object.
*
*                           lParam	 = 	Parameter associated with an MS_OP if any.
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	handle MS_OP_INIT operation of subtitle selection window
*                           object represented by oDescriptorVScrollList descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__SubtSelectWindInitOp
static void _SubtSelectWindInitOp(MSO_OBJECT __NEAR* pThis, UINT32 lParam)
{
	MSO_OBJECT __NEAR* pObject = MS_CreateAndAddObject((MS_DESCRIPTOR *)&oDescriptorVScrollList, (MSO_CONTAINER __NEAR*)pThis);

	MS_SendOperation(pObject, MS_OP_OPEN, lParam);
	((MSO_FTA_SELECTION __NEAR*)pThis)->moParam.mwTimeOut = 400; // 40 seconds
}
#endif // D_CUSTOM
/***************************************************************************************
*	Function	: 	_ComponentOperation
*
*	In		: 	pThis	=	Pointer to the subtitle select window (MSO_FTA_SELECTION) object.
*
*				MsOp	=	Operation ID.
*
*				lParam	=	Parameter associated with an MS_OP if any.
*
*	Out		: 	None.
*
*	Return	:	ID of the operation that is to be propagated once processing is done,
*				otherwise MS_OP_NONE.
*
*	Desc 	:	This function processes all operations/events  of the fta selection window
*				(MSO_FTA_SELECTION) object represented by the
*                                     oFtaWindowDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__ComponentOperation
static MS_OP _ComponentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{

    // reset timer each time user made operation on the channels list
    if( MsOp != MS_OP_TICK )
    {
        ((MSO_FTA_SELECTION __NEAR*)pThis)->moParam.mwTimeOut = 400; 
    }
       
	switch (MsOp)
	{
	case MS_OP_INIT:
		_SubtSelectWindInitOp(pThis, lParam);
		break;

	case MS_OP_TICK:
		{
			UINT16 *wTimeOut = &((MSO_FTA_SELECTION __NEAR*)pThis)->moParam.mwTimeOut;
			if (*wTimeOut)
			{
				if (--(*wTimeOut) == 0)
				{
					//close subtitle select window and not select any subtitle
                    			MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
				}
			}
		}
		break;

	case MS_OP_BOOKMARK: // Fall Thru
		 if (FTA_SELECTION_FAVORITE != ((MSO_FTA_SELECTION __NEAR*)pThis)->moParam.mtSelectionType)
		 {
		 	 ((MSO_FTA_SELECTION __NEAR*)pThis)->moParam.mtSelectionType = FTA_SELECTION_FAVORITE;
			 MS_SendOperation(pThis, MS_OP_REFRESH, REFRESH_LIST_DISPLAY_FIRST_ITEM); //Refresh from first item
		 }
		 else
		 {
		 	MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
		 }
		 return MS_OP_NONE;
		 	
	case MS_OP_MENU: //Fall Thru:
		 if (FTA_SELECTION_ALL != ((MSO_FTA_SELECTION __NEAR*)pThis)->moParam.mtSelectionType)
		 {
		 	 ((MSO_FTA_SELECTION __NEAR*)pThis)->moParam.mtSelectionType = FTA_SELECTION_ALL;
			 MS_SendOperation(pThis, MS_OP_REFRESH, REFRESH_LIST_DISPLAY_FIRST_ITEM); //Refresh from first item
		 }
		 else
		 {
		 	MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
		 }
		 return MS_OP_NONE;
		
	case MS_OP_CLOSE:
	case MS_OP_EJECT:
		MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
		break;

	case MS_OP_EMPTY:
	   	break;
	default:
		break;
	}

	MsOp = MS_ComponentBasicOperation(pThis, MsOp, lParam);
	
	if (MS_OP_FTA_SELECTION_FINISHED == MsOp)
	{
		MS_SEND_OP_OBJECT(pThis, MS_OP_CLOSE_PARENT, lParam);
	}
	// Prohibit user operation (such as MS_OP_SEARCH)
	else if (MS_IS_USER_OP(MsOp) && (MsOp != MS_OP_POWER) && (MsOp != MS_OP_EJECT))
	{
		PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
		return MS_OP_NONE;
	}

	return MsOp;
}
#endif //D_CUSTOM



/***************************************************************************************
*	Function	: 	_ComponentFillOSDSeg
*
*	In		: 	pThis		=	Pointer to subtitle file list item objects.
*				pAbsArea	=	Absolute area of pThis object.
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	draw subtitle selection window objects represented by
*                             oSubSelectWindowDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__TitleNameOperation
static MS_OP _TitleNameOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	// Pre-processing
	switch(MsOp)
	{
	case MS_OP_TICK:
		{			 
			if(((MSO_FTA_SELECTION __NEAR*)MS_GetParentPtr(pThis))->moParam.mtSelectionType
				!= ((MSO_TITLE_TEXT __NEAR*)pThis)->moParam.mtSelectionType)
			{
				OSD_MESSAGES osdComponentName; 
				((MSO_TITLE_TEXT __NEAR*)pThis)->moParam.mtSelectionType = ((MSO_FTA_SELECTION __NEAR*)MS_GetParentPtr(pThis))->moParam.mtSelectionType;
				osdComponentName = (FTA_SELECTION_FAVORITE != ((MSO_TITLE_TEXT __NEAR*)pThis)->moParam.mtSelectionType) ? S_CHANNEL_SELECTION : S_BOOKMARK;
				
				MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, osdComponentName);
				MS_DisplayAddObject(pThis);
			}
		}
		break;

	default:
		break;
	}

	MsOp = OTEXT_Operation(pThis, MsOp, lParam);

	// Post-processing.
	switch(MsOp)
	{
	case MS_OP_INIT:			// Fall Through !!!
	case MS_OP_ON_DEFROST:
		{			 
			((MSO_TITLE_TEXT __NEAR*)pThis)->moParam.mtSelectionType = FTA_SLECTION_NONE;
		}
		break;
		
	default:
		break;
	}
	return MsOp;
	
}
#endif //D_CUSTOM
/***************************************************************************************
*	Function	: 	_ComponentFillOSDSeg
*
*	In		: 	pThis		=	Pointer to subtitle file list item objects.
*				pAbsArea	=	Absolute area of pThis object.
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	draw subtitle selection window objects represented by
*                             oSubSelectWindowDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__ComponentFillOSDSeg
#pragma argsused
static BOOL _ComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{

	OSDR_FillOsdSegBitmapFitArea(BMP_BG_2, pAbsArea);
	
	return FALSE;
}
#endif //D_CUSTOM__ComponentFillOSDSeg

/***************************************************************************************
*	Function	: 	_SelectChannel
*
*	In		: 	pThis	=	Pointer to the FTA channel list item (MSO_LISTITEM) object.
*
*				lParam	=	if not equal 0 then set external subtitle file number
*                                                otherwise turn off external subtitle.
*
*	Out		: 	None.
*
*	Return	:	number of the external subtitle file selected by user
*
*	Desc 	:	This function select divx clip's external subtitle file.
*                           The file number starts from 0 and end to less than
*                           maximum file num (not care file type) in current directory.
****************************************************************************************/
#ifndef D_CUSTOM__SelectChannel
static UINT16 _SelectChannel(MSO_OBJECT __NEAR* pThis)
{
	UINT16 wSubFileIndex;
   
   	MSO_LISTITEM __NEAR* pSubtItem = (MSO_LISTITEM __NEAR*)pThis;

	wSubFileIndex = pSubtItem->moParam.mwIndex;
               
    CoreAPI_FtaChannelPlay(wSubFileIndex);
    
	return wSubFileIndex;
}
#endif //D_CUSTOM

/***************************************************************************************
*	Function	: 	_GetFavoriteItemIndex
*
*	In		: 	pThis	=	Pointer to Vscroll List
*				wIndex	=     User set Index or List FirstItemIndex (normal)
*				wStartIndex = 
*	Out		: 	None.
*
*	Return	:	Really index in total channel List(from 0.)
*
*	Desc 	:      Get FavoriteItemIndex start from wStartIndex, the wIndex(th) item.
*				include wStartIndex, such as if wStartIndex is favorite item, then wIndex is 1, return value 
* 				is wStartIndex.
****************************************************************************************/
static UINT16 _GetFavoriteItemIndex(MSO_OBJECT __NEAR* pThis, UINT16 wIndex, UINT16 wStartIndex)
{
	UINT16 wFavoriteItemIndex;
	UINT16 wCount;

	wFavoriteItemIndex = wStartIndex;
	wCount = 0;

	if (0 == wIndex)
		tr_printf(("wIndex is 0 \n", wIndex));
	
	while (1)
	{
		// Try to find wFavoriteItemIndex
		while ((wFavoriteItemIndex < CoreAPI_FtaGetNumberOfChannels() )
				&&	(!CoreAPI_FtaIsFavoriteChannel(wFavoriteItemIndex) 
					|| CoreAPI_FtaIsVideoChannel(CoreAPI_FtaGetCurrChannel()) != CoreAPI_FtaIsVideoChannel(wFavoriteItemIndex))
			)
		{
			wFavoriteItemIndex++; // If current is not favorite, try next
		}
		
		if (wFavoriteItemIndex == CoreAPI_FtaGetNumberOfChannels())
			return NULL_INDEX; 
		else 
		{
			wCount ++; // Find a favorite index, then wCount++
			if (wCount == wIndex)
				return  wFavoriteItemIndex;
			else
				wFavoriteItemIndex = wFavoriteItemIndex + 1; // Init next file indes to wFavoriteItemIndex
		}
	}

}

#endif // FTA_SUPPORT

⌨️ 快捷键说明

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