📄 setup_para.c
字号:
/*****************************************************************************
*
* Copyright (C) 2001 Acer Labs, Inc. All Rights Reserved. *
* File: setup.c
*
* Contents: setup window
*
* History:
* Date By Reason Ver.
* ============ ======== ============= ======
* 2001.1.31 David Cui Create it 0.1
*
*****************************************************************************/
#include <comsub.h>
#include <ui_sub.h>
#include <nv.h>
#include <platform.h>
#include <ui.h>
#include <osd.h>
#include <panel.h>
#include <rscstruc.h>
#include <resource.h>
#include <setupfunc.h>
#include <stdlib.h>
#include <string.h>
#include <iic.h>
#define KOK_STAGE_ECHO 0
#define KOK_STAGE_KEY 1
#define POST_CALL 0
#define FIRST_CALL 1
extern NOSEQHEADER noseq_DVD;
extern BYTE LtRtDownMixMode;
/************************************************************************
Function : DoKaraOKFunc
Description : Call all the function about KaraOK setup
Arguments : None
Return value : None
**************************************************************************/
void DoKaraOKFunc(void)
{
#if 0
int i;
//KeyControl.fnItemFunc(4); //20030617 Tom Yang mask it // force to init key to eeprom value; tom gao
for (i = 0;i < Page_Kara.bItemNums;i++)
{
(Page_Kara.pSeutpItems[i]->fnItemFunc)(*(Page_Kara.pSeutpItems[i]->CurPara));
}
#endif
}
/************************************************************************
Function : DoSetupFunc
Description : Call all the function about user setup except KaraOK setup
Arguments : BYTE bFirstCall:indicate if now status changes to setup from other
Return value : None
**************************************************************************/
void DoUserSetupFunc(BYTE bFirstCall)
{
int i;
BYTE bSetTestToneCmd = SETUPFUNC_TST_OFF;
//parameter set
//set osd language
SetOSDLanguage(&OSD_Setup_Parameter.bOSDLang);
/*do the func about VIDEO setup, */
if(bFirstCall)
{
if(OSD_Setup_Parameter.bTVOutPut==C_AUTO)
{
if(GetDefSetupPara(GETCMD_TVOUTPUT))
APOprParam.TVSys_Out = C_PAL;
else
APOprParam.TVSys_Out = C_NTSC;
}
else
APOprParam.TVSys_Out = OSD_Setup_Parameter.bTVOutPut;
TransSel4ScanMode(OSD_Setup_Parameter.bScanMode);
TransSel4PausePicture(OSD_Setup_Parameter.bPausePicture);
SetBrightness(OSD_Setup_Parameter.bBrightness);
SetContrast(OSD_Setup_Parameter.bContrast);
SetSaturation(OSD_Setup_Parameter.bSaturation);
/////////////////---> Gordon
// strange: SetVidOut cp. SetVidOutput
// ATTN: OSD_Setup_Parameter.bScanMode=SETUPFUNC_SCANMD_INT
//mi40607 for the setup menu will turn red
if(OSD_Setup_Parameter.bScanMode == SETUPFUNC_SCANMD_VGA)
{
OSD_Setup_Parameter.bVideoOutput = SETUPFUNC_VIDOPUT_VGA;
}
else if(OSD_Setup_Parameter.bScanMode == SETUPFUNC_SCANMD_PROC)
{
OSD_Setup_Parameter.bVideoOutput = SETUPFUNC_VIDOPUT_YUV_CVBS;
}
SetVidOutput(&OSD_Setup_Parameter.bVideoOutput);
//////////////// Gordon <---
SetDisplayMode(&OSD_Setup_Parameter.bDisplayMode);
SetTVScreen(&OSD_Setup_Parameter.bTVScreen);
//SetTVOutput(OSD_Setup_Parameter.bTVOutPut); //Jacky TH Kuo , for memory N/P Switch// 30917_02 Sean for TV encoder setting
OSD_Setup_Parameter.bSlideShow = 2;
SetSlideShowTime(&OSD_Setup_Parameter.bSlideShow);
}
else
{
//by xianzhong 2004.9.11..........begin
if(OSD_Setup_Parameter.bScanMode !=SETUPFUNC_SCANMD_DEFAULT)
{
CaseV_KEY_PROGRESSIVEOFF();
}
OSD_Setup_Parameter.bVideoOutput = SETUPFUNC_VIDOPUT_YUV_CVBS;
SetVidOut(&OSD_Setup_Parameter.bVideoOutput);
//.................................end
SetPausePicture(OSD_Setup_Parameter.bPausePicture);
SetBrightness(OSD_Setup_Parameter.bBrightness);
SetContrast(OSD_Setup_Parameter.bContrast);
SetSaturation(OSD_Setup_Parameter.bSaturation);
SetDisplayMode(&OSD_Setup_Parameter.bDisplayMode);
SetTVScreen(&OSD_Setup_Parameter.bTVScreen);
if(SYSOption.bChannelNum)//indicate set 5.1channel
OSD_Setup_Parameter.bSwitch25 = SETUP_51CH;
else
OSD_Setup_Parameter.bSwitch25 = SETUP_2CH;
}
#if 0
LoadDefKaraOK();//20030617 Tom Yang
DoKaraOKFunc();//20030617 Tom Yang
#endif
/*do the func about AUDIO setup, */
//step 1:APRC basic
/*************Set channel************************/
if(OSD_Setup_Parameter.bSwitch25 == SETUP_51CH)//indicate set 5.1channel
{
SetChannel(SETUPFUNC_CHANNEL_51CH);
PowerOnSetSpeakerSize(SETUPFUNC_LARGE);
for(i=0;i<6;i++)
{
OSD_Setup_Parameter.bSpeakerChannel = i;
//dly_tsk(1);
PowerOnSetSpeakerVolume(SETUPFUNC_0DB);
PowerOnSetSpeakerDistance(1);
}
OSD_Setup_Parameter.bSpeakerChannel = 0;
}
else//indicate set 2 channel
{
SetChannel(SETUPFUNC_CHANNEL_2CH);
M3323AudioEffectSet(C_SPEAKER, SS_FRONT, 2);
M3323AudioEffectSet(C_SPEAKER, SS_SURROUND, 0) ;
M3323AudioEffectSet(C_SPEAKER, SS_CENTER, 0) ;
M3323AudioEffectSet(C_SPEAKER, SS_SUBWOOFER, 0) ;
M3323AudioEffectSet(C_VOLUME, FL_Trim_DB, 0);
M3323AudioEffectSet(C_VOLUME, FR_Trim_DB, 0);
}
/*************Set master volume************************/
//M3323AudioEffectSet(C_VOLUME, MASTER_VOL, 15);
M3323AudioEffectSet(C_VOLUME, MASTER_VOL, OSD_Setup_Parameter.bMasterVolume);
/*************Set testtone************************/
//SetSPTestTone(&bSetTestToneCmd);
M3323AudioEffectSet(C_TEST_TONE,TT_OPTION ,0);
/*************Set DRC************************/
PowerOnSetDRC(&OSD_Setup_Parameter.bDRC);
/*************Set DownMIx************************/
if (LtRtDownMixMode == 1)
{
M3323AudioEffectSet(C_DOWN_MIX, DOWNMIX_MODE, 1);//030813- virtual surround
}
else
{
M3323AudioEffectSet(C_DOWN_MIX, DOWNMIX_MODE, 2);//030813- virtual surround
}
/*************Set digital output************************/
M3323AudioEffectSet(C_IEC, IEC_OPTION, 1);
//M3323AudioEffectSet(&OSD_Setup_Parameter.bDolbyDigital);
/*************Set mirc volume************************/
M3323AudioEffectSet(C_VOLUME, MIC1_VOL, OSD_Setup_Parameter.bKaraVoiceVol) ;
M3323AudioEffectSet(C_VOLUME, MIC2_VOL, OSD_Setup_Parameter.bKaraVoiceVol) ;
/*************Set stereo mode************************/
M3323AudioEffectSet(C_ST_MODE, STEREO_MODE, 0);//set as stereo
//APRC KaraOK
/*************Set vocalcancel************************/
#ifdef _KARAOKE_ENABLE_
OSD_Setup_Parameter.bVocal = 0;
PowerOnSetVocal(&OSD_Setup_Parameter.bVocal);
#else
PowerOnSetVocal(&OSD_Setup_Parameter.bVocal);
#endif
/*************Set echo************************/
//M3323AudioEffectSet(C_ECHO, EC_LEVEL, OSD_Setup_Parameter.bKaraEcho);
OSD_Setup_Parameter.bKaraEcho = 0;
M3323AudioEffectSet(C_ECHO, EC_LEVEL, MappingKokKey(KOK_STAGE_ECHO, OSD_Setup_Parameter.bKaraEcho));
/************* Set Key Shift ************************/
//M3323AudioEffectSet(C_KEY_SHIFT, KS_OPTION,16);
OSD_Setup_Parameter.bKaraKey = 6;
M3323AudioEffectSet(C_KEY_SHIFT, KS_OPTION,MappingKokKey(KOK_STAGE_KEY, OSD_Setup_Parameter.bKaraKey));
/*************Set echo************************/
M3323AudioEffectSet(C_MIC, MIC1_PLUG, 0);
M3323AudioEffectSet(C_MIC, MIC2_PLUG, 0);
//APRC Effect
/*************Set EQ************************/
M3323AudioEffectSet(C_EQ, EQ_OPTION, OSD_Setup_Parameter.bEqualizer);
/*************Set Cinema Effect************************/
M3323AudioEffectSet(C_CINEMA, CINEMA_OPTION, OSD_Setup_Parameter.bCinemaEff);
/*************Set Prologic II************************/
M3323AudioEffectSet(C_PROLOGIC_II, PROLII_EN, OSD_Setup_Parameter.bPrologic);
InitKara(1);
/*do the func about DVD setup*/
SetMenuLanguage(OSD_Setup_Parameter.bMenuLang);
dly_tsk(1);
SetAudioLanguage(OSD_Setup_Parameter.bAudioLang);
dly_tsk(1);
SetSubtitleLanguage(OSD_Setup_Parameter.bSubtitleLang);
dly_tsk(1);
SetParental(&OSD_Setup_Parameter.bParental);
dly_tsk(1);
SetPBC(&OSD_Setup_Parameter.bPBC);
dly_tsk(1);
// CheckDigiOutput(); //20040621-01 draco
AP2PEOprParam.VirtualSurroundMode = FALSE; //for console//set 3d sur in console-->setup-->load default-->console showing is normal but real play is 3d sur
}
void SetupRespondFPMicDetect( DWORD MsgInput )
{
#if 0
if(MsgInput == C_LEFT_MIC_OFF)
{
//Kara_OnOff = C_OFF;
}
else
{
//Kara_OnOff = C_ON;
}
#endif
#ifdef _KARAOKE_ENABLE_
BasalRespondFPMicDetect(MsgInput);
#endif
}
/*****************************************************************************
Function : initParaSetup
Description : when start,Initial the variables OSD_Setup_Parameter & APOprParam
Arguments : None
Return value : None
****************** ************************************************************/
void initParaSetup(void)
{
#if ( _SETUP_MODE==_SETUP_MENU_Enable )
if (OSD_Setup_Parameter.wVerifySum != C_VERSION) //if the EEPROM version is diffrent with default version,rewrite EEPROM by default OSD parameters
{ //before initParaSetup(),Read_UserDate() already read data from EEPROM to OSD data structure
OSD_Setup_Parameter.bPwdNotDefine = 1;
OSD_Setup_Parameter.wVerifySum = C_VERSION;
UserParaToEEPROM(1);
}
#endif/*_SETUP_E_*/
//30909_02 Sean for Close caption Option
#if (CLOSE_CAPTION_SUPPORT==TRUE)
OSD_Setup_Parameter.bCloseCaption = 1;
#else
OSD_Setup_Parameter.bCloseCaption = 0;
#endif
//30909_02 Sean for Close caption Option
OSD_Setup_Parameter.bKaraKey = 6;
OSD_Setup_Parameter.bEqualizer = 0;
/*PE parameter initialize*/
if(OSD_Setup_Parameter.bTVOutPut == C_AUTO)
APOprParam.TVSys_Out = GetDefSetupPara(GETCMD_TVOUTPUT);
else
APOprParam.TVSys_Out = OSD_Setup_Parameter.bTVOutPut;
// 30917_02 Sean for TV encoder setting
//30912_03 Sean for poweron when OSD setting is C_AUTO, video setting error
APOprParam.TVSys_Src = _LOGO_TVSYS; /*record the source attrib from Navigation*/
if (OSD_Setup_Parameter.bTVOutPut==C_AUTO)
{
APOprParam.TVSys_Out = APOprParam.TVSys_Src;
}
//30930_01 Sean for NP switch system die(Bug item 748)
//ShiftOSDData4PN(APOprParam.TVSys_Out);
//30930_01 Sean for NP switch system die(Bug item 748)
//APOprParam.TVSys_Src = NTSC; /*record the source attrib from Navigation*/
//30912_03 Sean for poweron when OSD setting is C_AUTO, video setting error
// 30917_02 Sean for TV encoder setting
APOprParam.initY = 16;
APOprParam.initCb = 128;
APOprParam.initCr = 128;
APOprParam.Brightness = C_NORMAL_BRI;
APOprParam.Contrast = C_NORMAL_CON;
APOprParam.Saturation = C_NORMAL_SAT;
APOprParam.PScanExist = FALSE;
APOprParam.DspMode = Normal;
APOprParam.ZoomXOrg = 0;
APOprParam.ZoomYOrg = 0;
APOprParam.ZoomRatio = zoom_size1;
APOprParam.HSize_Src = _LOGO_WIDTH; /* Source size , get from Navigation */
APOprParam.VSize_Src = _LOGO_HIGH; /* Set by Navigation */
APOprParam.PlayMode = NormalMode;
APOprParam.StartLBA = 0;
APOprParam.EndLBA = 0;
APOprParam.SCRRatio = 1.0;
APOprParam.lpnoseq = &noseq_DVD;
APOprParam.AID = 0xc0;
APOprParam.AudType = C_AC3;
APOprParam.SampFreq_Src = C_44K;
APOprParam.AST_ATR = NULL;
APOprParam.MU_AST_ATR = NULL;
APOprParam.VID = 0xe0;
APOprParam.SID = 0x20;
APOprParam.SPSw = TRUE;
APOprParam.HLSw = FALSE;
APOprParam.SP_PLT = NULL;
APOprParam.lpActColorInfo = NULL;
APOprParam.PlayBuffPtr = LogoBitStream;
APOprParam.PlayBuffLen = LogoSize;
APOprParam.DataDisContinue = FALSE;
APOprParam.UpdateTitleKey = FALSE;
APOprParam.MacroVision_APS_TYPE = APS_TYPE0;
APOprParam.VO_Pause_Type = VO_Pause_HI_RESOLUTION;
APOprParam.PrgsvScanSw = FALSE;
APOprParam.PrgsvScanType = 0;
//mi40607 for the setup menu will turn red
APOprParam.CompositMode = OSD_Setup_Parameter.bVideoOutput;//YPbPr_MII;
APOprParam.BMute = FALSE;
if (SYSOption.bChannelNum == 0)//030813- virtual surround
APOprParam.wAudioChannel = 2;
else
APOprParam.wAudioChannel = 6;
APOprParam.PlayState = psStop;
APOprParam.IsPlayBuf = FALSE;
/*PE parameter initialized*/
}
/*****************************************************************************
* Function : initOSDSetup
* Description : Initial OSD enviornment. Including call all video or audio or system
* setup setting function to do initialization as OSD_Setup_Parameter.
* Arguments : None
* Return value : None
*****************************************************************************/
void initOSDSetup(void)
{
DoUserSetupFunc(FIRST_CALL);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -