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

📄 o_tvguardian.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 3 页
字号:
*
*	In		:
*
*	Out		:
*
*	Desc 	:	The MSO_ACTIVATION_CODE display function.
****************************************************************************************/
static BOOL _ActivationCodeEditFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	FORMATED_UNICODE_STRING oFormUniStr;

	UINT16 wColor = (MS_IsFocused(pThis)) ? EDIT_TEXT_COLOR_FOCUSED : EDIT_TEXT_COLOR_UNFOCUSED;
	UINT16 szActivationCode[NBR_ACTIVATION_CODE+1];
	OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
    								(UINT32)((MSO_EDIT __NEAR*)(pThis))->moParam.ScPtr);

	if(oFormUniStr.mcStrLength==0)
	{
		STR_GenerateRepeatChars('-', NBR_ACTIVATION_CODE, szActivationCode, 0, sizeof(szActivationCode));
		OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)szActivationCode);
	}

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

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

	return FALSE;
}





/***************************************************************************************
* 	Display functions of TV Guardian Advertisement Component
****************************************************************************************/

/***************************************************************************************
* 	Choice item action functions
****************************************************************************************/

/***************************************************************************************
*	Function	:	_TVGuardianChoiceAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None.
*
*	Desc		: 	Sets or Gets the value of TV Guardian.
****************************************************************************************/
STATIC void _TVGuardianChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{

	MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;

	if(eMutatorGet == eType)
		pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetTVGModeValue()	);
	else
	{
		CoreAPI_UpdatePlayerSetting(PS_UPDATE_TVG_MODE, wValue);
	}
}

/***************************************************************************************
*	Function	:	_HellDamnOnOffChoiceAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None.
*
*	Desc		: 	Sets or Gets the value of Hell/Damn.
****************************************************************************************/
STATIC void _HellDamnOnOffChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
	MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;

	if(eMutatorGet == eType)
		pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetTVGHellDamnOnOff());
	else
	{
		CoreAPI_UpdatePlayerSetting(PS_UPDATE_TVG_WORDSET,(UINT16)((wValue<<2)+(CoreAPI_GetTVGSexualOnOff()<<1)+CoreAPI_GetTVGReligiousOnOff()));
	}
}

/***************************************************************************************
*	Function	:	_ReligiousOnOffChoiceAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None.
*
*	Desc		: 	Sets or Gets the value of Religious.
****************************************************************************************/
STATIC void _ReligiousOnOffChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
	MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;

	if(eMutatorGet == eType)
		pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetTVGReligiousOnOff());
	else
	{
		CoreAPI_UpdatePlayerSetting(PS_UPDATE_TVG_WORDSET, (wValue+(CoreAPI_GetTVGSexualOnOff()<<1)+(CoreAPI_GetTVGHellDamnOnOff()<<2)));
	}
}

/***************************************************************************************
*	Function	:	_SexualOnOffChoiceAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None.
*
*	Desc		: 	Sets or Gets the value of Sexual.
****************************************************************************************/
STATIC void _SexualOnOffChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
	MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;

	if(eMutatorGet == eType)
		pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetTVGSexualOnOff());
	else
	{
		CoreAPI_UpdatePlayerSetting(PS_UPDATE_TVG_WORDSET,(( wValue<<1)+(CoreAPI_GetTVGHellDamnOnOff()<<2)+CoreAPI_GetTVGReligiousOnOff()));
	}
}

/***************************************************************************************
*	Function	:	_CCModeChoiceAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None.
*
*	Desc		: 	Sets or Gets the CC Mode value.
****************************************************************************************/
STATIC void _CCModeChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
	MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;

	if(eMutatorGet == eType)
		pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetTVGCCValue());
	else
	{
		CoreAPI_UpdatePlayerSetting(PS_UPDATE_TVG_CC, wValue);
	}
}

/***************************************************************************************
*	Function	:	_CCChannelChoiceAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None.
*
*	Desc		: 	Sets or Gets the CC Channel value.
****************************************************************************************/
STATIC void _CCChannelChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
	MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;

	if(eMutatorGet == eType)
			pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetTVGCCChannelValue());
	else
	{
		CoreAPI_UpdatePlayerSetting(PS_UPDATE_TVG_CC_CHANNEL, wValue);
	}
}


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

/***************************************************************************************
*	Function	:	OTVGUARDIAN_OpenSetup
*
*	In		:	pParent		=	Pointer to the parent container.
*
*	Out		:	None.
*
*	Return	:	Pointer to the TVGuardian Setup component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a TVGuardian Setup component.
****************************************************************************************/
STATIC MSO_OBJECT __NEAR* _OTVGUARDIAN_OpenSetup(MSO_CONTAINER __NEAR* pParent)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pTVGSetup= (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oTVGuardianSetupDescriptor, pParent);							
		MS_DisplayAddObject(pTVGSetup);
		return pTVGSetup;
	}
	return NULL;
}

/***************************************************************************************
*	Function	:	OTVGUARDIAN_OpenActivation
*
*	In		:	pParent		=	Pointer to the parent container.
*
*	Out		:	None.
*
*	Return	:	Pointer to the TVGuardian Activation component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a TVGuardian Activation component.
****************************************************************************************/
 STATIC MSO_OBJECT __NEAR* _OTVGUARDIAN_OpenActivation(MSO_CONTAINER __NEAR* pParent)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pTVGActivation= (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oTVGuardianActivationDescriptor, pParent);							
		MS_DisplayAddObject(pTVGActivation);
		return pTVGActivation;
	}
	return NULL;
}

/***************************************************************************************
*	Function	:	OTVGUARDIAN_OpenAdvertisement
*
*	In		:	pParent		=	Pointer to the parent container.
*
*	Out		:	None.
*
*	Return	:	Pointer to the TVGuardian Advertisement component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a TVGuardian Advertisement component.
****************************************************************************************/
 STATIC MSO_OBJECT __NEAR* _OTVGUARDIAN_OpenAdvertisement(MSO_CONTAINER __NEAR* pParent)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pTVGAdvertisement= (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oTVGuardianAdvertisementDescriptor, pParent);							
		MS_DisplayAddObject(pTVGAdvertisement);
		return pTVGAdvertisement;
	}
	return NULL;
}

/***************************************************************************************
*	Function	:	OTVGUARDIAN_OpenSetupHelp
*
*	In		:	pParent		=	Pointer to the parent container.
*
*	Out		:	None.
*
*	Return	:	Pointer to the TVGuardian Setup Help component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a TVGuardian Setup Help component.
****************************************************************************************/
 STATIC MSO_OBJECT __NEAR* _OTVGUARDIAN_OpenSetupHelp(MSO_CONTAINER __NEAR* pParent)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pTVGSetupHelpt= (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oTVGuardianSetupHelpDescriptor, pParent);							
		MS_DisplayAddObject(pTVGSetupHelpt);
		return pTVGSetupHelpt;
	}
	return NULL;
}
/***************************************************************************************
*	Function	:	OTVGuardianComponent_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 brightness_edge_controller component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a brightness_edge_controller component at a specified position.
****************************************************************************************/
MSO_OBJECT __NEAR* OTVGuardianComponent_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
		if(NULL != pParent)
		{
			MSO_OBJECT __NEAR* pObject;
			pObject = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oTVGuardianComponentDescriptor, pParent);	
			if(NULL != pObject)
			{
				if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
				{
					wStartX = (DEFAULT_POSITION == wStartX) ? pObject->mpDescriptor->moArea.msX : wStartX;
					wStartY = (DEFAULT_POSITION == wStartY) ? pObject->mpDescriptor->moArea.msY : wStartY;
					MS_ObjectMove(pObject, wStartX, wStartY);
				}
				MS_DisplayAddObject(pObject);
				return pObject;
			}
		}
		return NULL;

}

#endif // TV_GUARDIAN_ENABLE

⌨️ 快捷键说明

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