📄 uiop_lib.c
字号:
/* **************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: UIOP_Library.c
*
* Description:
* ============
* Defines all the public UIOP Handler Functions
*
****************************************************************************************/
#include "Config.h"
#include "Include\SysDefs.h"
#ifdef DEBUG_UI_TRACE
#undef IFTRACE
#define IFTRACE if (gTraceUI)
#include "Debug\DbgMain.h"
#endif //DEBUG_UI_TRACE
#ifndef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif
#include "Kernel\ker_api.h"
#include "Kernel\EventDef.h"
#include "services\include\_heap.h"
#include "Playcore\Coremain\coremain.h"
#include "Playcore\Coremain\coregdef.h"
#include "Playcore\PlayMode\playmode.h"
#include "Playcore\timing\timing.h"
#include "Playcore\Nav_SVCD\SVCD.h"
#ifdef D_GINGER_I96
#include "vpu_api.h"
#include "AudioSetting.h"
#endif
#include "CoreAPI\DeviceManager.h"
#include "Menu\menu_operation_def.h"
#include "Screen\ScreenProcessing.h"
#include "drive_setting\feversion.h"
#include "gui\menu_system\ms_send_op.h"
#include "GUI\menu_system\ms_menu.h"
#include "Library\String_generate.h"
#include "CoreAPI\CoreAPI.h"
#include "User_interface\UI_Manager\UIOP_Lib\uiop_lib.h"
#include "Version.h"
#ifdef TV_GUARDIAN_ENABLE
#include "Playcore\TVG\TVGAPI.h"
#endif
#ifdef dbg_printf(sMsg)
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#endif
#ifdef dbgm_printf(sMsg, mode)
#undef dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif
/*************************************************************************************************************
* Private Macro definition
*
*************************************************************************************************************/
typedef BOOL SCAN_DIRECTION;
#define ScanForward 1
#define ScanBackward 0
typedef BOOL SLOW_DIRECTION;
#define SlowForward 1
#define SlowBackward 0
#define MESSAGE_STR_LEN 20
#define IS_KEY_HOLD ( (TRUE == gcst.mKeyHold) ? TRUE : FALSE )
#define NUMERIC_SELECTION_MOD 10000
#define UI_MIN_AUDIO_STREAM 1
#define UI_MIN_SUBPIC_STREAM 0
#define UI_MIN_ANGLE 1
/*************************************************************************************************************
* data structure
*
*************************************************************************************************************/
BOOL __RAMTYPE g_in_full_stop = TRUE;
DWORD __RAMTYPE g_ui_current_number = 0;
extern BOOL __RAMTYPE RESTRICTED_ACCESS;
#ifdef D_10P_KEY
BOOL __RAMTYPE b_current_10PKey = 0;
#endif
#ifdef EXTERNAL_KARAOKE
BYTE gc_Karaoke_mode = KARAOKE_AUTO;
#endif
#ifdef D_VIDOUT_CONTROL_BY_HOTPLUG_ON_UI //<<< ZJS_HN_0009G [112905] : Video out is controlled by hot plug on the ui side.
extern BOOL HotPlugDetect;
extern UINT16 Default_ScanMode;
#endif //D_VIDOUT_CONTROL_BY_HOTPLUG_ON_UI //>>> ZJS_HN_0009G [112905] : Video out is controlled by hot plug on the ui side.
/*************************************************************************************************************
* extern functions
*
*************************************************************************************************************/
/*************************************************************************************************************
* private functions
*
*************************************************************************************************************/
static void _UIOPLib_Send_Event(EVENT evt, void* param);
static void _UIOPLib_Scan(SCAN_DIRECTION ScanDirection);
static void _UIOPLib_Slow(SLOW_DIRECTION slowDirection);
static void _UIOPLib_NumberSelect(INT8 iNum);
static void _UIOPLib_Eject(void);
static void _UIOPLib_Power(void);
static void _UIOPLib_Play(void);
static void _UIOPLib_Stop(void);
static void _UIOPLib_Up(void);
static void _UIOPLib_Down(void);
static void _UIOPLib_Left(void);
static void _UIOPLib_Right(void);
static void _UIOPLib_Enter(void);
static void _UIOPLib_SkipF(void);
static void _UIOPLib_SkipB(void);
static void _UIOPLib_FastF(void);
static void _UIOPLib_FastB(void);
static void _UIOPLib_Menu(void);
static void _UIOPLib_Title(void);
static void _UIOPLib_PBC(void);
static void _UIOPLib_MarkAB(void);
static void _UIOPLib_StepForward(void);
//static void _UIOPLib_StepBackward(void);
static void _UIOPLib_Pause(void);
static void _UIOPLib_SlowF(void);
static void _UIOPLib_SlowB(void);
static void _UIOPLib_Mute(void);
static void _UIOPLib_Audio(void);
static void _UIOPLib_SubTitle(void);
static void _UIOPLib_Angle(void);
static void _UIOPLib_Zoom(void);
#ifdef EZVIEW_ENABLED
static void _UIOPLib_EZView(void);
#endif
static void _UIOPLib_Karaoke(void);
static void _UIOPLib_Shuffle(void);
static void _UIOPLib_3D(void);
static void _UIOPLib_LR(void);
static void _UIOPLib_0(void);
static void _UIOPLib_1(void);
static void _UIOPLib_2(void);
static void _UIOPLib_3(void);
static void _UIOPLib_4(void);
static void _UIOPLib_5(void);
static void _UIOPLib_6(void);
static void _UIOPLib_7(void);
static void _UIOPLib_8(void);
static void _UIOPLib_9(void);
static void _UIOPLib_10P(void);
static void _UIOPLib_Clear(void);
static void _UIOPLib_Return(void);
static void _UIOPLib_Repeat(void);
static void _UIOPLib_TVSys(void);
static void _UIOPLib_MPP(void);
static void _UIOPLib_DolbyEX(void);
static void _UIOPLib_BassMgr(void);
static void _UIOPLib_PageUp(void);
static void _UIOPLib_PageDown(void);
static void _UIOPLib_PrevIndex(void);
static void _UIOPLib_NextIndex(void);
//static void _UIOPLib_Random(void);
static void _UIOPLib_Spectrum(void);
static void _UIOPLib_VideoOutMode(void);
static void _UIOPLib_PSOMode(void);
//static void _UIOPLib_FMam(void);
static void _UIOPLib_Prologic(void);
static void _UIOPLib_PlayPause(void);
#if defined(D_HDMI_ENABLED)||defined(D_HD_COMPONENT_ENABLED)
static void _UIOPLib_SetHDVideoOutResolution(void);
#endif
#ifdef D_DOOR_CONTROLLER
static void _UIOPLib_DoorClose(void);
static void _UIOPLib_DoorOpen(void);
#endif
#ifdef D_LID_CONTROLLER
static void _UIOPLib_LIDClose(void);
static void _UIOPLib_LIDOpen(void);
#endif
#ifdef D_LCD_FLIP
static void _UIOPLib_LCDFlip(void);
#endif
#ifdef D_LCD_DISPLAY_MODE
static void _UIOPLib_LCDDisplayMode(void);
#endif
void UIOPLib_UpdateTempMsg(void);
static void _UIOPLib_Numeric_Key_Action(void);
static void _UIOPLib_Reset(void);
#include "UI_Manager\UIOP_Lib\Custom\Uiop_lib_custom.c"
#include "UI_Manager\UIOP_Lib\Uiop_lib_config.c"
/*************************************************************************************************************
* private functions implementation
*
*************************************************************************************************************/
static void _UIOPLib_Send_Event(EVENT evt, void* param)
{
if(evt)
ie_send_ex(evt, param);
}
/****************************************************************************************************
* Function : _UIOPLib_Scan
*
* Input :
*
* Output : None
*
* Return : None
*
* Description : Executes user requested operation and updates the UI messages accordingly
*
****************************************************************************************************/
#ifndef D_CUSTOM_aScanSpeedStages
CONST SCAN_SPEED aScanSpeedStages[] =
{
SCAN_SPEED_B4,SCAN_SPEED_B3,SCAN_SPEED_B2,SCAN_SPEED_B1,
SCAN_SPEED_OFF,
SCAN_SPEED_F1, SCAN_SPEED_F2,SCAN_SPEED_F3,SCAN_SPEED_F4,
};
CONST INT8 cMaxScanStages = sizeof (aScanSpeedStages)/sizeof (SCAN_SPEED);
#endif //D_CUSTOM_aScanSpeedStages
// TODO: Move this to _uiop_lib_custom and rename aScanSpeedStages
#ifdef D_DVD_SCAN_SPEED_X100
CONST SCAN_SPEED_DVD aScanSpeedStages_DVD[] =
{
SCAN_SPEED_DVD_B4,SCAN_SPEED_DVD_B3,SCAN_SPEED_DVD_B2,SCAN_SPEED_DVD_B1,
SCAN_SPEED_DVD_OFF,
SCAN_SPEED_DVD_F1, SCAN_SPEED_DVD_F2,SCAN_SPEED_DVD_F3,SCAN_SPEED_DVD_F4,
};
#endif //D_DVD_SCAN_SPEED_X100
#ifndef D_CUSTOM__UIOPLib_Scan
static void _UIOPLib_Scan(SCAN_DIRECTION ScanDirection)
{
INT8 cScanDirection;
INT8 cScanStage = 0;
SCAN_SPEED tScanSpeed = SCAN_SPEED_OFF;
if ((DEC_DISC_TYPE_DVD_VIDEO == g_disc_type) && !PCI_DECODED)
return;
if ((PST_STOP == gcs.pstate)
|| ((ScanForward == ScanDirection) && !IS_COP_ENABLE(COP_SCAN))//COP_SCAN is means COP_SCAN_FORWARD in DVD.
|| ((ScanBackward == ScanDirection) && !IS_COP_ENABLE(COP_SCAN_BACKWARD))
#ifdef D_SUPPORT_ABREPEAT_ONLY_INPLAY
|| CoreAPI_IsRepeatABA()
|| CoreAPI_IsRepeatABB()
#endif
|| CoreAPI_IsInMenu())
{
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
return;
}
if(ScanForward == ScanDirection)
cScanDirection = 1; /*cScanDirection indicate scan direction and increase step of tScanSpeed*/
else
cScanDirection = -1;
tScanSpeed = CoreAPI_GetScanSpeed();
if ( (SCAN_SPEED)ERROR_SCAN_SPEED == tScanSpeed )
{
tr_printf(("\nError Scan Speed, can't proceed!\n"));
return;
}
// TODO: Move this to _uiop_lib_custom
#ifdef D_DVD_SCAN_SPEED_X100 // <<< ZJS_KS_0004G : Enable DVD x100 scan.
if( DEC_DISC_TYPE_DVD_VIDEO == g_disc_type )
{
while (( cScanStage < cMaxScanStages) && (aScanSpeedStages_DVD[cScanStage]!= tScanSpeed))
cScanStage ++;
}
else
{
while (( cScanStage < cMaxScanStages) && (aScanSpeedStages[cScanStage]!= tScanSpeed))
cScanStage ++;
}
#else
while (( cScanStage < cMaxScanStages) && (aScanSpeedStages[cScanStage]!= tScanSpeed))
cScanStage ++;
#endif
if ( tScanSpeed * cScanDirection < 0 ) /* here means user want to change scan direction*/
tScanSpeed = SCAN_SPEED_F1*cScanDirection;
else if (cScanStage >= cMaxScanStages) // Not found in Scan Stages table
{
tr_printf(("\nAbnormal Scan Speed from Core: %d!\n",tScanSpeed));
tScanSpeed = SCAN_SPEED_F1*cScanDirection;
}
else if ( (tScanSpeed * cScanDirection == SCAN_SPEED_MAX) && IS_KEY_HOLD)
{
//Reach max speed
MS_SendOp(MS_OP_MSG_PLAYSTATE_SCAN, tScanSpeed);
return;
}
else
{
cScanStage += cScanDirection; /*here cScanDirection used as increase step*/
if ((cScanStage <0)||( cScanStage >= cMaxScanStages)) // Loop Back
{
#ifdef D_SCAN_LOOP_INCLUDE_PLAY_STATE
tScanSpeed = SCAN_SPEED_OFF;//change to play instead of scaning
#else
tScanSpeed = SCAN_SPEED_F1*cScanDirection;
#endif//D_SCAN_LOOP_INCLUDE_PLAY_STATE
}
else
{
#ifdef D_DVD_SCAN_SPEED_X100 //Enable DVD x100 scan.
if( DEC_DISC_TYPE_DVD_VIDEO == g_disc_type )
{
tScanSpeed = aScanSpeedStages_DVD[cScanStage];
}
else
{
tScanSpeed = aScanSpeedStages[cScanStage];
}
#else
tScanSpeed = aScanSpeedStages[cScanStage];
#endif //D_DVD_SCAN_SPEED_X100
}
}
// Tell the core what's happening:
if(CoreAPI_Scan(tScanSpeed))
{
// Tell the user what's happening:
#ifdef D_SCAN_LOOP_INCLUDE_PLAY_STATE
if(tScanSpeed == SCAN_SPEED_OFF)
MS_SendOp(MS_OP_MSG_PLAYSTATE_PLAY, 0);//display "play"
else
MS_SendOp(MS_OP_MSG_PLAYSTATE_SCAN, tScanSpeed);//display current scan speed
#else
MS_SendOp(MS_OP_MSG_PLAYSTATE_SCAN, tScanSpeed);//display current scan speed
#endif//D_SCAN_LOOP_INCLUDE_PLAY_STATE
}
else
{
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
}
}
#endif // D_CUSTOM__UIOPLib_Scan
#ifndef D_CUSTOM__UIOPLib_Slow
/****************************************************************************************************
* Function : _UIOPLib_Slow
*
* Input :
*
* Output : None
*
* Return : None
*
* Description : Executes user requested operation and updates the UI messages accordingly
*
****************************************************************************************************/
const SLOW_SPEED aSlowSpeedStages[] =
{
SLOW_SPEED_B4,SLOW_SPEED_B3,SLOW_SPEED_B2,SLOW_SPEED_B1,
SLOW_SPEED_OFF,
SLOW_SPEED_F1, SLOW_SPEED_F2,SLOW_SPEED_F3,SLOW_SPEED_F4,
};
const INT8 cMaxSlowStages = sizeof (aSlowSpeedStages)/sizeof (SLOW_SPEED);
static void _UIOPLib_Slow(SLOW_DIRECTION slowDirection)
{
INT8 cSlowDirection; /*cSlowDirection indicate slow direction and increase step */
INT8 cSlowStage = 0;
SLOW_SPEED tSlowSpeed = SLOW_SPEED_OFF;
#ifdef D_UI_DVDA_SLOW_PAGE_COMBINE//used as page down for dvd audio
if ( IS_IN_AOTT_DOMAIN && (SI_DISC_TYPE == DEC_DISC_TYPE_DVD_AUDIO) )
{
if(SlowForward == slowDirection)
_UIOPLib_PageDown();
else
_UIOPLib_PageUp();
return;
}
#endif//used as page down for dvd audio
if (CoreAPI_IsRepeatABA() || CoreAPI_IsRepeatABB() || CoreAPI_IsInMenu() || !IS_COP_ENABLE(COP_SLOW )
|| (PST_STOP == gcs.pstate) || (PST_STILL == gcs.pstate))
{
if ((DEC_DISC_TYPE_DVD_VIDEO != g_disc_type) || PCI_DECODED)
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
return;
}
if ( ((SlowForward == slowDirection) && !IS_COP_ENABLE(COP_SCAN)) ||
((SlowBackward == slowDirection) && !IS_COP_ENABLE(COP_SCAN_BACKWARD)) )
{
if ((DEC_DISC_TYPE_DVD_VIDEO != g_disc_type) || PCI_DECODED)
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
return;
}
if(SlowForward == slowDirection)
cSlowDirection = 1;
else
cSlowDirection = -1;
tSlowSpeed = CoreAPI_GetSlowSpeed(); //Get Slow Speed from Core
if ( ERROR_SLOW_SPEED == tSlowSpeed )
{
tr_printf(("\nError Slow Speed, can't proceed!\n"));
return;
}
while (( cSlowStage < cMaxSlowStages) && (aSlowSpeedStages[cSlowStage]!= tSlowSpeed))
cSlowStage ++;
if ( tSlowSpeed * cSlowDirection < 0 ) /* here means user want to change slow direction*/
tSlowSpeed = SLOW_SPEED_F1*cSlowDirection;
else if (cSlowStage >= cMaxSlowStages) // Not found in Slow Stages table
{
tr_printf(("\nAbnormal Slow Speed from Core: %d!\n",tSlowSpeed));
tSlowSpeed = SLOW_SPEED_F1*cSlowDirection;
}
else if ( (tSlowSpeed * cSlowDirection == SLOW_SPEED_MAX) && IS_KEY_HOLD)
{
//Reach max speed
MS_SendOp(MS_OP_MSG_PLAYSTATE_SLOW, tSlowSpeed);
return;
}
else
{
cSlowStage += cSlowDirection; /*here cSlowDirection used as increase step*/
if ((cSlowStage <0)||( cSlowStage >= cMaxSlowStages)) // Loop Back
{
#ifdef D_SLOW_LOOP_INCLUDE_PLAY_STATE
tSlowSpeed = SLOW_SPEED_OFF;
#else
tSlowSpeed = SLOW_SPEED_F1*cSlowDirection;
#endif//D_SLOW_LOOP_INCLUDE_PLAY_STATE
}
else
{
tSlowSpeed = aSlowSpeedStages[cSlowStage];
}
}
// Tell the user what's happening:
#ifdef D_SLOW_LOOP_INCLUDE_PLAY_STATE
if(tSlowSpeed == SLOW_SPEED_OFF)
{
MS_SendOp(MS_OP_MSG_PLAYSTATE_PLAY, 0);
}
else
#endif //D_SLOW_LOOP_INCLUDE_PLAY_STATE
{
MS_SendOp(MS_OP_MSG_PLAYSTATE_SLOW, tSlowSpeed);
}
// Tell the core what's happening:
CoreAPI_Slow(tSlowSpeed);
}
#endif // D_CUSTOM__UIOPLib_Slow
#ifndef D_CUSTOM__UIOPLib_NumberSelect
static void _UIOPLib_NumberSelect(INT8 iNum)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -