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

📄 o_dvdvr.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 3 页
字号:
			OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
			OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, 
									((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
			((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;

			// TITLE key help.
			cWordsWritten = STR_GenerateOSDMESSAGEString(S_TITLE, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
			
			// Tag a colon, and a space on the end.
			oFormUniStr.mszUniStr[cWordsWritten++] = L':';
			oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;

			STR_GenerateOSDMESSAGEString(osdTitleKeyHelp, oFormUniStr.mszUniStr, cWordsWritten, UNISTR_LENGTH_MAX);
			
			// Remove any extra spacing on the end.
			STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, DVDVR_INFO_PADDING_SPACES);

			oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);
			OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
			OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, 
									((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
			((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;

			// PLAY/SELECT key help.
			cWordsWritten = STR_GenerateOSDMESSAGEString(S_PLAY_AND_SELECT, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
			
            		// Tag a colon, and a space on the end.
			oFormUniStr.mszUniStr[cWordsWritten++] = L':';
			oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;

			STR_GenerateOSDMESSAGEString(S_PLAY_SELECTED_ITEM, oFormUniStr.mszUniStr, cWordsWritten, UNISTR_LENGTH_MAX);

			// Remove any extra spacing on the end.
			STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, DVDVR_INFO_PADDING_SPACES);
			
			oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);
			OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
			OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, 
									((MULTILINE_TEXT_TABLE*)lParam)->mwEntries[((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount]);
			((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount++;
		}
		return MS_OP_NONE;
		
	default:
		break;
	}
	
	MsOp = OHSCROLLTEXT_Operation(pThis, MsOp, lParam);

	// Post-processing.
	switch(MsOp)
	{
	case MS_OP_INIT: 			// Fall Through !!!
	case MS_OP_ON_DEFROST:
		{
			MSO_DVDVR_HELPTEXT __NEAR* pHelpText = (MSO_DVDVR_HELPTEXT __NEAR*)pThis;
			pHelpText->moParam.mtProgramChain = PGC_TYPE_NONE;
		}
		break;
		
	default:
		break;
	}
	return MsOp;
}

/***************************************************************************************
*	Function 	: 	_DVDVROperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_DVDVR user operation function.
****************************************************************************************/
STATIC MS_OP _DVDVROperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{			
	// Pre-processing.
	switch(MsOp)
	{		
	case MS_OP_TICK:
		{
			// Close the DVD-VR component if the playback has started/resumed. E.g. via search operation.
			if(PST_PLAY == CoreAPI_GetPlayState())
				MsOp = MS_OP_CLOSE_PARENT;
		}
		break;
		
	case MS_OP_INIT:
		{
			MSO_DVDVR __NEAR* pDVDVRWindow = (MSO_DVDVR __NEAR*)pThis;
			pDVDVRWindow->moParam.mcProgramChain = (PGC_TYPE)lParam;
			pDVDVRWindow->moParam.mbDisplayActiveItem = TRUE;
			
			MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
		}
		break;

	case MS_OP_MENU:
		{
			MSO_DVDVR __NEAR* pDVDVRWindow = (MSO_DVDVR __NEAR*)pThis;

			if(PGC_TYPE_USERDEFINED == pDVDVRWindow->moParam.mcProgramChain)
			{
				// Close the DVD-VR component.
				MsOp = MS_OP_CLOSE_PARENT;
			}
			else
			{
				// Switch only if there are items in the User Defined Program Chain.
				if(CoreAPI_GetDVDVRMaxPlayListNum())
				{
					MSO_OBJECT __NEAR* pScrollList = MS_FindDescendant(pThis, &oBrowserVScrollListDescriptor);
					
					pDVDVRWindow->moParam.mcProgramChain = PGC_TYPE_USERDEFINED;
					pDVDVRWindow->moParam.mbDisplayActiveItem = TRUE;
					
					//Refresh the Browser list and show the User Defined program chain.
					MS_SendOpObject(pScrollList, MS_OP_REFRESH, REFRESH_LIST_DISPLAY_FIRST_ITEM);
				}
				else
					MS_SendOp(MS_OP_MSG_ERROR_EMPTY_PROGRAM_CHAIN, DVDVR_MSG_EMPTY_PLAY_LIST);
				
				return MS_OP_NONE;
			}
		}
		break;

	case MS_OP_TITLE:
		{
			MSO_DVDVR __NEAR* pDVDVRWindow = (MSO_DVDVR __NEAR*)pThis;

			if(PGC_TYPE_ORIGINAL == pDVDVRWindow->moParam.mcProgramChain)
			{
				// Close the DVD-VR component.
				MsOp = MS_OP_CLOSE_PARENT;
			}
			else
			{
				// Switch only if there are items in the Original Program Chain.
				if(CoreAPI_GetDVDVRMaxProgramNum())
				{
					MSO_OBJECT __NEAR* pScrollList = MS_FindDescendant(pThis, &oBrowserVScrollListDescriptor);
					
					pDVDVRWindow->moParam.mcProgramChain = PGC_TYPE_ORIGINAL;
					pDVDVRWindow->moParam.mbDisplayActiveItem = TRUE;
					
					// Refresh the Browser list and show the Original program chain.
					MS_SendOpObject(pScrollList, MS_OP_REFRESH, REFRESH_LIST_DISPLAY_FIRST_ITEM);
				}
				else
					MS_SendOp(MS_OP_MSG_ERROR_EMPTY_PROGRAM_CHAIN, DVDVR_MSG_EMPTY_PROGRAM_LIST);
				
				return MS_OP_NONE;
			}
		}
		break;

	default:
		break;
	}	
	
	MsOp = MS_ComponentBasicOperation(pThis, MsOp, lParam);

	// Post-processing
	switch(MsOp)
	{
	case MS_OP_POWER: 	// Fall Through !!!
	case MS_OP_EJECT:
		{
			// Indicate that the component is to be closed.
			MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
		}
		break; 
		
	default:
		break;
	}
	return MsOp;
}

/***************************************************************************************
* 	Display functions
****************************************************************************************/

/***************************************************************************************
*	Function 	: 	_DVDVRFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_DVDVR display function.
****************************************************************************************/
STATIC BOOL _DVDVRFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{	
	MS_AREA oAbsArea;
	MS_DESCRIPTOR_DVDVR* pDescriptor = (MS_DESCRIPTOR_DVDVR*)pThis->mpDescriptor;

	oAbsArea.msX 	= pAbsArea->msX;
	oAbsArea.msY 	= pAbsArea->msY;
	oAbsArea.mwW 	= pAbsArea->mwW;
	oAbsArea.mwH 	= AREA_DVDVR_BROWSER_H;
	
	OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, (MS_AREA __NEAR*)&oAbsArea);
	return FALSE;
}

/***************************************************************************************
*	Function 	: 	_ListItemFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_DVDVR_LISTITEM display function.
****************************************************************************************/
STATIC BOOL _ListItemFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	MSO_DVDVR_LISTITEM __NEAR* pObject = (MSO_DVDVR_LISTITEM __NEAR*)pThis;
	MS_DESCRIPTOR_DVDVR_LISTITEM* pDescriptor = (MS_DESCRIPTOR_DVDVR_LISTITEM*)pThis->mpDescriptor;
	UINT16 wColor = pObject->moParam.mbIsPlaying ? pDescriptor->mpColorSetText->mcFocused : pDescriptor->mpColorSetText->mcDefault;	
	MS_AREA oAbsArea;
	FORMATED_UNICODE_STRING oFormUniStr;	

	oAbsArea.msX 	= pAbsArea->msX;
	oAbsArea.msY 	= pAbsArea->msY;
	oAbsArea.mwW	= DVDVR_LISTITEM_CREATIONTIME_XPOS - 4;
	oAbsArea.mwH 	= pAbsArea->mwH;	

	// Title Name	
	OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pObject->moParam.mwScTitleName);
	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, 
							(MS_AREA __NEAR*)&oAbsArea,
							DVDVR_LISTITEM_TITLENAME_XPOS,
							(pAbsArea->mwH >> 1) ,
							ALIGN_H_LEFT,
							ALIGN_V_CENTER,
							wColor);	

	// Creation Time
	OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pObject->moParam.mwScCreationTime);
	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, 
							pAbsArea,
							DVDVR_LISTITEM_CREATIONTIME_XPOS,
							(pAbsArea->mwH >> 1) ,
							ALIGN_H_LEFT,
							ALIGN_V_CENTER,
							wColor);

	if(MS_IsFocused(pThis) && (NULL != pDescriptor->mpBmpSetBg))
		OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBmpSetBg->mpFocused, pAbsArea);
	
	return FALSE;
}

/***************************************************************************************
* 	Public functions
****************************************************************************************/

/***************************************************************************************
*	Function	:	ODVDVR_OpenAtPos
*
*	In		:	pParent		=	Pointer to the parent container.
*
*				wStartX		=	X position of the component. The default position (specified in the 
*								descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
*				wStartY		=	Y position of the component.The default position (specified in the 
*								descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
*				bDisplayOriginalPGC:	TRUE  = Display the Original Program Chain.
*									FALSE = Display the User Defined Program Chain.
*
*	Out		:	None.
*
*	Return	:	Pointer to the DVDVR component if opened successfully, otherwise NULL.
*
*	Desc	: 	Creates, and displays a DVDVR component at a specified position.
****************************************************************************************/
MSO_OBJECT __NEAR* ODVDVR_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY, BOOL bDisplayOriginalPGC)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pDVDVRWnd = NULL;	

		MS_ASSERT(MS_IsContainer(pParent));

		pDVDVRWnd = MS_CreateAndAddObject((MS_DESCRIPTOR*)&oDVDVRDescriptor, pParent);

		if(NULL != pDVDVRWnd)
		{
			PGC_TYPE tProgramChain = bDisplayOriginalPGC ? PGC_TYPE_ORIGINAL : PGC_TYPE_USERDEFINED;
			
			MS_SendOperation(pDVDVRWnd, MS_OP_OPEN, 0);
			MS_SendOperation(pDVDVRWnd, MS_OP_INIT, tProgramChain);
			
			if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
			{
				wStartX = (DEFAULT_POSITION == wStartX) ? pDVDVRWnd->mpDescriptor->moArea.msX : wStartX;
				wStartY = (DEFAULT_POSITION == wStartY) ? pDVDVRWnd->mpDescriptor->moArea.msY : wStartY;
				MS_ObjectMove(pDVDVRWnd, wStartX, wStartY);
			}		
			MS_DisplayAddObject(pDVDVRWnd);
		}
		return pDVDVRWnd;
	}
	return NULL;
}

#endif //D_GUI_COMPONENT_DVDVR

⌨️ 快捷键说明

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