📄 ui_input.c
字号:
/****************************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: ui_input.c
*
* Description:
* =========
*
****************************************************************************************************/
#include "Config.h" // Global Configuration - do not remove!
#include "include\sysdefs.h" // Global definition - do not remove!
#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 FILES
****************************************************************************************************/
// Include C Standard
// Include project specific
#include "Kernel\ker_api.h"
#include "Kernel\eventdef.h"
#include "CoreAPI\CoreAPI.h"
#include "UI_Manager\UI_Input\ui_input.h"
#include "UI_Manager\UI_Input\ui_input_pool.h"
#include "UI_Manager\UI_Input\ui_input_ir.h"
#include "UI_Manager\UI_Input\ui_input_fp.h"
#if (defined OEC_UART_SUPPORT)
#include "UI_Manager\UI_Input\ui_input_uart.h"
#endif
/****************************************************************************************************
* DEFINITION: Private named constants
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private macros
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private typedefs
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Public (global) variables
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private (static) variables
****************************************************************************************************/
// <<< Ram.wang_1125_05: modify I86_AV_RECEIVER FUNCTION LIKE AS THOMSON
#ifdef D_I86_AV_RECEIVER
#ifdef D_TUNER_ENABLE
//the array need make some change.
//define function key in radio work mode.
//compare pressed key, send "IE_CORE_PROC_FUNCTIONKEY" massage with param.
static CONST UI_KEY_MAP tuner_key_to_msgparam_map[RADIO_UIOP_LAST]=
{
{UIOP_LEFT, PREV_STEP}, //_UIOPLib_Radio_Left
{UIOP_RIGHT, NEXT_STEP}, //_UIOPLib_Radio_Right
{UIOP_FASTB, PREV_AUTO_SEARCH_STATION}, //_UIOPLib_Radio_Auto_Left
{UIOP_FASTF, NEXT_AUOT_SEARCH_STATION}, //_UIOPLib_Radio_Auto_Right
{UIOP_AUDIO, AUTO_SEARCH_ALL}, //_UIOPLib_Radio_Auto_Preset
{UIOP_0, RADIO_KEY_0}, //_UIOPLib_0
{UIOP_1, RADIO_KEY_1}, //_UIOPLib_1
{UIOP_2, RADIO_KEY_2}, //_UIOPLib_2
{UIOP_3, RADIO_KEY_3}, //_UIOPLib_3
{UIOP_4, RADIO_KEY_4}, //_UIOPLib_4
{UIOP_5, RADIO_KEY_5}, //_UIOPLib_5
{UIOP_6, RADIO_KEY_6}, //_UIOPLib_6
{UIOP_7, RADIO_KEY_7}, //_UIOPLib_7
{UIOP_8, RADIO_KEY_8}, //_UIOPLib_8
{UIOP_9, RADIO_KEY_9}, //_UIOPLib_9
{UIOP_UP, STATION_STORE}, //_UIOPLib_Radio_Memory
{UIOP_SKIPB, RECALL_PREV_STATION}, //_UIOPLib_Radio_Previous_Preset
{UIOP_SKIPF, RECALL_NEXT_STATION}, //_UIOPLib_Radio_Next_Preset
{0x1019, SWITCH_RDS_MODE}, //_UIOPLib_Radio_RDS_Mode
{0x1017, SWITCH_STEREO_MONO}, //_UIOPLib_Radio_Stereo_Mono
{0x1043, RDS_PTY_SHOW}, //_UIOPLib_Radio_PTY_Show
{UIOP_ZOOM, SWITCH_AM_FM}, //_UIOPLib_Radio_AM_FM_SWITCH
{UIOP_DOWN, STATION_RESTORE}, //_UIOPLib_Radio_Restore
};
#endif
#endif
// >>> Ram.wang_1125_05
/****************************************************************************************************
* DECLARATION: Private (static) functions
****************************************************************************************************/
static UINT16 _UIOPPreInterpreter(UINT16 wUIOP);
static UINT16 _MapUICC2UIOP( UINT16 wUICC);
/****************************************************************************************************
* DEFINITION: Public functions
****************************************************************************************************/
#include "UI_Manager\UI_Input\ui_input_config.c"
/**********************************************************************************
* Name :
*
* Purpose :
*
* Input :
*
* Return Value :
*
* Description :
*
* Comments :
*
**********************************************************************************/
EVENT UI_Input_Handler(EVENT event, UINT32 *param)
{
UINT16 wUIOP, wUICC;
switch ( event )
{
case IE_UI_REMOTE_INPUT:
wUICC = UI_ConvertIRKeyToUICC((UINT16)*param);
break;
case IE_UI_FP_INPUT:
wUICC = UI_ConvertFPKeyToUICC((UINT16)*param);
break;
#ifdef OEC_UART_SUPPORT
case IE_UI_UART_INPUT:
wUICC = UI_ConvertUARTKeyToUICC((UINT16)*param);
break;
#endif //OEC_UART_SUPPORT
default:
return event;
}
//Put UICC to KeyPool
UI_INPUT_POOL_Push((UINT16)*param, wUICC);
if (UI_FindInUICCTable(wUICC, (UINT16*)wUICCTableSecretKey))
{
if(UI_SecretOP())
wUIOP = UIOP_NONE;
}
if(!UI_GetSequenceKey(wUICC, &wUIOP))
{
// Mapping UICC to UIOP
wUIOP = _MapUICC2UIOP(wUICC);
}
#if defined(D_VCR_DRM_UI_NOTIFICATION) || defined(D_RESUME_STOP_AFTER_POWER_ON) // <<< ITA_KK_0002G: Customized of the power on action.
if (!IS_POWER_ON)
{
POWER_RESUME = POWER_ON_CLEAR;
switch(wUICC)
{
case UICC_PLAY:
POWER_RESUME = POWER_ON_PLAY;
wUIOP = UIOP_POWER;
break;
case UICC_POWER:
POWER_RESUME = POWER_ON_POWER;
break;
}
}
else
{
extern unsigned char POWER_RESUME;
switch(wUICC)
{
case UICC_EJECT:
POWER_RESUME = POWER_ON_CLEAR;
break;
}
}
#endif // >>> ITA_KK_0002G: Customized of the power on action.
*param = (UINT32)wUIOP;
return IE_UI_INPUT;
}
/**********************************************************************************
* Name :
*
* Purpose :
*
* Input :
*
* Return Value :
*
* Description :
*
* Comments :
*
**********************************************************************************/
UINT16 UI_UIOPInterpreter(UINT16 wUIOP)
{
PLAY_STATE pPlayState = CoreAPI_GetPlayState();
switch(wUIOP)
{
case UIOP_PLAY_PAUSE:
switch (pPlayState)
{
case PST_SCAN: // Fall Through !!!
case PST_SLOW:
#ifndef D_CUSTOMER_MIZUDA
wUIOP = UIOP_PAUSE;
#else
wUIOP = UIOP_PLAY;
#endif
break;
case PST_PLAY:
if ((MEDIA_TYPE_DVD_VIDEO == CoreAPI_GetCurrentMediaType())
&& (SI_DVD_BUTTON_COUNT != 0)) //TODO: Replace SI_DVD_BUTTON_COUNT with core API function.
wUIOP = UIOP_PLAY;
else
wUIOP = UIOP_PAUSE;
break;
case PST_PAUSE: // Fall Through !!!
case PST_STILL: // Fall Through !!!
default:
wUIOP = UIOP_PLAY;
break;
}
break;
#ifdef D_AUDIO_COMBINE_LR_KEY
case UIOP_AUDIO:
if ((MEDIA_TYPE_DVD_VIDEO != CoreAPI_GetCurrentMediaType()) &&
#ifdef DVD_AUDIO_SUPPORT
(MEDIA_TYPE_DVD_AUDIO!= CoreAPI_GetCurrentMediaType()) &&
#endif // DVD_AUDIO_SUPPORT
(MEDIA_TYPE_SVCD != CoreAPI_GetCurrentMediaType()) )
{
wUIOP = UIOP_LR;
}
break;
#endif //D_AUDIO_COMBINE_LR_KEY
#ifndef USE_TITLE_AS_PBC
#ifndef D_PBC_SINGLEKEY
case UIOP_MENU:
if ( (MEDIA_TYPE_VCD== CoreAPI_GetCurrentMediaType()) || (MEDIA_TYPE_SVCD== CoreAPI_GetCurrentMediaType()) )
{
wUIOP = UIOP_PBC;
}
break;
#endif // D_PBC_SINGLEKEY
#endif // USE_TITLE_AS_PBC
#ifdef D_TITLE_COMBINE_RETURN_KEY
case UIOP_TITLE:
if ( (MEDIA_TYPE_VCD== CoreAPI_GetCurrentMediaType()) || (MEDIA_TYPE_SVCD== CoreAPI_GetCurrentMediaType()) )
{
wUIOP = UIOP_RETURN;
}
break;
#endif // D_TITLE_COMBINE_RETURN_KEY
#ifdef D_USE_UP_DOWN_AS_SLOW_KEY
case UIOP_UP: // Fall Through !!!
case UIOP_DOWN:
if(NO_ZOOM != CoreAPI_GetZoomLevel())
break;
//Use Up and Down keys as Slow keys.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -