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

📄 o_search_display.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 4 页
字号:
			MS_DisplayAddObject(pThis);
			break;
            
		case MS_OP_ENTER:
			_DoKeyAction(UIOP_REPEAT);
			return MS_OP_NONE;
			
		case MS_OP_TICK:
			{
				MSO_REPEAT __NEAR* pRepeat = (MSO_REPEAT __NEAR*)pThis;
				UINT16 wRepeatNum = _GetRepeatNum();
				
				if (wRepeatNum != pRepeat->moParam.mwRepeatMode)
				{
					pRepeat->moParam.mwRepeatMode = wRepeatNum;
					MS_DisplayAddObject(pThis);	
				}
			}
			break;
	}
	return MsOp;
}

/***************************************************************************************
*	Function	: 	_BtnRepeatABOperation
*
*	In		: 	pThis	=	Pointer to the "RepeatAB" tool button 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 received by the "RepeatAB" button.
****************************************************************************************/
#pragma argsused
static MS_OP _BtnRepeatABOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
		case MS_OP_INIT:
		case MS_OP_ON_DEFROST:
			{
				MSO_REPEATAB __NEAR* pRepeatAB = (MSO_REPEATAB __NEAR*)pThis;

				if( !_IsRepeatABAllowed())
				{
					MS_ClearFocusable(pThis);
					pRepeatAB->moParam.mwRepeatABMode = S_OFF;
				}
				else
				{
					MS_SetFocusable(pThis);
					pRepeatAB->moParam.mwRepeatABMode = _GetRepeatABNum();
				}
			}
			break;

		case MS_OP_FOCUS_CHANGE:
			MS_DisplayAddObject(pThis);
			break;
			
		case MS_OP_ENTER:
			_DoKeyAction(UIOP_MARKAB);
			return MS_OP_NONE;

		case MS_OP_TICK:
			if (MS_IsFocusable(pThis))
			{
				MSO_REPEATAB __NEAR* pRepeatAB = (MSO_REPEATAB __NEAR*)pThis;
				UINT16 wRepeatABNum = _GetRepeatABNum();
				
				if (wRepeatABNum != pRepeatAB->moParam.mwRepeatABMode)
				{
					pRepeatAB->moParam.mwRepeatABMode = wRepeatABNum;
					MS_DisplayAddObject(pThis);	
				}
			}
			break;
	}
	return MsOp;
}

/***************************************************************************************
*	Function	: 	_BtnAngleOperation
*
*	In		: 	pThis	=	Pointer to the "Angle" tool button 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 received by the "Angle" button.
****************************************************************************************/
#pragma argsused
static MS_OP _BtnAngleOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{	
	switch(MsOp)
	{
		case MS_OP_INIT:
		case MS_OP_ON_DEFROST:
			{
				MSO_ANGLE __NEAR* pAngle = (MSO_ANGLE __NEAR*)pThis;

				if (!_IsAngleAllowed())
				{
					MS_ClearFocusable(pThis);
					pAngle->moParam.mwCurrentAngleNum = ERROR_ANGLE_NUM;
					pAngle->moParam.mwTotalAngleNum = ERROR_ANGLE_NUM;	
				}
				else
				{
					MS_SetFocusable(pThis);
					pAngle->moParam.mwCurrentAngleNum = CoreAPI_GetCurrentAngleNum();
					pAngle->moParam.mwTotalAngleNum = CoreAPI_GetTotalAngleNum();	
				}
			}
			break;

		case MS_OP_FOCUS_CHANGE:
			MS_DisplayAddObject(pThis);
			break;
			
		case MS_OP_ENTER:
			_DoKeyAction(UIOP_ANGLE);
			return MS_OP_NONE;
			
		case MS_OP_TICK:
			if (MS_IsFocusable(pThis))
			{
				MSO_ANGLE __NEAR* pAngle = (MSO_ANGLE __NEAR*)pThis;
				UINT16 wCurrentAngleNum = CoreAPI_GetCurrentAngleNum();
				UINT16 wTotalAngleNum = CoreAPI_GetTotalAngleNum();
				
				if ((wCurrentAngleNum != pAngle->moParam.mwCurrentAngleNum)
					||(wTotalAngleNum != pAngle->moParam.mwTotalAngleNum))
				{
					pAngle->moParam.mwCurrentAngleNum = wCurrentAngleNum;
					pAngle->moParam.mwTotalAngleNum = wTotalAngleNum;
					MS_DisplayAddObject(pThis);	
				}
			}
			break;
	}
	return MsOp;
}

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

/***************************************************************************************
*	Function 	: 	_SearchFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_SEARCH_DISPLAY display function.
****************************************************************************************/
STATIC BOOL _SearchDisplayComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	MS_DESCRIPTOR_SEARCH_DISPLAY* pDescriptor = (MS_DESCRIPTOR_SEARCH_DISPLAY*)pThis->mpDescriptor;	

	OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);	

	return FALSE;
}

/***************************************************************************************
*	Function 	: 	_TrackFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	Display function of the Title/Track/Chapter objects.
****************************************************************************************/
STATIC BOOL _TrackFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	FORMATED_UNICODE_STRING oFormUniStr;
	MS_DESCRIPTOR_TRACK* pDescriptor = (MS_DESCRIPTOR_TRACK*)pThis->mpDescriptor;
	MSO_TRACK __NEAR* pTrack = (MSO_TRACK __NEAR*)pThis;
	UINT16 wColor = (MS_IsFocusable(pThis)) ? pDescriptor->mwTextColor : CIDX_4;
	UINT8 cBuffOffset;

	oFormUniStr.mtFontIndex = FONT_0;

	if(INVALID_TRACK == pTrack->moParam.mwTrack)
		cBuffOffset = STR_GenerateRepeatChars('-', 3, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
	else
		cBuffOffset = STR_GenerateNumericValue(pTrack->moParam.mwTrack, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
	oFormUniStr.mszUniStr[cBuffOffset++] = L'/';
	cBuffOffset = STR_GenerateNumericValue(pTrack->moParam.mwTotalTrack, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);
	
	OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							(pAbsArea->mwW - TRACK_RIGHT_PADDING),
							pAbsArea->mwH >> 1,
							ALIGN_H_RIGHT,
							ALIGN_V_CENTER,
							wColor);

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

	return FALSE;
}

/***************************************************************************************
*	Function 	: 	_TimeFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	Display function of the Track/Title Time object.
****************************************************************************************/
STATIC BOOL _TimeFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	FORMATED_UNICODE_STRING oFormUniStr;
	MSO_TIME __NEAR* pTime = (MSO_TIME __NEAR*)pThis;
	MS_DESCRIPTOR_TIME* pTimeDescriptor = (MS_DESCRIPTOR_TIME*)pThis->mpDescriptor;
	UINT16 wColor = (MS_IsFocusable(pThis)) ? pTimeDescriptor->mwTextColor : CIDX_4;
	UINT8 cBuffOffset;
	
	oFormUniStr.mtFontIndex = FONT_0;

	if(MS_IsFocused(pThis))
	{
		cBuffOffset = STR_GenerateTime(pTime->moParam.mdwTime, pTime->moParam.mwNumDigits, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
		oFormUniStr.mszUniStr[cBuffOffset++] = L'/';
		cBuffOffset = STR_GeneratePlaybackTime(pTime->moParam.mwTotalTime, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);
	}
	else
	{	
		cBuffOffset = STR_GeneratePlaybackTime(pTime->moParam.mdwTime, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX+1);
		oFormUniStr.mszUniStr[cBuffOffset++] = L'/';
		cBuffOffset = STR_GeneratePlaybackTime(pTime->moParam.mwTotalTime, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX+1);
	}
	
	OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);

	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							(pAbsArea->mwW - TIME_RIGHT_PADDING),
							(pAbsArea->mwH >> 1),
							ALIGN_H_RIGHT,
							ALIGN_V_CENTER,
							wColor);

	if(MS_IsFocused(pThis))
		OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);
	
	return FALSE;
}

/***************************************************************************************
*	Function 	: 	_BtnRepeatFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_REPEAT display function.
****************************************************************************************/
STATIC BOOL _BtnRepeatFillOSDSeg(MSO_OBJECT __NEAR * pThis, MS_AREA __NEAR * pAbsArea)
{
	MSO_REPEAT __NEAR* pRepeat = (MSO_REPEAT __NEAR*)pThis;
	FORMATED_UNICODE_STRING oFormUniStr;
	MS_DESCRIPTOR_BUTTON* pDescriptor = (MS_DESCRIPTOR_BUTTON*)pThis->mpDescriptor;
	MS_DESCRIPTOR_TEXT* pDescriptorText = (MS_DESCRIPTOR_TEXT*)&(pDescriptor->moDescriptorText);
	UINT16 wColor = OTEXT_GetColorFromSet(pThis, pDescriptorText->mpColorSetText);

	oFormUniStr.mtFontIndex = FONT_0;

	// display bitmap underneath text
	OSDR_FillOsdSegBitmapFitArea(OTEXT_GetBitmapFromSet(pThis, pDescriptorText->mpBmpSetBg), pAbsArea);

	if(MS_IsFocused(pThis) && (NULL != pDescriptorText->mpBmpSetBg))
		OSDR_FillOsdSegBitmapFitArea(pDescriptorText->mpBmpSetBg->mpFocused, pAbsArea);
	
	STR_GenerateOSDMESSAGEString(pRepeat->moParam.mwRepeatMode, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
	
	OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
	
	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							pAbsArea->mwW >> 1,
							pAbsArea->mwH >> 1,
							ALIGN_H_CENTER,
							ALIGN_V_CENTER,
							wColor);

	return FALSE;
}

/***************************************************************************************
*	Function 	: 	_BtnRepeatABFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_REPEATAB display function.
****************************************************************************************/
STATIC BOOL _BtnRepeatABFillOSDSeg(MSO_OBJECT __NEAR * pThis, MS_AREA __NEAR * pAbsArea)
{
	MSO_REPEATAB __NEAR* pRepeatAB = (MSO_REPEATAB __NEAR*)pThis;
	FORMATED_UNICODE_STRING oFormUniStr;
	MS_DESCRIPTOR_BUTTON* pDescriptor = (MS_DESCRIPTOR_BUTTON*)pThis->mpDescriptor;
	MS_DESCRIPTOR_TEXT* pDescriptorText = (MS_DESCRIPTOR_TEXT*)&(pDescriptor->moDescriptorText);
	UINT16 wColor = OTEXT_GetColorFromSet(pThis, pDescriptorText->mpColorSetText);

	oFormUniStr.mtFontIndex = FONT_0;

	// display bitmap underneath text
	OSDR_FillOsdSegBitmapFitArea(OTEXT_GetBitmapFromSet(pThis, pDescriptorText->mpBmpSetBg), pAbsArea);

	if(MS_IsFocused(pThis) && (NULL != pDescriptorText->mpBmpSetBg))
		OSDR_FillOsdSegBitmapFitArea(pDescriptorText->mpBmpSetBg->mpFocused, pAbsArea);
	
	STR_GenerateOSDMESSAGEString(pRepeatAB->moParam.mwRepeatABMode, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);

	OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
	
	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							pAbsArea->mwW >> 1,
							pAbsArea->mwH >> 1,
							ALIGN_H_CENTER,
							ALIGN_V_CENTER,
							wColor);

	return FALSE;
}

/***************************************************************************************
*	Function 	: 	_BtnAngleFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_ANGLE display function.
****************************************************************************************/
STATIC BOOL _BtnAngleFillOSDSeg(MSO_OBJECT __NEAR * pThis, MS_AREA __NEAR * pAbsArea)
{
	MSO_ANGLE __NEAR* pAngle = (MSO_ANGLE __NEAR*)pThis;
	FORMATED_UNICODE_STRING oFormUniStr;
	MS_DESCRIPTOR_BUTTON* pDescriptor = (MS_DESCRIPTOR_BUTTON*)pThis->mpDescriptor;
	MS_DESCRIPTOR_TEXT* pDescriptorText = (MS_DESCRIPTOR_TEXT*)&(pDescriptor->moDescriptorText);
	UINT16 wColor = OTEXT_GetColorFromSet(pThis, pDescriptorText->mpColorSetText);
	UINT8 cBuffOffset;
				
	oFormUniStr.mtFontIndex = FONT_0;

	// display bitmap underneath text
	OSDR_FillOsdSegBitmapFitArea(OTEXT_GetBitmapFromSet(pThis, pDescriptorText->mpBmpSetBg), pAbsArea);

	if(MS_IsFocused(pThis) && (NULL != pDescriptorText->mpBmpSetBg))
		OSDR_FillOsdSegBitmapFitArea(pDescriptorText->mpBmpSetBg->mpFocused, pAbsArea);
	
	cBuffOffset = STR_GenerateUnicodeChar(PRIVATE_SYMBOL_ANGLE, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX + 1);
	if ((ERROR_ANGLE_NUM != pAngle->moParam.mwCurrentAngleNum)
		&&(ERROR_ANGLE_NUM != pAngle->moParam.mwTotalAngleNum))
		STR_GenerateAngle(pAngle->moParam.mwCurrentAngleNum, oFormUniStr.mszUniStr, cBuffOffset, UNISTR_LENGTH_MAX + 1);

	OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
	
	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							pAbsArea->mwW >> 1,
							pAbsArea->mwH >> 1,
							ALIGN_H_CENTER,
							ALIGN_V_CENTER,
							wColor);

	return FALSE;
}

/***************************************************************************************
*	Function	:	OSearch_display_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.
*
*	Out		:	None.
*
*	Return	:	Pointer to the Search component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a Search component at a specified position.
****************************************************************************************/
MSO_OBJECT __NEAR* OSearch_Display_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY, BOOL bPressDigitalKey)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pSearchWnd = NULL;	

		pSearchWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oSearchDisplayDescriptor, pParent);

		if(NULL != pSearchWnd)
		{
			if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
			{
				wStartX = (DEFAULT_POSITION == wStartX) ? pSearchWnd->mpDescriptor->moArea.msX : wStartX;
				wStartY = (DEFAULT_POSITION == wStartY) ? pSearchWnd->mpDescriptor->moArea.msY : wStartY;
				MS_ObjectMove(pSearchWnd, wStartX, wStartY);
			}
			if (bPressDigitalKey)
			{
				MSO_OBJECT __NEAR* pObject = NULL;	
				switch(CoreAPI_GetCurrentMediaType())
				{
					case MEDIA_TYPE_DVD_VIDEO:
						pObject = MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pSearchWnd, (MS_DESCRIPTOR*)&oTitleDescriptor);
						break;

					default:
						pObject = MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pSearchWnd, (MS_DESCRIPTOR*)&oTrackDescriptor);
						break;
				}
				MS_ScreenSetFocusObject(pObject);
			}
			MS_DisplayAddObject(pSearchWnd);
		}

		return pSearchWnd;
	}
	return NULL;
}

#endif

⌨️ 快捷键说明

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