📄 parentlevel.c
字号:
/*****************************************************************************
* Copyright (C) 2001 Acer Labs, Inc. All Rights Reserved.
* File: ui_ParentLevel.c
* Contents: ParentLevel process
* History:
* Date By Reason Ver.
* ============ ========= ========== ======
* 2004.5.18 Maggie Liu Create it 1.0
*****************************************************************************/
#include <comsub.h>
#include <pe.h>
#include <panel.h>
#include <osd.h>
#include <nv.h>
#include <ui.h>
#include <ui_sub.h>
#include <panel.h>
#include "../../cstm/fend/frntp.h"
//#include "nmnvlib.h"
#include "normal.h"
//#include "nm_func.h"
#include <stdio.h>
#include <stdlib.h>
#include <audio.h>
//#include <fileopen.h>
#include <rscstruc.h>
#include <resource.h>
#include <platform.h>
//#include <filesys.h>
//#include <setupfunc.h>
//20021115 Tom Yang for perhibit KEY_SETUP start
//#include <atapi.h>
//#include <vobu.h>
#include "uiosd.h"
#include "NMOSD.h"
//#include "../FileopenMenu/MediaPlayerOutlook.h"
BYTE PLPassWdPos;
BYTE PLPassWdCnt;
BYTE PLPassWord[4];
extern BOOL bNeedPLChk;//030814-01lily:for lastplay pl check
//30919 gamble for parental level
BOOL bPLIsChanged;
//30919 gamble for parental level end
extern BOOL bIsFromStop;
/* FOR record NV cmd Parent level value */
DWORD dwNVCmdPL;
/********************************************************************/
/* parent level Sub-function */
/********************************************************************/
/*---------------------------------------------------------------------------
* Function_Name: PLRespondFPKey
* Arguments : None
* Return value : None
* Remark :Change Parent Level sub-function.
*---------------------------------------------------------------------------*/
BYTE PLRespondFPKey(DWORD MsgInput)
{
int i;
BYTE pllevel;
PLAYPOINT playpoint;
ANGLEINFO AngleInfo;
pllevel=dwNVCmdPL;
switch(MsgInput)
{
case V_KEY_0:
case V_KEY_1:
case V_KEY_2:
case V_KEY_3:
case V_KEY_4:
case V_KEY_5:
case V_KEY_6:
case V_KEY_7:
case V_KEY_8:
case V_KEY_9:
if(PLPassWdPos<4)
{
PLPassWord[PLPassWdPos] = (BYTE)'0' + MsgInput - V_KEY_0;
PLPassWdPos++;
if(PLPassWdPos==4)
{
DrawPlInputBox(gui_hdc,PLPassWdPos-1, TRUE);
// DrawPlInputBox(gui_hdc,PLPassWdPos,TRUE);
}
else
{
DrawPlInputBox(gui_hdc,PLPassWdPos-1, TRUE);
DrawPlInputBox(gui_hdc,PLPassWdPos,FALSE);
}
}
break;
case V_KEY_ENTER:
if(PLPassWdPos>=4)
{
PLPassWdPos = 0;
if(CompPass(PLPassWord))
{
ClosePLOSD();
PLPassWord[0]=PLPassWord[1]=PLPassWord[2]=PLPassWord[3]=(BYTE)'0'+10 ;
g_UiCrntSubFunc = UI_SUBFUNC_BASAL;
if(!bNeedPLChk)
{
bIsFromStop=FALSE;
NVSetPWRes(TRUE);
NVSetParentLevel(dwNVCmdPL);
}
else
//030814-01lily:lastplay+parantal level check
{
bNeedPLChk=FALSE;
NVSetParentLevel(dwNVCmdPL);
bIsLastplay=FALSE;
//if(NVLastPlay(&DISCLASTPLAYINFO.LASTPLAYPOINT.PlayInfo))
if(DISCLASTPLAYINFO.LASTPLAYPOINT.PlayInfo.bDomain == TT_DOM)
{
if(NVNoneSPECPTTPlay(&DISCLASTPLAYINFO.LASTPLAYPOINT.PlayInfo, C_STOP_SKIPPG, KEY_NULL))
{
NVPlayModeChg(C_NV_Play, 0);
ClearRectArea(gui_hdc, GUITYPE_MODEGUI);
//added by jane for lgsh bug 198
if (bPlayWithNoOSD)
bPlayWithNoOSD = FALSE;
//end
ShowPlayModeGui(RS_FUN_OSD_PLAY, MSG_NULL );
if (DiscType == C_CDDA || DiscType == C_HDCDDA|| DiscType == C_DTSCD)
CmdUIMsg(C_FP_KEY, C_KEY_DISPLAY);
g_UiCoreState = UI_CORE_PLAY;
SendVFDPart1Show();
SendVFDPart2Show(C_SENDTIMEOK);
bActionCtl = 0;
}
else
{
if (NVFirstPlay())
{
ClearRectArea(gui_hdc, GUITYPE_MODEGUI);
if (DiscType == C_CDDA || DiscType == C_HDCDDA|| DiscType == C_DTSCD )
CmdUIMsg(C_FP_KEY, C_KEY_DISPLAY);
g_UiCoreState = UI_CORE_PLAY;
bActionCtl = 0;
}
else
ShowDiscInfo(MSG_INVALID, MSG_NULL);
}
}
else if(DISCLASTPLAYINFO.LASTPLAYPOINT.PlayInfo.bDomain == VTSM_DOM)
{
bIsLastplay=TRUE;
if(NVLastPlay(&DISCLASTPLAYINFO.LASTPLAYPOINT.PlayInfo))
{
bIsLastplay=FALSE;
NVPlayModeChg(C_NV_Play, 0);
ClearRectArea(gui_hdc, GUITYPE_MODEGUI);
//added by jane for lgsh bug 198
if (bPlayWithNoOSD)
bPlayWithNoOSD = FALSE;
//ends
ShowPlayModeGui(RS_FUN_OSD_PLAY, MSG_NULL );
if (DiscType == C_CDDA || DiscType == C_HDCDDA|| DiscType == C_DTSCD)
CmdUIMsg(C_FP_KEY, C_KEY_DISPLAY);
g_UiCoreState = UI_CORE_PLAY;
SendVFDPart1Show();
SendVFDPart2Show(C_SENDTIMEOK);
bActionCtl = 0;
}
else
{
bIsLastplay=FALSE;
if (NVFirstPlay())
{
ClearRectArea(gui_hdc, GUITYPE_MODEGUI);
if (DiscType == C_CDDA || DiscType == C_HDCDDA|| DiscType == C_DTSCD)
CmdUIMsg(C_FP_KEY, C_KEY_DISPLAY);
g_UiCoreState = UI_CORE_PLAY;
bActionCtl = 0;
}
else
ShowDiscInfo(MSG_INVALID, MSG_NULL);
}
}
else if(DISCLASTPLAYINFO.LASTPLAYPOINT.PlayInfo.bDomain == VMGM_DOM)
{
bIsLastplay=FALSE;
if (NVFirstPlay())
{
ClearRectArea(gui_hdc, GUITYPE_MODEGUI);
if (DiscType == C_CDDA || DiscType == C_HDCDDA|| DiscType == C_DTSCD)
CmdUIMsg(C_FP_KEY, C_KEY_DISPLAY);
g_UiCoreState = UI_CORE_PLAY;
bActionCtl = 0;
}
else
ShowDiscInfo(MSG_INVALID, MSG_NULL);
}
}//end 030814-01lily:lastplay+parantal level check
}
else
{
for(i=0;i<4;i++)
DrawPlInputBox(gui_hdc,i,FALSE);
}
}
break;
case V_KEY_OPEN:
ClosePLOSD();
break;
case V_KEY_POWER:
ClosePLOSD();
return UI_NOUSE_FUNC_MSG;
break;
case V_KEY_CLEAR:
if((PLPassWdPos<=4)&&(PLPassWdPos>0))
{
BYTE bTmp;
bTmp = PLPassWdPos-1;
PLPassWord[bTmp] = (BYTE)'0';
PLPassWdPos--;
if(PLPassWdPos==3)
{
// DrawPlInputBox(gui_hdc,PLPassWdPos+1,FALSE);
DrawPlInputBox(gui_hdc,PLPassWdPos,FALSE);
}
else
{
DrawPlInputBox(gui_hdc,PLPassWdPos+1,FALSE);
DrawPlInputBox(gui_hdc,PLPassWdPos,FALSE);
}
}
break;
#if 0
case V_KEY_POWER:
ClosePLOSD();
bPowerOff = TRUE;
g_VFD_ShowInfo.FPState=C_FP_POWEROFF;
CmdFPMsg(VFD_REFRESH_PART1_SHOW);
if (BEject)
{
CloseTray(1);/*close tray immediately*/
while(g_vATADoorStatus() && (g_iServoCloseTrayTime<8))
delay(450);
if (g_iServoCloseTrayTime==8)
{
// OpenTraySong(0);
delay(500);
}
}
else
{
if (DiscType !=C_NO_DISC)
NVGetDiscISRC(DISCLASTPLAYINFO.dwDiscISRC);
if((DiscType!=C_PICTURE_CD) && (DiscType!=C_FILEOPENDISC)&&(DiscType!=C_CDDA&&DiscType!=C_HDCDDA&&DiscType!=C_DTSCD))
{
DISCLASTPLAYINFO.LASTPLAYPOINT.bPlayEnable = FALSE;
bIsSecondStop = TRUE;
}
Write_BookMark(&DISCLASTPLAYINFO);
}
Write_UserPara();
Write_OptionPara();
NVPlayModeChg(C_NV_Stop, 1);
dly_tsk(1);
ATAPIStopDisc();
ter_tsk(TASK_ID_DT);
dly_tsk(1);
halPowerDown();
FP_StopAll();//maggie add for fix it will show wrong on fld after key power on
FPPowerDown();
break;
#endif
default:
break;
}
/* in chg_PL sub-function, player does not respond other msg */
return UI_IS_FUNC_MSG;
}
/*----------------------------------------------------------------------------
* Function_Name: UiSubFuncPLInit
* Arguments : None
* Return value : None
* Remark : set current subfunction status to PL, and show PL change window.
*----------------------------------------------------------------------------*/
void UiSubFuncPLInit(void)
{
g_UiCrntSubFunc = UI_SUBFUNC_PL;
OpenTrayInPL=0;
// ClearRectArea(gui_hdc, GUITYPE_PLAYMODEGUI);
ClearRectArea(gui_hdc, GUITYPE_SCREEN);
SetTimer(OSD1_TM_ID,PlayModeGUITimer,INFINITETIME);
SetTimer(OSD6_TM_ID, ModeOSDOff, INFINITETIME);
ShowChgPLOSD();
}
/*----------------------------------------------------------------------------
* Function_Name: UiSubFuncPLProc
* Arguments : None
* Return value : None
* Remark : check if the input password is correct.If so,admit NV to change PL.
*----------------------------------------------------------------------------*/
BYTE UiSubFuncPLProc(WORD MsgType, DWORD MsgInput)
{
switch (MsgType)
{
case C_FP_KEY:
return PLRespondFPKey(MsgInput);
default:
return UI_NOUSE_FUNC_MSG;
}
}
/*----------------------------------------------------------------------------
* Function name: BasalRespondNVChgPL
* Arguments: MsgInput:IN, the message content (In fact it is no use).
* Remark: see also UiSubFuncPLProc().
* Remark : Basal respond to the C_NV_CHGPRNT message sended by NV TASK
* When NV finds PL need to be changed,it send message including PL value
* to UI and notices UI to show change PL window and user should input correct
* password then can he change PL according to NV message.
*----------------------------------------------------------------------------*/
void BasalRespondNVChgPL(DWORD MsgInput)
{
dwNVCmdPL = MsgInput;
//30228-01Cr when NV request set to 0, we set as 8
if (dwNVCmdPL == 0)
dwNVCmdPL = 8;
UiSubFuncPLInit();
// Set flag 1: menu close; 2: Parent level changed
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -