📄 o_prologic2.c
字号:
/* **************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: $Workfile: o_prologic2.c $
*
* Description:
* ============
* Project
*
****************************************************************************************/
#include "Config.h" // Global Configuration - do not remove!
#ifdef D_GUI_PROLOGICII_COMPONENT
#ifdef DEBUG_UI_TRACE
#undef IFTRACE
#define IFTRACE if (gTraceUI)
#include "Debug\DbgMain.h"
#endif //DEBUG_UI_TRACE
#include "include\sysdefs.h"
/***************************************************************************************
* Include files
****************************************************************************************/
#include "include\math-macro.h"
#include "Playcore\ps\ps.h"
#include "Playcore\coremain\coregdef.h"
#include "kernel\eventdef.h"
#include "kernel\ker_api.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_menu.h"
#include "GUI\Menu_system\ms_container.h"
#include "GUI\Menu_system\ms_display.h"
#include "Strings\Strings.h"
#include "Library\Container_misc.h"
#include "CoreAPI\CoreAPI.h"
#include "GUI\Object_class\Text\mso_text.h"
#include "GUI\Object_class\Button\mso_button.h"
#include "GUI\Object_class\Hslider\mso_hslider.h"
#include "GUI\Object_class\Choice\mso_choice.h"
#include "Components\Message\o_message_handler.h"
#include "Components\Prologic\o_prologic2.h"
#include "GUI\Object_class\Vlist\mso_vlist.h"
#include "GUI\Resource\Bitmap\bitmap.h"
#include "Menu\menu_operation_def.h"
#include "Menu_config\menu_config_common.h"
#include "Library\String_generate.h"
#include "gui\menu_system\ms_component.h"
#ifdef D_GINGER_I86
#include "decoder\osdlayou.h"
#endif //D_GINGER_I86
#ifdef D_GINGER_I96
#include "Osdlayou.h"
#endif //D_GINGER_I96
#ifdef I64_STEP_B_PROGRESSIVE
#include "decoder\decoder.h"
#endif
// Include the module header file
#include "Components\Prologic\o_prologic2.h"
// Include configuration header file: named constants, macros and typedefs.
#include "Components\Prologic\o_prologic2_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Components\Custom\Prologic\o_prologic2_custom.h"
#ifndef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif
/***************************************************************************************
* Constants and Macros
****************************************************************************************/
/***************************************************************************************
* Utility functions
****************************************************************************************/
STATIC BOOL _AddItemsToPrologicIIKit(MSO_VLIST __NEAR* pList);
/***************************************************************************************
* Operation functions
****************************************************************************************/
static MS_OP _ProLogicIIPromptOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _PrologicIIKitOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _PrologicIIkitVlistOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _PLIIModeChoiceOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _PanoramaChoiceOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _DimCtrlSliderOperationOnVList(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _CentreWidthSliderOperationOnVList(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
/***************************************************************************************
* Choice item action functions
****************************************************************************************/
static UINT16 _DimCtrlSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
static UINT16 _CentreWidthSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
/***************************************************************************************
* Display functions
****************************************************************************************/
static BOOL _ProLogicIIFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
/***************************************************************************************
* Object definitions
****************************************************************************************/
/***************************************************************************************
* Descriptor : oProLogicIITitleDescriptor
*
* Purpose : Descriptor of main pro logic II compont title.
****************************************************************************************/
// Include custom code file: customer specific code, over-writing common one.
#include "Components\Custom\Prologic\o_prologic2_custom.c"
// Include configuration file: constants.
#include "Components\Prologic\o_prologic2_config.c"
/**************************************************************************
* Function : _ProLogic2PromptOperation
* In :
* Out :
* Desc :
*
***************************************************************************/
#ifndef D_CUSTOM__ProLogicIIPromptOperation
static MS_OP _ProLogicIIPromptOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
break;
case MS_OP_TICK:
if (!CoreAPI_IsMenuAllowedProLogicII())
{
MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
}
break;
// These MS_OP must be returned by the component to be handled by its parents
//In these situation need to close Pro logic II object.
case MS_OP_VOLUME: // Fall Through !!!
//case MS_OP_PROLOGICII: // Temp done
case MS_OP_BOOKMARK:
case MS_OP_SEARCH:
case MS_OP_SLOWF: // Fall through !!!
case MS_OP_SLOWB: // Fall through !!!
case MS_OP_FASTF: // Fall through !!!
case MS_OP_FASTB: // Fall through !!!
case MS_OP_EJECT: // Fall through !!!
case MS_OP_SKIPF: // Fall through !!!
case MS_OP_SKIPB: // Fall through !!!
case MS_OP_LR: // Fall through !!!
case MS_OP_KARAOKE: // Fall through !!!
case MS_OP_STOP: // Fall through !!!
case MS_OP_PLAY: // Fall Through !!!
case MS_OP_PLAY_MODE: // Fall through !!!
case MS_OP_TITLE: // Fall through !!!
case MS_OP_MENU: // Fall through !!!
case MS_OP_PBC:
MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
break;
case MS_OP_PROLOGIC:
MsOp = MS_OP_CLOSE_PARENT;
break;
default :
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
#endif//D_CUSTOM__ProLogicIIPromptOperation
/***************************************************************************************
* Display functions
****************************************************************************************/
#ifndef D_CUSTOM__ProLogicIIFillOSDSeg
#pragma argsused
static BOOL _ProLogicIIFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
//FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_PROLOGIC2* pDescriptor = (MS_DESCRIPTOR_PROLOGIC2*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
return FALSE;
}
#endif//D_CUSTOM__ProLogicIIFillOSDSeg
/**************************************************************************
* Function : _ChoiceOperation
* In :
* Out :
* Desc :
***************************************************************************/
#ifndef D_CUSTOM__PLIIModeChoiceOperation
static MS_OP _PLIIModeChoiceOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, AS_Get_Enhancement_Mode());
//MS_SET_CHOICE_DISABLE(pThis);
}
break;
case MS_OP_ENTER:
{
if(!MS_IS_CHOICE_DISABLED(pThis))
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
UINT16 wValue = OCHOICE_GetValueFromIndex(pThis, pChoice->moParam.mwCurrValIndex);
// Toggle the mic effect value.
if(wValue < M_Mode_Music)
wValue++;
else
wValue = M_Mode_OFF;
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, wValue);
CoreAPI_UpdatePlayerSetting(PS_UPDATE_DEC_MODE, wValue);
// Cancel the music effects mode:
CoreAPI_UpdatePlayerSetting( PS_UPDATE_MUSIC_MODE, M_Mode_CANCEL);
//Empty last time object and Add new object and display.
MS_SendOperation(MS_FindAncestor(pThis, &oPrologicIIKitDescriptor), MS_OP_REFRESH, 0);
}
else
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
}
return MS_OP_NONE;
default:
break;
}
return ChoiceOperation(pThis, MsOp, lParam);
}
#endif//D_CUSTOM__PLIIModeChoiceOperation
/**************************************************************************
* Function : _PanoramaChoiceOperation
* In :
* Out :
* Desc :
***************************************************************************/
#ifndef D_CUSTOM__PanoramaChoiceOperation
static MS_OP _PanoramaChoiceOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, gps->Panorama);
if (M_Mode_Music != AS_Get_Enhancement_Mode())
{
MS_SET_CHOICE_DISABLE(pThis);
}
else
{
MS_CLEAR_CHOICE_DISABLE(pThis);
}
}
break;
case MS_OP_ENTER:
{
if(!MS_IS_CHOICE_DISABLED(pThis))
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
UINT16 wValue = OCHOICE_GetValueFromIndex(pThis, pChoice->moParam.mwCurrValIndex);
// Toggle the mic effect value.
if(wValue < PANORAMA_ON)
wValue++;
else
wValue = PANORAMA_OFF;
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, wValue);
CoreAPI_UpdatePlayerSetting(PS_UPDATE_PANORAMA, wValue);
MS_DisplayAddObject((MSO_OBJECT __NEAR*)pChoice);
}
else
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
}
return MS_OP_NONE;
default:
break;
}
return ChoiceOperation(pThis, MsOp, lParam);
}
#endif//D_CUSTOM__PanoramaChoiceOperation
/***************************************************************************************
* Function : _PrologicIIKitHSliderOperationOnVList
*
* In :
*
* Out :
*
* Desc : The choice operation of all the slider objects.
****************************************************************************************/
#ifndef D_CUSTOM__DimCtrlSliderOperationOnVList
#pragma argsused
static MS_OP _DimCtrlSliderOperationOnVList(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing
switch(MsOp)
{
case MS_OP_LEFT: // Fall Through !!!
case MS_OP_RIGHT:
{
// Do nothing if disabled.
if(MS_IS_CHOICE_DISABLED(pThis))
{
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -