📄 o_tvsys_warning.c
字号:
/****************************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: o_tvsys_warning.c
*
* Description: Project definition of the MSO_TVSYS_WARNING
* =========
*
****************************************************************************************************/
#include "Config.h" // Global Configuration - do not remove!
#include "include\sysdefs.h" // Global definition - do not remove!
#ifdef D_SETUP_TV_SYSTEM_WARNING_MENU
/****************************************************************************************************
* INCLUDE FILES
****************************************************************************************************/
#include "gui\menu_system\ms_display.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_send_op.h"
#include "GUI\Menu_system\ms_component.h"
#include "Font\fonts.h"
#include "GUI\Resource\Bitmap\bitmap.h"
#include "GUI\Object_class\Confirm\mso_confirm.h"
#include "Setup\setup_menu.h"
#include "Menu\menu_operation_def.h"
#include "Library\String_generate.h"
#include "Components\TV_system_warning\o_tvsys_warning.h"
#include "Components\TV_system_warning\o_tvsys_warning_config.h"
#include "Components\Custom\TV_system_warning\o_tvsys_warning_custom.h"
/****************************************************************************************************
* DECLARATION: Private (static) functions
****************************************************************************************************/
STATIC MS_OP _TVSysWarningOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _NewSettingConfirmOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC BOOL _NewSettingConfirmFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
/**************************************************************************
* Display functions
***************************************************************************/
//STATIC void _ConfirmTVSysWarningStep1Action(BOOL bConfirmed);
//STATIC void _ConfirmTVSysWarningStep2Action(BOOL bConfirmed);
/**************************************************************************
* Utility functions
***************************************************************************/
/**************************************************************************
* Operation functions
***************************************************************************/
#include "Components\Custom\TV_system_warning\o_tvsys_warning_custom.c"
#include "Components\TV_system_warning\o_tvsys_warning_config.c"
/**************************************************************************
* Function : _TVSysWarningOperation
*
* In :
*
* Out :
*
* Desc :
***************************************************************************/
STATIC MS_OP _TVSysWarningOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
{
UINT8 cWarningType = (UINT8)lParam;
MS_DESCRIPTOR* pObjectComponentDescriptor = NULL;
((MSO_TVSYS_WARNING __NEAR*)pThis)->moParam.mcWarningType = cWarningType;
switch(cWarningType)
{
case WARNING_TYPE_PAL_TO_NTSC:
pObjectComponentDescriptor = (MS_DESCRIPTOR*)&oTVSysWarningPALToNTSCDescriptor;
break;
case WARNING_TYPE_NTSC_TO_PAL:
pObjectComponentDescriptor = (MS_DESCRIPTOR*)&oTVSysWarningNTSCToPALDescriptor;
break;
case WARNING_TYPE_PAL_TO_AUTO:
pObjectComponentDescriptor = (MS_DESCRIPTOR*)&oTVSysWarningPALToAutoDescriptor;
break;
case WARNING_TYPE_AUTO_TO_PAL:
pObjectComponentDescriptor = (MS_DESCRIPTOR*)&oTVSysWarningAutoToPALDescriptor;
break;
case WARNING_TYPE_NTSC_TO_AUTO:
pObjectComponentDescriptor = (MS_DESCRIPTOR*)&oTVSysWarningNTSCToAutoDescriptor;
break;
case WARNING_TYPE_AUTO_TO_NTSC:
pObjectComponentDescriptor = (MS_DESCRIPTOR*)&oTVSysWarningAutoToNTSCDescriptor;
break;
case WARNING_TYPE_ACTIVATE_PSO:
pObjectComponentDescriptor = (MS_DESCRIPTOR*)&oTVSysWarningActivateProgressiveDescriptor;
break;
default:
break;
}
//open the 1st confirm menu: Changing PAL to NTSC...
if (pObjectComponentDescriptor != NULL)
{
MS_CreateAndAddObject((MS_DESCRIPTOR*)pObjectComponentDescriptor, (MSO_CONTAINER __NEAR*)pThis);
}
}
break;
case MS_OP_SETUP: // when press setup button in newsetting confirm component should first set to before setting.
if(WARNING_TYPE_USE_NEW_SETTING == ((MSO_TVSYS_WARNING __NEAR*)pThis)->moParam.mcWarningType)
MS_SendOperation((MSO_OBJECT __NEAR *)pThis, MS_OP_BUTTON_NO, 0);
break;
case MS_OP_PREPARE_FOR_FREEZE:
if(WARNING_TYPE_USE_NEW_SETTING == ((MSO_TVSYS_WARNING __NEAR*)pThis)->moParam.mcWarningType)
MsOp = MS_OP_BUTTON_NO;
break;
}
MsOp = MS_BasicContainerOperation(pThis, MsOp, lParam);
if(MsOp == MS_OP_BUTTON_YES || MsOp == MS_OP_BUTTON_NO || MsOp == MS_OP_TICK
||MS_OP_POWER == MsOp ||MS_OP_EJECT == MsOp)
{
MS_PARAM_TVSYS_WARNING __NEAR* pParam = (MS_PARAM_TVSYS_WARNING __NEAR*)&(((MSO_TVSYS_WARNING __NEAR*)pThis)->moParam);
switch(pParam->mcWarningType)
{
case WARNING_TYPE_PAL_TO_NTSC:
case WARNING_TYPE_NTSC_TO_PAL:
case WARNING_TYPE_PAL_TO_AUTO:
case WARNING_TYPE_AUTO_TO_PAL:
case WARNING_TYPE_NTSC_TO_AUTO:
case WARNING_TYPE_AUTO_TO_NTSC:
case WARNING_TYPE_ACTIVATE_PSO:
if (MsOp == MS_OP_BUTTON_YES)
{
TVSettingParamAction(pParam->mpDescriptor, (UINT16)pParam->mcTVSYSNewType, FALSE);
//open the 2nd confirm menu: Confirm again to use new setting
MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oTVSysWarningUseNewSettingDescriptor, (MSO_CONTAINER __NEAR*)pThis);
pParam->mcWarningType = WARNING_TYPE_USE_NEW_SETTING;
pParam->mcTimeOutTick = TICK_VALUE_FOR_15S;
MS_DisplayAddObject(pThis);
}
else if(MsOp == MS_OP_BUTTON_NO)
pParam->mcWarningType = WARNING_TYPE_UNDEFINED;
break;
case WARNING_TYPE_USE_NEW_SETTING:
if (MsOp == MS_OP_BUTTON_YES)
pParam->mcWarningType = WARNING_TYPE_CONFIRMED;
else if(MsOp == MS_OP_BUTTON_NO|| MS_OP_POWER == MsOp ||MS_OP_EJECT == MsOp)
{
TVSettingParamAction(pParam->mpDescriptor, (UINT16)pParam->mcTVSYSOldType, FALSE);
pParam->mcWarningType = WARNING_TYPE_UNDEFINED;
}
else if (pParam->mcTimeOutTick != 0)
{
(pParam->mcTimeOutTick)--;
if (pParam->mcTimeOutTick == 0)
{
TVSettingParamAction(pParam->mpDescriptor, (UINT16)pParam->mcTVSYSOldType, FALSE);
#ifdef D_TVSYS_WARNING_RETURN_ORIGINAL
//open the 3rd confirm menu: Return to original setting
MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oTVSysWarningReturnOriginalDescriptor, (MSO_CONTAINER __NEAR*)pThis);
pParam->mcWarningType = WARNING_TYPE_RESTORE_ORIGINAL;
MS_DisplayAddObject(pThis);
#else
pParam->mcWarningType = WARNING_TYPE_UNDEFINED;
#endif//#ifdef D_TVSYS_WARNING_RETURN_ORIGINAL
}
}
break;
#ifdef D_TVSYS_WARNING_RETURN_ORIGINAL
case WARNING_TYPE_RESTORE_ORIGINAL:
if(MsOp != MS_OP_TICK)
pParam->mcWarningType = WARNING_TYPE_UNDEFINED;
break;
#endif //#ifdef D_TVSYS_WARNING_RETURN_ORIGINAL
}
if(pParam->mcWarningType == WARNING_TYPE_UNDEFINED || pParam->mcWarningType == WARNING_TYPE_CONFIRMED)
{
MSO_OBJECT __NEAR *pObject;
//find previously focused object in pThis->mpParent and set focus to it
pObject = MS_ContainerGetPrevFocusObject((MSO_CONTAINER __NEAR*)pThis->mpParent);
if (pObject != NULL)
MS_ScreenSetFocusObject(pObject);
//close the value list of the choice, make the selection valid as the end
if (pParam->mcWarningType == WARNING_TYPE_CONFIRMED)
MS_SEND_OP_OBJECT(pObject, MS_OP_CLOSE_CHOICE, 0);
MS_SetToBeRemoved(pThis);
MS_DisplayAddObject(pThis);
}
}
return MsOp;
}
/**************************************************************************
* Function : _NewSettingConfirmOperation
*
* In :
*
* Out :
*
* Desc :
***************************************************************************/
STATIC MS_OP _NewSettingConfirmOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_TVSYS_CONFIRM __NEAR* pObject = (MSO_TVSYS_CONFIRM __NEAR*)pThis;
MsOp = OCONFIRM_Operation(pThis, MsOp, lParam);
switch (MsOp)
{
case MS_OP_INIT:
pObject->moParam.mcTimer = TICK_VALUE_FOR_15S;
break;
case MS_OP_TICK:
if(pObject->moParam.mcTimer)
{
pObject->moParam.mcTimer--;
if (0==(pObject->moParam.mcTimer%10))//display it every second
MS_DisplayObject(pThis);
}
break;
default:
break;
}
return MsOp;
}
/**************************************************************************
* Display functions
***************************************************************************/
/**************************************************************************
* Function : _NewSettingConfirmFillOSDSeg
*
* In :
*
* Out :
*
* Desc :
***************************************************************************/
STATIC BOOL _NewSettingConfirmFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_CONFIRM* pDescriptor = (MS_DESCRIPTOR_CONFIRM*)pThis->mpDescriptor;
UINT16 cTime = ((MSO_TVSYS_CONFIRM __NEAR*)pThis)->moParam.mcTimer /10;
UINT16 wszTimeTxt[3];
UINT16 wszHintTxt[] = L"Revert to original setting in seconds";
UINT8 cStrLen = 0;
OCONFIRM_FillOSDSeg(pThis, pAbsArea);
STR_GenerateNumericValue((INT32)cTime, wszTimeTxt, 0, 3);
cStrLen = wcslen(wszTimeTxt);
wcsncpy(&wszHintTxt[32/*strlen of "Revert to original setting in "*/ - cStrLen], wszTimeTxt, cStrLen);
oFormUniStr.mtFontIndex = FONT_0;
OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszHintTxt);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
AREA_OSD_MESSAGE_X,
AREA_OSD_MESSAGE_Y + 12 + ((pDescriptor->mcNbrMessages - 1) * AREA_OSD_MESSAGE_H),
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
CIDX_8); //pDescriptor->mwTextColor);
return FALSE;
}
#endif //D_SETUP_TV_SYSTEM_WARNING_MENU
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -