setup_tab_reeng.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:180k
- osd_draw_rect(X_60-4, yyStart-2, 32+8, yyLen, clrCursorColor);
-
- }
- #ifdef NO_SHOW_ADD_ICON//zhaoyanhua add 2003-12-9 17:41
- if ( (id==STR_OS_CSPK_DELAY) || (id==STR_OS_SSPK_DELAY) )
- osd_DrawLine(X_76, yStart+28-4, X_76, yStart+yDelta+32+8, fontColor, 3);
- else
- #endif
- #ifdef ADD_DVI311_SETUP
- if(id == STR_OS_DVI311_MODE)
- {
- #define X_60_1 SETUP_SUB_XSTART*16+60+30
- #define X_76_1 SETUP_SUB_XSTART*16+76+30
- #define X_94_1 SETUP_SUB_XSTART*16+94+30
- #define X_96_1 SETUP_SUB_XSTART*16+96+30
- osd_DrawLine(X_76_1, yStart+28, X_76_1, yStart+yDelta+32, fontColor, 3);
- osd_draw_rect(X_60_1, yNew, 32, 8, bgColor);
- //top
- if (p_scan==1)
- osd_DrawLine(X_60_1, yNew, X_96_1, yNew, uColor, 2);
- else
- osd_DrawLine(X_60_1, yNew, X_96_1, yNew, uColor, 1);
- //left
- osd_DrawLine(X_60_1, yNew, X_60_1, yNew_8, uColor, 1);
- //botton
- if (p_scan==1)
- osd_DrawLine(X_60_1, yNew_8, X_96_1, yNew_8, dColor, 2);
- else
- osd_DrawLine(X_60_1, yNew_8, X_96_1, yNew_8, dColor, 1);
- //right
- osd_DrawLine(X_94_1, yNew, X_94_1, yNew_8, dColor, 1);
- }
- else
- #endif//#ifdef ADD_DVI311_SETUP
- {
- osd_DrawLine(X_76, yStart+28, X_76, yStart+yDelta+32, fontColor, 3);
- osd_draw_rect(X_60, yNew, 32, 8, bgColor);
- //top
- if (p_scan==1)
- osd_DrawLine(X_60, yNew, X_96, yNew, uColor, 2);
- else
- osd_DrawLine(X_60, yNew, X_96, yNew, uColor, 1);
- //left
- osd_DrawLine(X_60, yNew, X_60, yNew_8, uColor, 1);
- //botton
- if (p_scan==1)
- osd_DrawLine(X_60, yNew_8, X_96, yNew_8, dColor, 2);
- else
- osd_DrawLine(X_60, yNew_8, X_96, yNew_8, dColor, 1);
- //right
- osd_DrawLine(X_94, yNew, X_94, yNew_8, dColor, 1);
- }
- }
- #endif //end of DVD_SETUP_REENG
- #if 0//ndef SETUP_DVD_REENG
- void revise_val(int dir, INT8 *x,int max,int min)
- {
- if (dir)
- {
- if (*x < max) (*x)++;
- } else
- {
- if (*x > min) (*x)--;
- }
- }
- #endif
- //=============================================
- //for DVD_SETUP_REENG //added by JS //20040728
- #if 0//ndef DVD_SETUP_REENG
- //If the item(id) is scaleable, here we will do it's corresponding action by dir(down=0, up=1)
- void setup_CookScaleItem(UINT8 id, UINT8 dir)
- {
- int val = SETUP_ECHO; // give a default value
- if (id==STR_OS_ECHO) {
- //echo_level(0 ~ 8)
- revise_val(dir,&echo_level,8,0);
- SETUP_ECHO = echo_level+2;
- #ifdef USE_MIC_ECHO_PARAM
- AudioSetEchoPara(echo_level);
- #else
- AudioSetEcho(echo_level, echo_level);
- #endif
- val=SETUP_ECHO;
- } else
- #ifdef Ti3001_OSD_UI_2
- if (id==STR_OS_AMP_MAINVOLUME)
- {
- //echo_level(0 ~ 8)
- revise_val(dir,&_volume_level,14,0);
- SETUP_AMP_VOLUME = amp_volume_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_volume_level=%dn",amp_volume_level);
- //audio_volume=amp_volume_level;
- //AudioSetVolume(audio_volume);
- ti_set_volume(SET_TOTAL_VOLUME,amp_volume_level*7);
- val=SETUP_AMP_VOLUME;
- } else
- if (id==STR_OS_AMP_FSPK)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_fspk_level,14,0);
- SETUP_AMP_FSPK = amp_fspk_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_fspk_level=%d,amp_fspk_balance_level=%dn",amp_fspk_level,amp_fspk_balance_level);
- set_tas3001ch_volume(FSPK,amp_fspk_balance_level,amp_fspk_level*7);
- val=SETUP_AMP_FSPK;
- } else
- if (id==STR_OS_AMP_FSPK_BALANCE)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_fspk_balance_level,14,0);
- SETUP_AMP_FSPK_BALANCE = amp_fspk_balance_level+2;
- //printf("amp_fspk_level=%d,amp_fspk_balance_level=%dn",amp_fspk_level,amp_fspk_balance_level);
- set_tas3001ch_volume(FSPK,amp_fspk_balance_level,amp_fspk_level*7);
- //AudioSetEcho(echo_level, echo_decay);
- val=SETUP_AMP_FSPK_BALANCE;
- } else
- if (id==STR_OS_AMP_SSPK)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_sspk_level,14,0);
- SETUP_AMP_SSPK = amp_sspk_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_sspk_level=%d,amp_sspk_balance_level=%dn",amp_sspk_level,amp_sspk_balance_level);
- set_tas3001ch_volume(SSPK,amp_sspk_balance_level,amp_sspk_level*7);
- val=SETUP_AMP_SSPK;
- } else
- if (id==STR_OS_AMP_SSPK_BALANCE)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_sspk_balance_level,14,0);
- SETUP_AMP_SSPK_BALANCE = amp_sspk_balance_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_sspk_level=%d,amp_sspk_balance_level=%dn",amp_sspk_level,amp_sspk_balance_level);
- set_tas3001ch_volume(SSPK,amp_sspk_balance_level,amp_sspk_level*7);
- val=SETUP_AMP_SSPK_BALANCE;
- } else
- if (id==STR_OS_AMP_CSPK)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_cspk_level,14,0);
- SETUP_AMP_CSPK = amp_cspk_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_cspk_level=%d,amp_subwoofer_level=%dn",amp_cspk_level,amp_subwoofer_level);
- set_tas3001ch_volume(CSSPK,amp_cspk_level/(amp_subwoofer_level+1),amp_cspk_level*7);
- val=SETUP_AMP_CSPK;
- } else
- if (id==STR_OS_AMP_SUBWOOFER)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_subwoofer_level,14,0);
- SETUP_AMP_SUBWOOFER = amp_subwoofer_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_cspk_level=%d,amp_subwoofer_level=%dn",amp_cspk_level,amp_subwoofer_level);
- set_tas3001ch_volume(CSSPK,amp_cspk_level/(amp_subwoofer_level+1),amp_subwoofer_level*7);
- val=SETUP_AMP_SUBWOOFER;
- } else
- if (id==STR_OS_AMP_BASS)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_bass_level,12,0);
- SETUP_AMP_BASS = amp_bass_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_bass_level=%dn",amp_bass_level);
- ti_set_volume(SET_BASS ,(amp_bass_level-6)*2);
- val=SETUP_AMP_BASS;
- } else
- if (id==STR_OS_AMP_TREMBLE)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_tremble_level,12,0);
- SETUP_AMP_TREMBLE = amp_tremble_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_tremble_level=%dn",amp_tremble_level);
- ti_set_volume(SET_TREBLE ,(amp_tremble_level-6)*2);
- val=SETUP_AMP_TREMBLE;
- } else
- if (id==STR_OS_AMP_DYNAMICRANGE)
- {
- //echo_decay(0 ~ 8)
- revise_val(dir,&_dynamic_level,12,0);
- SETUP_AMP_DYNAMIC = amp_dynamic_level+2;
- //AudioSetEcho(echo_level, echo_decay);
- //printf("amp_dynamic_level=%dn",amp_dynamic_level);
- ti_set_volume(SET_DRC ,6-amp_dynamic_level/2);
- val=SETUP_AMP_DYNAMIC;
- } else
- #endif
- if (id==STR_OS_KEY) {
- //audio_key(-6 ~ 6)
- #ifdef SUPPORT_PROLOGIC_II
- if (SETUP_PROLOGIC_II!=4)
- {
- SETUP_PROLOGIC_II=4; // alan, 2003/8/11 01:56PM
- exe_setup_function(STR_OS_PROLOGIC,STR_OS_OFF,0);
- run_save_sel_cmd(AUDPAGE, PROLOGIC_II);//nono 2004-2-16 9:28
- }
- #endif
- revise_val(dir,&audio_key,6,-6);
- val=audio_key+2;
- SETUP_KEY = val+6;
- AudioSetKey(SETUP_KEY); //audio_key:-6 ~ 6, map to 1~15
- } else
- if (id==STR_OS_MIC_VOL||id==STR_OS_MIC_VOL_1||id==STR_OS_MIC_VOL_2) {//wangfeng 2003-09-12 17:12
- //mic_volume(0 ~ 8)
- revise_val(dir,&mic_volume,8,0);
- //#ifdef MIC_2CHANNEL //wangfeng 2003-09-12 21:40
- //if(id==STR_OS_MIC_VOL||id==STR_OS_MIC_VOL_1)
- //mic_volume=SETUP_MIC_VOL;
- //else if(id==STR_OS_MIC_VOL_2)
- //mic_volume=SETUP_MIC_VOL_2;
- //#endif
- if(id==STR_OS_MIC_VOL||id==STR_OS_MIC_VOL_1)
- {
- SETUP_MIC_VOL = mic_volume+2;
- AudioSetMICVol(mic_volume);
- //AudioSetMICVol(SETUP_MIC_VOL-2);
- val=SETUP_MIC_VOL;
- }
- #ifdef MIC_2CHANNEL
- else if(id==STR_OS_MIC_VOL_2)
- {
- SETUP_MIC_VOL_2 = mic_volume+2;
- AudioSetMICVol_2(mic_volume);
- val=SETUP_MIC_VOL_2;
- }
- #endif
- #ifdef FUSS_DVD //Jeff 20020524
- if ( setup_IsMICOff() ) {
- setup_SetMICAuto();
- }
- #endif
- //AudioSetMICVol(mic_volume);
- //val=SETUP_MIC_VOL;
- } else
- #ifndef AC3_BASS_MANAGEMENT
- if (id==STR_OS_FSPK) {
- revise_val(dir,&SETUP_SPK_FRONT,10,2);
- val=SETUP_SPK_FRONT;
- #ifdef YUXING_DVD
- fspk_volume=SETUP_SPK_FRONT-4;
- #endif
- //set front speaker gain
- AudioSetFSPKGain(SETUP_SPK_FRONT-2);
- } else
- if (id==STR_OS_CSPK) {
- revise_val(dir,&SETUP_SPK_CENTER,10,2);
- val=SETUP_SPK_CENTER;
- #ifdef YUXING_DVD
- cspk_volume=SETUP_SPK_CENTER-4;
- #endif
- //set center speaker gain
- AudioSetCSPKGain(SETUP_SPK_CENTER-2);
- } else
- if (id==STR_OS_SSPK) {
- revise_val(dir,&SETUP_SPK_SURROUND,10,2);
- val=SETUP_SPK_SURROUND;
- #ifdef YUXING_DVD
- sspk_volume=SETUP_SPK_SURROUND-4;
- #endif
- //set surround speaker gain
- AudioSetSSPKGain(SETUP_SPK_SURROUND-2);
- } else
- #endif
- if (id==STR_OS_CSPK_DELAY) {
- #ifdef NO_SHOW_ADD_ICON//zhaoyanhua add 2003-12-9 17:18
- revise_val(dir,&SETUP_SPK_CENTER_DELAY,8,2);//0~6MS
- #else
- revise_val(dir,&SETUP_SPK_CENTER_DELAY,7,2);
- #endif
- val=SETUP_SPK_CENTER_DELAY;
- //set center speaker delay, 1:center speaker
- AudioSetSpkDelay(1, SETUP_SPK_CENTER_DELAY-2);
- } else
- #ifdef ADD_DVI311_SETUP
- if (id==STR_OS_DVI311_MODE)
- {
- revise_val(dir,&dvi311_mode,6,0);//6 为等级数
- //kevin add for limit the functions of display @2k40514
- if (((dvi311_tv_mode>0x84)//NTSC or PAL60
- &&(dvi311_mode==1))//576P
- ||((dvi311_tv_mode==0x84)//PAL
- && (dvi311_mode==2)))//480P
- {
- if(dir)
- dvi311_mode+=1;
- else
- dvi311_mode-=1;
- }
- val = dvi311_mode+2;
- psprintf(linebuf, "dvi311_mode %xn", dvi311_mode);
- epp_write_wait(linebuf);
- scaler_main(); //040512
- }else
- #endif
- if (id==STR_OS_DYNAMICRANGE) { //Jeff 20020604
- revise_val(dir,&ac3_dynarange,8,0);
- SETUP_AC3DIGITAL_DYNA = ac3_dynarange+2;
- val = SETUP_AC3DIGITAL_DYNA;
- set_AC3DynamicRange();
- } else if (id==STR_OS_SSPK_DELAY)
- {
- #ifdef NO_SHOW_ADD_ICON//zhaoyanhua add 2003-12-9 17:18
- revise_val(dir,&SETUP_SPK_SURROUND_DELAY,8,2);//0~18MS
- #else
- revise_val(dir,&SETUP_SPK_SURROUND_DELAY,7,2);
- #endif
- val=SETUP_SPK_SURROUND_DELAY;
- //set surround speaker delay, 2:surround speaker
- AudioSetSpkDelay(2, (SETUP_SPK_SURROUND_DELAY-2)*3);
- }
- else if (id == STR_OS_BRIGHTNESS)
- {
- revise_val(dir, &SETUP_BRIGHTNESS, 14, 2);
- val = SETUP_BRIGHTNESS;
- SetBrightness(val - 2);
- }
- else if (id == STR_OS_CONTRAST)
- {
- revise_val(dir,&SETUP_CONTRAST, 14, 2);
- val=SETUP_CONTRAST;
- SetContrast(val - 2);
- }
- else if (id == STR_OS_HUE)
- {
- revise_val(dir,&SETUP_HUE, 14, 2);
- val=SETUP_HUE;
- SetHUE(val - 2);
- }
- else if (id == STR_OS_SATURATION)
- {
- revise_val(dir,&SETUP_SATURATION, 14, 2);
- val=SETUP_SATURATION;
- SetSaturation(val - 2);
- }
- #ifdef DIP_CFG_ENABLE
- else if (id == STR_OS_DEINTLC)
- {
- revise_val(dir,&SETUP_DE_INTERLACE, 8, 2);
- val=SETUP_DE_INTERLACE;
- SetDeInterlace(val - 2);
- }
- #endif//#ifdef DIP_CFG_ENABLE
- #ifdef VIDEO_SETUP_NEW_GUI//zhaoyanhua add 2004-1-8 16:46
- if ((id == STR_OS_BRIGHTNESS) ||
- (id == STR_OS_CONTRAST) ||
- (id == STR_OS_HUE) ||
- (id == STR_OS_SATURATION)
- #ifdef DIP_CFG_ENABLE
- ||(id == STR_OS_DEINTLC)
- #endif//#ifdef DIP_CFG_ENABL
- )
- {
- setup_CookVideoGUIString(id);
- }
- else
- #endif//VIDEO_SETUP_NEW_GUI
- setup_DrawScaleItem(id, 1, val-2);
- }
- #endif //end of DVD_SETUP_REENG
- //=============================================
- //for DVD_SETUP_REENG //added by JS //20040728
- #if 0//ndef DVD_SETUP_REENG
- //
- // setup_PrepareScaleItem : draw scale item, including rectangle, and blank calibration
- //
- // input : id -> scale item string id
- // up1down -> 0:up state
- // -> 1:down state
- //
- void setup_PrepareScaleItem(BYTE id, BYTE up1down)
- {
- BYTE uColor, dColor; //up, down
- BYTE fontColor, bgColor; //font, background color
- UINT32 xStart, yStart;
- UINT32 yDelta=0;
- BYTE buf[15];
- BYTE xWidth;
- int val = echo_level; // give a default value
- if (up1down) {
- uColor = SBLACKCOLOR;
- dColor = SWHITECOLOR;
- #ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 17:45
- fontColor = SFONTCOLOR;
- #else
- fontColor = SANTIFONTCOLOR;
- #endif//#ifdef QSI_SETUP_MENU_DESIGN
- #ifdef HL_CURSOR_ONLY//only hilight cursor ,not whole SCALE.zhaoyanhua add 2003-12-16 10:17
- bgColor = SBGCOLOR;
- #else
- bgColor = SANTIBGCOLOR;
- #endif
- } else {
- uColor = SWHITECOLOR;
- dColor = SBLACKCOLOR;
- fontColor = SFONTCOLOR;
- bgColor = SBGCOLOR;
- }
- xStart = SETUP_SUB_XSTART*16;
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+32;
- xWidth = 14;
- if (id==STR_OS_ECHO) {
- static const t_osd_str osdstr_echo[] = {
- { SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, " - - 8"},
- { SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, " - - 6"},
- { SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, " - - 4"},
- { SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, " - - 2"},
- { SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, " - - OFF"},
- { 0, 0, NULL}
- };
- //echo_level(0 ~ 8)
- yDelta = 5 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw strings
- osd_DrawStrings(osdstr_echo, fontColor, bgColor);
- //
- val=echo_level;
- } else
- #ifdef Ti3001_OSD_UI_2
- if ((id==STR_OS_AMP_MAINVOLUME)||(id==STR_OS_AMP_FSPK)||(id==STR_OS_AMP_FSPK_BALANCE)||
- (id==STR_OS_AMP_SSPK)||(id==STR_OS_AMP_SSPK_BALANCE)||(id==STR_OS_AMP_CSPK)||(id==STR_OS_AMP_SUBWOOFER))
- {
- //level(1 ~ 15)
- yDelta =8 * SETUP_BUTTON_HEIGHT-1; // 减1是为消去最下面的一条线。2-8-25 14:59 GERRY
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- //psprintf(buf, " - +");
- static t_osd_str osdstr_vol[] = {
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+0, " - - +10DB",
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+1, " - - 0",
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+2, " - - -10",
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+3, " - - -20",
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+4, " - - -30",
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+5, " - - -40",
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+6, " - - -50DB",
- SETUP_SUB_X_START+1, SETUP_MENU_YSTART+7, " - - OFF",
- 0, 0, NULL
- };
- osd_DrawStrings(osdstr_vol, fontColor, bgColor);
- if (id==STR_OS_AMP_MAINVOLUME)
- {
- val=amp_volume_level;
- }else
- if (id==STR_OS_AMP_FSPK)
- {
- val=amp_fspk_level;
- }else
- if (id==STR_OS_AMP_FSPK_BALANCE)
- {
- val=amp_fspk_balance_level;
- }else
- if (id==STR_OS_AMP_SSPK)
- {
- val=amp_sspk_level;
- }else
- if (id==STR_OS_AMP_SSPK_BALANCE)
- {
- val=amp_sspk_balance_level;
- }else
- if (id==STR_OS_AMP_CSPK)
- {
- val=amp_cspk_level;
- }else
- if (id==STR_OS_AMP_SUBWOOFER)
- {
- val=amp_subwoofer_level;
- }
- } else
- if ((id==STR_OS_AMP_BASS)||(id==STR_OS_AMP_TREMBLE)) //低音和高音。 2-8-25 15:10 GERRY
- {
- //level(1 ~ 15)
- yDelta =7 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- //psprintf(buf, " - +");
- psprintf(buf, " - - +18DB");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART, buf, fontColor, bgColor);
- psprintf(buf, " - - 12");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, buf, fontColor, bgColor);
- psprintf(buf, " - - 6");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, buf, fontColor, bgColor);
- psprintf(buf, " - - 0");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
- psprintf(buf, " - - -6");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
- psprintf(buf, " - - -12");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
- psprintf(buf, " - - -18DB");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, buf, fontColor, bgColor);
- // psprintf(buf, " - - -60");
- //osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, buf, fontColor, bgColor);
- //psprintf(buf, " - - -18DB");
- //osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, buf, fontColor, bgColor);
- if (id==STR_OS_AMP_BASS)
- {
- val=amp_bass_level;
- }
- else
- {
- val=amp_tremble_level;
- }
- } else
- if (id==STR_OS_AMP_DYNAMICRANGE) //动态范围 2-8-25 15:08 GERRY
- {
- //level(1 ~ 15)
- yDelta =7 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- //psprintf(buf, " - +");
- psprintf(buf, " - - 0DB");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART, buf, fontColor, bgColor);
- psprintf(buf, " - - -6");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, buf, fontColor, bgColor);
- psprintf(buf, " - - -12");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, buf, fontColor, bgColor);
- psprintf(buf, " - - -18");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
- psprintf(buf, " - - -24");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
- psprintf(buf, " - - -32");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
- psprintf(buf, " - - -36DB");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, buf, fontColor, bgColor);
- // psprintf(buf, " - - -60");
- //osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, buf, fontColor, bgColor);
- //psprintf(buf, " - - -36DB");
- //osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, buf, fontColor, bgColor);
- val=amp_dynamic_level;
- } else
- #endif
- if (id==STR_OS_KEY) {
- static t_osd_str osdstr_key[] = {
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, " - " Ch_ukey},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, " - - +4"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, " - - +2"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, " - - 0"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, " - - -2"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, " - - -4"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, " - " Ch_dkey},
- {0, 0, NULL},
- };
- //audio_key(-6 ~ 6)
- yDelta = 7 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- osd_DrawStrings(osdstr_key, fontColor, bgColor);
- val=audio_key;
- }else
- if ( (id==STR_OS_FSPK) || (id==STR_OS_CSPK) || (id==STR_OS_SSPK)||(id==STR_OS_MIC_VOL)||(id==STR_OS_MIC_VOL_1)|| (id==STR_OS_MIC_VOL_2))
- {
- if(id!=STR_OS_MIC_VOL&&id!=STR_OS_MIC_VOL_1&&id!=STR_OS_MIC_VOL_2)
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+32;//wanghaoying 2003-12-1 21:57
- //spk_volume(0 ~ 8)
- yDelta = 5 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- psprintf(buf, " - - 8");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, buf, fontColor, bgColor);
- buf[8]='6';//psprintf(buf, " - - 6");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, buf, fontColor, bgColor);
- buf[8]='4';//psprintf(buf, " - - 4");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
- buf[8]='2';//psprintf(buf, " - - 2");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
- psprintf(buf, " - - OFF");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
- #ifndef AC3_BASS_MANAGEMENT
- if (id==STR_OS_FSPK) {
- val=SETUP_SPK_FRONT-2;
- } else
- if (id==STR_OS_CSPK) {
- val=SETUP_SPK_CENTER-2;
- } else
- if (id==STR_OS_SSPK) {
- val=SETUP_SPK_SURROUND-2;
- }else
- #endif
- {//wangfeng 2003-09-12 21:36
- #ifdef MIC_2CHANNEL
- if(id==STR_OS_MIC_VOL||id==STR_OS_MIC_VOL_1)
- mic_volume=SETUP_MIC_VOL-2;
- else if(id==STR_OS_MIC_VOL_2)
- mic_volume=SETUP_MIC_VOL_2-2;
- #endif
- val=mic_volume;
- }
-
- } else
- if (id==STR_OS_CSPK_DELAY) {
- //center speaker delay 0 ~ 5 ms(step=1)
- yStart = (SETUP_MENU_YSTART+3)*SETUP_BUTTON_HEIGHT;
- yDelta = 4 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- #ifdef NO_SHOW_ADD_ICON //fengjl add 3-11-28 23:32
- #ifdef SHOW_SPK_DELAY_BY_DISTANCE //Maoyong 2004.04.21
- psprintf(buf, " - - 180CM");
- #else
- psprintf(buf, " - - 6 MS");
- #endif
- #else //#ifdef NO_SHOW_ADD_ICON
- psprintf(buf, " - - +");
- #endif //#ifdef NO_SHOW_ADD_ICON
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
-
- #ifdef AD_TCL//2004-3-22 13:04 lijd
- psprintf(buf, " - - 4 %s",Ch_zu);
- #elif defined(SHOW_SPK_DELAY_BY_DISTANCE) //Maoyong 2004.04.21
- psprintf(buf, " - - 120CM");
- #else
- psprintf(buf, " - - 4 MS");
- #endif
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
-
- #if defined(SHOW_SPK_DELAY_BY_DISTANCE) //Maoyong 2004.04.21
- psprintf(buf, " - - 60 CM");
- #else
- buf[8]='2';//psprintf(buf, " - - 2 MS");
- #endif
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
-
- #if defined(SHOW_SPK_DELAY_BY_DISTANCE) //Maoyong 2004.04.21
- psprintf(buf, " - - 0 CM");
- #else
- buf[8]='0';//psprintf(buf, " - - 2 MS");
- #endif
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, buf, fontColor, bgColor);
- val=SETUP_SPK_CENTER_DELAY-2;
- } else
- #ifdef ADD_DVI311_SETUP
- if (id==STR_OS_DVI311_MODE) {
- yStart = (SETUP_MENU_YSTART+1)*SETUP_BUTTON_HEIGHT;
- //ac3_dynarange(0 ~ 8)
- yDelta = 7 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- psprintf(buf, " VGA 6OHZ");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, buf, fontColor, bgColor);
- psprintf(buf, "SVGA 60HZ");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, buf, fontColor, bgColor);
- psprintf(buf, " XGA 60HZ");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
- psprintf(buf, "SXGA 60HZ");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
- //kevin @2k40514
- if(dvi311_tv_mode==0x84) //PAL
- psprintf(buf, " ");
- else
- psprintf(buf, "480P 60HZ");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
- if(dvi311_tv_mode>0x84) //PAL60&NTSC
- psprintf(buf, " ");
- else
- psprintf(buf, "576P 50HZ");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, buf, fontColor, bgColor);
- if(dvi311_tv_mode>0x84) //PAL60&NTSC
- psprintf(buf, "720P 60HZ");
- else
- psprintf(buf, "720P 50HZ");
- // osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, buf, fontColor, bgColor);
- // psprintf(buf, "720P 60HZ");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, buf, fontColor, bgColor);
- //val=SETUP_AC3DIGITAL_DYNA-2;
- val=dvi311_mode;
- }
- #endif
- if (id==STR_OS_DYNAMICRANGE) { //Jeff 20020604
- //ac3_dynarange:0~8
- yStart = (SETUP_MENU_YSTART+1)*SETUP_BUTTON_HEIGHT;
- //ac3_dynarange(0 ~ 8)
- yDelta = 5 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- psprintf(buf, " - - FULL");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, buf, fontColor, bgColor);
- psprintf(buf, " - - 6/8");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, buf, fontColor, bgColor);
- psprintf(buf, " - - 4/8");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
- psprintf(buf, " - - 2/8");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
- psprintf(buf, " - - OFF");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
- val=SETUP_AC3DIGITAL_DYNA-2;
- } else if (id==STR_OS_SSPK_DELAY)
- {
- //surround speaker delay 0 ~ 15 ms(step=3)
- yStart = (SETUP_MENU_YSTART+3)*SETUP_BUTTON_HEIGHT;
- //spk_volume(0 ~ 8)
- yDelta = 4 * SETUP_BUTTON_HEIGHT;
- //draw area bgcolor
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- //draw calibration
- #ifdef NO_SHOW_ADD_ICON //fengjl add 3-11-28 23:32
- #ifdef SHOW_SPK_DELAY_BY_DISTANCE //Maoyong 2004.04.21
- psprintf(buf, " - - 540CM");
- #else
- psprintf(buf, " - - 18 MS");
- #endif
- #else //NO_SHOW_ADD_ICON
- psprintf(buf, " - - +");
- #endif //NO_SHOW_ADD_ICON
-
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
-
- #ifdef AD_TCL//2004-3-22 13:05 lijd
- psprintf(buf, " - - 12 %s",Ch_zu);
- #elif defined(SHOW_SPK_DELAY_BY_DISTANCE) //Maoyong 2004.04.21
- psprintf(buf, " - - 360CM");
- #else
- psprintf(buf, " - - 12 MS");
- #endif
-
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
-
- #ifdef AD_TCL//2004-3-22 13:06 lijd
- psprintf(buf, " - - 6 %s",Ch_zu);
- #elif defined(SHOW_SPK_DELAY_BY_DISTANCE) //Maoyong 2004.04.21
- psprintf(buf, " - - 180CM");
- #else
- psprintf(buf, " - - 6 MS");
- #endif
-
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
- #ifdef SHOW_SPK_DELAY_BY_DISTANCE //Maoyong 2004.04.21
- psprintf(buf, " - - 0 CM");
- #else
- buf[8]='0';//psprintf(buf, " - - 0 MS");
- #endif
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, buf, fontColor, bgColor);
- val=SETUP_SPK_SURROUND_DELAY-2;
- }
- else if (id==STR_OS_BRIGHTNESS)
- {
- static const t_osd_str osdstr_brightness[] = {
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, " - - 12"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, " - - 10"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, " - - 8"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, " - - 6"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, " - - 4"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, " - - 2"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, " - - 0"},
- {0, 0, NULL}
- };
- yDelta = 7 * SETUP_BUTTON_HEIGHT;
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- osd_DrawStrings(osdstr_brightness, fontColor, bgColor);
- val = SETUP_BRIGHTNESS - 2;
- }
- else if (id==STR_OS_CONTRAST)
- {
- static const t_osd_str osdstr_contrast[] = {
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, " - - 12"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, " - - 10"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, " - - 8"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, " - - 6"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, " - - 4"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, " - - 2"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, " - - 0"},
- {0, 0, NULL}
- };
- yDelta = 7 * SETUP_BUTTON_HEIGHT;
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- osd_DrawStrings(osdstr_contrast, fontColor, bgColor);
- val = SETUP_CONTRAST - 2;
- }
- else if (id==STR_OS_HUE)
- {
- static const t_osd_str osdstr_hue[] = {
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, " - - +6"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, " - - +4"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, " - - +2"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, " - - 0"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, " - - -2"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, " - - -4"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, " - - -6"},
- {0, 0, NULL}
- };
- yDelta = 7 * SETUP_BUTTON_HEIGHT;
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- osd_DrawStrings(osdstr_hue, fontColor, bgColor);
- val = SETUP_HUE - 2;
- }
- else if (id==STR_OS_SATURATION)
- {
- static const t_osd_str osdstr_saturation[] = {
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+1, " - - 12"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, " - - 10"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, " - - 8"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, " - - 6"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, " - - 4"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+6, " - - 2"},
- {SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+7, " - - 0"},
- {0, 0, NULL}
- };
- yDelta = 7 * SETUP_BUTTON_HEIGHT;
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- osd_DrawStrings(osdstr_saturation, fontColor, bgColor);
- val = SETUP_SATURATION - 2;
- }
- #ifdef DIP_CFG_ENABLE
- else if (id==STR_OS_DEINTLC)
- {
- yStart = (SETUP_MENU_YSTART+2)*SETUP_BUTTON_HEIGHT;
- yDelta = 4 * SETUP_BUTTON_HEIGHT;
- osd_draw_rect(xStart, yStart, xWidth*16, yDelta, bgColor);
- psprintf(buf, " - - 6");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+2, buf, fontColor, bgColor);
- psprintf(buf, " - - 4");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+3, buf, fontColor, bgColor);
- psprintf(buf, " - - 2");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+4, buf, fontColor, bgColor);
- psprintf(buf, " - - 0");
- osd_DrawString(SETUP_SUB_XSTART+1, SETUP_MENU_YSTART+5, buf, fontColor, bgColor);
- val = SETUP_DE_INTERLACE- 2;
- }
- #endif//#ifdef DIP_CFG_ENABLE
- setup_DrawScaleItem(id, up1down, val);
- //top
- if (p_scan==1)
- osd_DrawLine(xStart, yStart, xStart+xWidth*16, yStart, uColor, 2);
- else
- osd_DrawLine(xStart, yStart, xStart+xWidth*16, yStart, uColor, 1);
- //left
- osd_DrawLine(xStart, yStart, xStart, yStart+yDelta, uColor, 1);
- //bottom
- if (p_scan==1)
- osd_DrawLine(xStart, yStart+yDelta, xStart+xWidth*16, yStart+yDelta, dColor, 2);
- else
- osd_DrawLine(xStart, yStart+yDelta, xStart+xWidth*16, yStart+yDelta, dColor, 1);
- //right
- osd_DrawLine(xStart+xWidth*16, yStart, xStart+xWidth*16, yStart+yDelta, dColor, 1);
- }
- #endif //end of DVD_SETUP_REENG
- //Jeff 20031110
- // 2004/01/30 yltseng, these should reference to 'const' variable
- #ifdef VOL_80
- extern const BYTE VolTab[17+65];
- #elif defined(VOL_20) //fengjl add 2004-03-08 21:38
- extern const BYTE VolTab[22];
- #else
- extern const BYTE VolTab[17];
- #endif
- extern const BYTE MICVolTab[9];
- //
- // setupGetSetting : to get some system setting about audio for DSP initialization
- //
- UINT32 setupGetSetting(BYTE x)
- {
- UINT32 iVal=0;
- BYTE sel;
- UINT16 P, I;
- switch (x) {
- case 3: //Time of Mic auto on after sound detect on
- iVal = MIC_PRESENSITIVITY;
- break;
- case 4: //Time of Mic auto off after sound detect off
- iVal = MIC_AFTERSENSITIVITY;
- break;
- case 5: //Mic sound detect gain threshold
- iVal = MIC_THRESHOLD;
- break;
- case 6: //Mic switch // output: 0->off, 1-> on, 2->auto
- #if defined(NOT_SHOW_MIC_SETUP_DAFAULT_AUTO)
- iVal = 2;
- #elif defined(NO_MIC)
- iVal = 0;
- #else
- P=setup_getItemPos(STR_OS_MIC_ONOFF);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_MIC_ONOFF]] == STR_OS_OFF)
- {
- iVal = 0; // off
- }
- else if(setup_item[P][I][setup_VA[SETUP_VA_MIC_ONOFF]] == STR_OS_ON)
- {
- iVal = 1;
- }
- else if(setup_item[P][I][setup_VA[SETUP_VA_MIC_ONOFF]] == STR_OS_AUTO)
- {
- iVal = 2;
- }
- setup_sel[P][I] = setup_VA[SETUP_VA_MIC_ONOFF];
- #endif
- break;
- /******************************************************************************
- case 6: //Mic switch
- #ifdef NOT_SHOW_MIC_SETUP_DAFAULT_AUTO//nono 4-1-11 18:52
- sel = 0;
- #else
- sel = setup_VA[SETUP_VA_MIC_ONOFF]-MIN_ITEM_SEL;//SETUP_MIC_ONF-2;
- #endif//NOT_SHOW_MIC_SETUP_DAFAULT_AUTO
- #ifdef DVDRELEASE
- //setup : 0->auto, 1->off
- //output: 0->off, 1->on, others:auto
- if (sel == 0) { //auto
- iVal = 2;
- #ifndef NOT_SHOW_MIC_SETUP_DAFAULT_AUTO
- setup_VA[SETUP_VA_MIC_ONOFF]=MIN_ITEM_SEL;//SETUP_MIC_ONF = 2;
- #endif//#ifdef NOT_SHOW_MIC_SETUP_DAFAULT_AUTO
- }
- else
- {
- #if defined(NO_MIC) //fengjl add to avoid mic output when define no_mic 2004-03-19 11:45
- {
- iVal = 0; //off
- }
- #else
- { //off
- iVal = 0;
- setup_VA[SETUP_VA_MIC_ONOFF] = 3;
- }
- #endif
- }
- //printf("release:SETUP_MIC_ONF = %d, iVal=%dn", SETUP_MIC_ONF, iVal);
- #else
- //setup : 0->auto, 1->on, 2->off
- //output: 0->off, 1->on, others:auto
- if (sel == 0) { //auto
- iVal = 2;
- setup_VA[SETUP_VA_MIC_ONOFF] = 2;
- } else if (sel == 1) { //on
- iVal = 1;
- setup_VA[SETUP_VA_MIC_ONOFF] = 3;
- } else {
- iVal=0;
- setup_VA[SETUP_VA_MIC_ONOFF] = 4;
- }
- //printf("debug:SETUP_MIC_ONF = %d, iVal=%dn", SETUP_MIC_ONF, iVal);
- #endif
- P=setup_getItemPos(STR_OS_MIC_ONOFF);
- I=P&0xff;
- P=P>>8;
- setup_sel[P][I]=setup_VA[SETUP_VA_MIC_ONOFF];
- break;
- *******************************************************************************/
- case 7: //Audio gain
- if (user_mute) {
- iVal=0x7fffff;
- } else
- {
- //iVal=0x7fffff-(audio_volume*0x7fffff/VOL_VALUE);
- #ifdef CNTR_5SPK_VOLUME
- //iVal=0x7fffff-(volume_5SPK[0]*0x7fffff/VOL_VALUE);
- iVal=0x7fffff - ( (VolTab[volume_5SPK[0]]<<16) | 0xffff); //Jeff 20031114
- #else
- //iVal=0x7fffff-(audio_volume*0x7fffff/VOL_VALUE);
- iVal=0x7fffff-( (VolTab[audio_volume]<<16) | 0xffff); //Jeff 20031114
- #endif
- }
- break;
- case 44: //MIC-2 gain, if we want to set different gain, we can seperate these two, Jeff 20030901
- case 8: //MIC gain
- #ifdef NO_MIC
- #ifdef NO_MIC_ITEM_ENABLE_MIC //kubby add for BBK_DVD,3-10-19 23:07
- //iVal=0x7fffff-(mic_volume*0x7fffff/8);
- iVal = 0x7fffff - ( (MICVolTab[mic_volume]<<16) | 0xffff); //Jeff 20031110
- #else
- iVal=0x7fffff;
- #endif
- #else
- //iVal=0x7fffff-(mic_volume*0x7fffff/8);
- iVal = 0x7fffff - (( MICVolTab[mic_volume]<<16) | 0xffff); //Jeff 20031110
- #endif
- /*huziqin 2004-3-5*/
- //#ifdef SUPPORT_RECEIVER
- //iVal = (0x7fffff-(( MICVolTab[8]<<16) | 0xffff));
- //#endif
- break;
- case 9: //Key shift
- iVal = audio_key+8;
- break;
- case 10: //Echo delay
- #ifdef USE_MIC_ECHO_PARAM
- iVal = echo_para_tbl[echo_level][1];//2004AUDDRV echo_para[echo_level][1];
- #else
- iVal = echo_level;
- #endif
- break;
- case 11: //Echo gain
- #ifdef USE_MIC_ECHO_PARAM
- iVal = echo_para_tbl[echo_level][0];//2004AUDDRV echo_para[echo_level][0];
- #else
- iVal = ECHO_DECAY_INIT;
- #endif
- break;
- case 12: //3D surround
- iVal = soundGetSurroundType(); //0:off other:different type
- break;
- case 13: //subwoof
- #ifdef ONLY_DOWNMIX//4-1-15 18:31
- iVal = 0;
- #else//ONLY_DOWNMIX
-
- sel=setup_VA[SETUP_VA_SUBWOOFER]-MIN_ITEM_SEL;//SETUP_SPK_SUBWOOFER-2;
- iVal = sel;
- #endif//ONLY_DOWNMIX
- break;
- case 14: //S/PDIF,terry,2003/12/12 06:13PM
- //bbk setup:2->source, 3->PCM
- //setup: 2:spdif off 3->source, 4->PCM
- //output: 0->0ff, 1->PCM, 2->source
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- if(coding_mode_now&(AUDIF_CODING_MODE_AC3))
- {
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_BITSTREAM)//SETUP_SPDIF == SPDIFBITSTREAM)
- iVal = 2;
- else if(setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_STEREO_PCM)//SETUP_SPDIF == SPDIFPCM)
- iVal = 1;
- else
- iVal = 0;
-
- }else if ((coding_mode_now&(AUDIF_CODING_MODE_DTS ) )|| ((cd_type_loaded==CDDA) && (cd_subtype==CD_DTS)) )
- {
- //denghangao 20040929 add "{}"
- P=setup_getItemPos(STR_OS_DTS_DIGITAL);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_DTS_DIGITAL]]==STR_OS_BITSTREAM)//SETUP_SPDIF_DTS == SPDIFBITSTREAM)
- iVal = 2;
- else
- iVal = 0;
- }
- else
- {
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_BITSTREAM)//SETUP_SPDIF_PCM==SPDIFBITSTREAM)
- iVal = 1;
- else
- iVal = 0;
- }
- #else//DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_BITSTREAM)//SETUP_SPDIF == SPDIFBITSTREAM)
- iVal = 2;
- else if(setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_STEREO_PCM)//SETUP_SPDIF == SPDIFPCM)
- iVal = 1;
- else
- iVal = 0;
- #endif//DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- #ifdef NO_DTS_OUTPUT
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- P=setup_getItemPos(STR_OS_DTS_DIGITAL);
- I=P&0xff;
- P=P>>8;
- #endif//#ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- if (
- ((cd_type_loaded == CDDA) && (cd_subtype == CD_DTS))
- #ifdef FORCE_NO_DTS_OUTPUT//nono 4-5-5 13:31
- ||(coding_mode_now&AUDIF_CODING_MODE_DTS)
- #endif//#ifdef FORCE_NO_DTS_OUTPUT
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- &&(setup_item[P][I][setup_VA[SETUP_VA_DTS_DIGITAL]]==STR_OS_BITSTREAM)//SETUP_SPDIF_DTS==SPDIFBITSTREAM)
- #endif//#ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- )
- iVal = 2;
- #endif//#ifdef NO_DTS_OUTPUT
- #if defined(NO_SPDIF)//nono 20031027
- iVal = 0;
- #endif//NO_SPDIF
- printf("===>spdif out:%xn",iVal);
- break;
- #ifdef LPCM_NO_SHOW_BAND //fengjl add 2004-03-19 18:51
- case 15: //EQ ,terry,2003/9/26 04:51PM
- if(coding_mode_now==AUDIF_CODING_MODE_LPCM)//2004-03-19 18:30
- //iVal = bEqDisplay;
- iVal = 0;
- break;
- #endif
- case 16:
- if (coding_mode_now==AUDIF_CODING_MODE_AC3) {
- iVal = 1;
- } else if (coding_mode_now==AUDIF_CODING_MODE_DTS) {
- iVal = 11;
- } else {
- iVal = 0;
- }
- break;
- #ifdef AC3_BASS_MANAGEMENT
- case 27: //Jeff 20021030
- #ifdef ONLY_DOWNMIX//4-1-15 18:31
- iVal = 0;
- #elif defined(SET_FCR_SPEAKER)//XYY changed 2004-10-23 10:48
- iVal = setup_VA[setup_VA_FRONT_SPEAKER]-MIN_ITEM_SEL;//SETUP_FRONT_SPEAKER -2; //xulf 2004-01-05
- #elif defined(TEST_BASS_MANAGEMENT) //Andrew Wen 20040803
- // use SPK setting to find config and setting value, set into to word 27
- iVal = AUDIF_Get_BassConfig();//2004AUDDRV SetBassConfig();
- #else//ONLY_DOWNMIX
- iVal = setup_VA[SETUP_VA_BASE_MODE]-MIN_ITEM_SEL;//SETUP_BASS_MODE-2;
- #endif//ONLY_DOWNMIX
- break;
- #endif
- case 32:
- break;
- case 33:
- {
- /*
- SETUP_SPK_DOWNMIX (2-5)
- AC3/DTS/LPCM/PPCM multichannel mode downmix mode(0x06-0x09)
- 2 --> Lt/Rt 0x08
- 3 --> Lo/Ro 0x07
- 4 --> Ls/Rs 0x09
- 5 --> 5.1 channel 0x06
- */
- #ifdef NO_VSURROUND_CHANNEL
- BYTE downmix_init[4]={0x08,0x07,0x06,0x09};
- #else
- #ifdef JIEKE_DVD//wangfeng 2003-10-28 11:18
- BYTE downmix_init[4]={0x08,0x07,0x06,0x09};
- #else
- BYTE downmix_init[4]={0x08,0x07,0x09,0x06};
- #endif
- #endif
- #ifdef DIG_AND_AUD
- iVal=0x08;
- #else
- iVal=downmix_init[setup_VA[SETUP_VA_DOWNMIX]-MIN_ITEM_SEL];//downmix_init[SETUP_SPK_DOWNMIX-2];
- #endif
- break;
- }
- #ifdef SUPPORT_PROLOGIC_II
- case 35:
- {
- if (setup_VA[SETUP_VA_PROLOGIC]==MIN_ITEM_SEL)//SETUP_PROLOGIC_II==2)
- {
- pl2_init_val=0x137300;
- } else if (setup_VA[SETUP_VA_PROLOGIC]==MIN_ITEM_SEL+1)//SETUP_PROLOGIC_II==3)
- {
- pl2_init_val=0x127300;
- } else if (setup_VA[SETUP_VA_PROLOGIC]==MIN_ITEM_SEL+2)//SETUP_PROLOGIC_II==4)
- {
- pl2_init_val=0x037300;
- }
- if( !check_chipinfo(6) )
- pl2_init_val=0x037300;
- iVal=pl2_init_val;
- break;
- }
- #endif
- case 39: //Left channel gain , Jeff 20030901
- case 40: //Right channel gain
- case 41: //Left surround channel gain
- case 42: //Right surround channel gain
- case 43: //Center channel gain
-
- #ifdef CNTR_5SPK_VOLUME
- //iVal=0x7fffff-(volume_5SPK[x-38]*0x7fffff/VOL_VALUE); //[x-38]:1->left-channel 2...
- iVal=0x7fffff- ( (VolTab[volume_5SPK[x-38]]<<16) | 0xffff); //[x-38]:1->left-channel 2...
- #else
- iVal=0; //max. volume
- #endif
- break;
- case 46:
- //Sub-Woofer channel gain, Jeff 20031028
- //printf("volume_5SPK[x-40]=%dn",volume_5SPK[x-40]);
- #ifdef CNTR_5SPK_VOLUME
- //iVal=0x7fffff-(volume_5SPK[x-40]*0x7fffff/VOL_VALUE); //[x-38]:1->left-channel 2...
- iVal=0x7fffff- ( (VolTab[volume_5SPK[x-40]]<<16) | 0xffff); //[x-38]:1->left-channel 2...
- #endif
- break;
-
- } //switch (x) {
- return iVal;
- }
- int setup_IsSet2SPDIF_Bitstream()
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- UINT16 P2, I2;
- P2=setup_getItemPos(STR_OS_DTS_DIGITAL);
- I2=P2&0xff;
- P2=P2>>8;
- #endif
-
- if(
- (
- (setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_BITSTREAM)//(SETUP_SPDIF==SPDIFBITSTREAM)
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- && (cd_type_loaded==CDDVD)
- #endif//#ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- )
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- //||( (SETUP_SPDIF_DTS==SPDIFBITSTREAM) && (cd_type_loaded==CDDVD) )
- ||((setup_item[P2][I2][setup_VA[SETUP_VA_DTS_DIGITAL]]==STR_OS_BITSTREAM)&& (cd_type_loaded==CDDVD))
- #endif
- )
- return 1;
-
- if ((coding_mode_now&AUDIF_CODING_MODE_DTS) || cd_subtype==CD_DTS)
- {
- #ifdef NO_DTS_OUTPUT
- return 1;
- #endif
- if (!check_chipinfo(2)) return 1;
- }
- return 0;
- }
- #ifndef DELETE_SPDIF_OFF_ITEM//zhaoyanhua add 2003-12-8 17:36
- int setup_IsSet2SPDIF_OFF()
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- if (setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_SIMULATE)//(SETUP_SPDIF==SPDIFSIMULATE)
- return 1;
- else
- return 0;
- }
- #endif
- int setup_DTSCD_IsSet2SPDIF_PCMAndOff()//nono 20030816
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- #ifdef DELETE_SPDIF_OFF_ITEM//zhaoyanhau add 2003-12-8 17:53
- #define is_SPDIF_PCMAndOff() (setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_STEREO_PCM)//(SETUP_SPDIF==SPDIFPCM)
- #elif defined(NO_DTS_OUTPUT)
- #define is_SPDIF_PCMAndOff() (setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_SIMULATE)//(SETUP_SPDIF==SPDIFSIMULATE)
- #elif defined(DIVIDE_AC3_DTS_SPDIF_OUTPUTS)
- UINT16 P2, I2;
- P2=setup_getItemPos(STR_OS_AC3_DIGITAL);
- I2=P2&0xff;
- P2=P2>>8;
- #define is_SPDIF_PCMAndOff() ((setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_SIMULATE)||(setup_item[P][I][setup_VA[SETUP_VA_AC3_DIGITAL]]==STR_OS_SIMULATE))
- //(SETUP_SPDIF_PCM==SPDIFSIMULATE || SETUP_SPDIF==SPDIFSIMULATE)
- #else
- #define is_SPDIF_PCMAndOff() (0)// (SETUP_SPDIF==SPDIFSIMULATE)||(SETUP_SPDIF==SPDIFPCM) )
- #endif
- if(
- (is_SPDIF_PCMAndOff() ) &&
- (
- ( (cd_subtype == CD_DTS)&&(cd_type_loaded == CDDA) )
- ||(coding_mode_now&AUDIF_CODING_MODE_DTS)
- )
- )
- return 1;
- else
- return 0;
- }
- void setup_Set2SPDIF_PCM()
- {
- //SETUP_SPDIF = SPDIFPCM;
- //run_save_sel_cmd(AUDPAGE, DIGIOUTITEM);
- UINT32 P, I, S;
- P=setup_getSelPos(STR_OS_STEREO_PCM);
- I=(P>>8)&0xff;
- S=P&0xff;
- P=P>>16;
- setup_VA[SETUP_VA_AUD_OUT]=S;
- run_save_sel_cmd(setup_VA[SETUP_VA_AUD_OUT], SETUP_VA_AUD_OUT);
- }
- int setup_IsMICoff()
- {
- int iRes=0;
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_MIC_ONOFF);
- I=P&0xff;
- P=P>>8;
- #ifdef DVDRELEASE
- if (setup_item[P][I][setup_VA[SETUP_VA_MIC_ONOFF]]==STR_OS_OFF) iRes=1;
- #else
- if (setup_item[P][I][setup_VA[SETUP_VA_MIC_ONOFF]]==STR_OS_OFF) iRes=1;
- #endif
- return iRes;
- }
- #if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI) //zhaoyanhua add 2003-11-28 10:46
- /*
- * exit parental GUI.
- */
- void ExitParentalGUI(void)
- {
- full_scrn = 0;
- #if defined(NEW_PARENTAL_GUI)
- new_parental_gui = 0;////avoid the error:when TRAY OUT enter SETUP ,show error infomation.
- #elif defined(MODIFY_PARENTAL_GUI)
- parental_gui_flag = 0; //nono 2004-5-7 0:24
- #endif//defined(MODIFY_PARENTAL_GUI)
- #ifdef DYNAMIC_SPECTRUM //fengjl 2004-06-23 09:57
- if (band_onoff)
- {
- #ifdef LPCM_NO_SHOW_BAND
- if(coding_mode_now!=AUDIF_CODING_MODE_LPCM)
- #endif
- bEqDisplay=1;
- Show3dspectrum();
- }
- else
- #endif
- #ifdef SDRAM_16Mb_Mode //Maoyong 2004.07.03
- regs0->osd_base_addr=regs0->osdya;
- #endif
- osd_init();
- // if(cd_type_loaded==CDDVD)//nono 2004-5-7 0:13
- nav_param_by_user();
- }
- #endif//#ifdef NEW_PARENTAL_GUI//zhaoyanhua add 2003-11-28 10:46
- #ifdef NEW_PARENTAL_GUI//zhaoyanhua add 2003-11-28 10:46
- /*
- * Show password GUI when playing parental disc
- */
- void ShowPasswordGUI()
- {
- const char *str;
-
- new_parental_gui = 1;
- #if defined(SDRAM_16Mb_Mode)//&&defined(NEW_STYLE_SETUP)
- //NOTE:
- //when SDRAM_16M_Mode,ShowTitle() may destroyed
- // OSD memory. So must evaluate osd_base_addr again.
- //zhaoyanhua add 2003-11-10 17:06
- regs0->osd_base_addr=OSD_BASE_USE_ADDR;//P_BIDIR_LUMA;
- //clead 2004-3-26 add
- #endif
- full_scrn = SETUP;
- osd_init_parental_gui();
-
- #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-2 17:32
- SetOsdCol(0,0,SANTIBGCOLOR,0xa346ffff);
- #endif
-
- #ifdef NEW_PARENTAL_GUI_SHOW_MULTI_LANG //2004-2-20 09:21张宇M
- str =_OsdMessegeFont1[osd_font_mode][STR_OS_PASSWORD]; //wsf 2004-2-6 16:50
- #else//NEW_PARENTAL_GUI_SHOW_MULTI_LANG
- str ="PASSWORD:";//2004-2-20 09:21张宇M
- #endif//NEW_PARENTAL_GUI_SHOW_MULTI_LANG
- osd_DrawRegionString(MESSAGE_XSTART, MESSAGE_YSTART, str, MESSAGE_FONT_COLOR, MESSAGE_BK_COLOR, 0);
-
- //show current focus
- osd_draw_region_rect(PASSWD_BUTTON_XSTART,PASSWD_BUTTON_YSTART,PASSWD_BUTTON_XLEN,PASSWD_BUTTON_YLEN,PASSWORD_BK_HL_COLOR,0);
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK];
- osd_DrawRegionString(PASSWORD_XSTART, PASSWORD_YSTART, str, PASSWORD_FONT_COLOR, PASSWORD_BK_HL_COLOR, 0);
-
- }
- /*
- * check if the password is correct
- */
- void show_NewParentalGui_page_OK(void)
- {
- const char *str;
-
-
- osd_draw_region_rect(PASSWD_BUTTON_XSTART,PASSWD_BUTTON_YSTART,PASSWD_BUTTON_XLEN,PASSWD_BUTTON_YLEN,PASSWORD_BK_COLOR,0);
- //show UNLOCK state
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_UNLOCK];
- osd_DrawRegionString(PASSWORD_XSTART, PASSWORD_YSTART, str , PASSWORD_FONT_COLOR, PASSWORD_BK_COLOR,0);
- osd_draw_region_rect(OKERROR_BUTTON_XSTART,OKERROR_BUTTON_YSTART,OKERROR_BUTTON_XLEN,OKERROR_BUTTON_YLEN,OKERROR_BK_COLOR,0);
- //show "OK"
- #ifdef PASSWORD_IN_CH
-
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART, _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWORD_RIGHT] , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #else
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART,"OK" , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #endif
- delay_srv_10ms(200);//20040302
- }
- void show_NewParentalGui_page_ERROR(void)
- {
- const char *str;
- osd_draw_region_rect(PASSWD_BUTTON_XSTART,PASSWD_BUTTON_YSTART,PASSWD_BUTTON_XLEN,PASSWD_BUTTON_YLEN,PASSWORD_BK_COLOR,0);
- //show UNLOCK state
- //show LOCK state
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK];
- osd_DrawRegionString(PASSWORD_XSTART-2, PASSWORD_YSTART, str , PASSWORD_FONT_COLOR, PASSWORD_BK_COLOR,0);
- // str = osd_err_str[osd_font_mode][PARENTAL_ERR-1];
- osd_draw_region_rect(OKERROR_BUTTON_XSTART,OKERROR_BUTTON_YSTART,OKERROR_BUTTON_XLEN,OKERROR_BUTTON_YLEN,OKERROR_BK_COLOR,0);
- #ifdef PASSWORD_IN_CH
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART, _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWORD_ERROR] , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #else
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART,"ERROR" , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #endif
- delay_srv_10ms(200);//20040302
- }
- void check_parent_password(void)
- {
- extern const char *const osd_err_str[N_OSD_LANGS][3];
- const char *str;
-
- //if ((UserSet.parental_ststus == C_LOCK)&& //hq marked, avoid entering play when double cliked ENTER Key without inputing password. 2004-3-5 13:28
- #ifdef SETUP_6_DIGIT_PASSWORD
- if ((UserSet.parental_ststus == C_LOCK)&&(digit_cnt == PASSWORD_LENGTH)&&
- #else//SETUP_6_DIGIT_PASSWORD
- if ((UserSet.parental_ststus == C_LOCK)&&(digit_cnt == PASSWORD_LENGTH)&&
- #endif//SETUP_6_DIGIT_PASSWORD
- #ifdef USER_SUPER_PASSWD_ALSO_PLAY //heqiang,2004-3-5 11:44
- ((tmp_passwd == UserSet.parent_passwd )||(tmp_passwd == USER_SUPER_PASSWORD )))
- #else//USER_SUPER_PASSWD_ALSO_PLAY
- (tmp_passwd == UserSet.parent_passwd ))
- #endif//USER_SUPER_PASSWD_ALSO_PLAY
- {
- UserSet.parental_ststus = C_UNLOCK;
-
- /*
- osd_draw_region_rect(PASSWD_BUTTON_XSTART,PASSWD_BUTTON_YSTART,PASSWD_BUTTON_XLEN,PASSWD_BUTTON_YLEN,PASSWORD_BK_COLOR,0);
- //show UNLOCK state
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_UNLOCK];
- osd_DrawRegionString(PASSWORD_XSTART, PASSWORD_YSTART, str , PASSWORD_FONT_COLOR, PASSWORD_BK_COLOR,0);
- osd_draw_region_rect(OKERROR_BUTTON_XSTART,OKERROR_BUTTON_YSTART,OKERROR_BUTTON_XLEN,OKERROR_BUTTON_YLEN,OKERROR_BK_COLOR,0);
- //show "OK"
- #ifdef PASSWORD_IN_CH
-
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART, _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWORD_RIGHT] , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #else
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART,"OK" , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #endif
- delay_srv_10ms(200);//20040302
- */
- show_NewParentalGui_page_OK();
- }
- else//if password id incorrect,show error message.
- {
- printf("uuuuuuu show dvd errornn");
- //show grade error
- //draw rect
- osd_draw_region_rect(PASSWD_BUTTON_XSTART,PASSWD_BUTTON_YSTART,PASSWD_BUTTON_XLEN,PASSWD_BUTTON_YLEN,PASSWORD_BK_COLOR,0);
- //show UNLOCK state
- //show LOCK state
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK];
- osd_DrawRegionString(PASSWORD_XSTART-2, PASSWORD_YSTART, str , PASSWORD_FONT_COLOR, PASSWORD_BK_COLOR,0);
- // str = osd_err_str[osd_font_mode][PARENTAL_ERR-1];
- osd_draw_region_rect(OKERROR_BUTTON_XSTART,OKERROR_BUTTON_YSTART,OKERROR_BUTTON_XLEN,OKERROR_BUTTON_YLEN,OKERROR_BK_COLOR,0);
- #ifdef PASSWORD_IN_CH
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART, _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWORD_ERROR] , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #else
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART,"ERROR" , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #endif
- delay_srv_10ms(200);//20040302
-
- show_NewParentalGui_page_ERROR();
- }
- reset_passwd_cnt(); //dingzhy 04-02-09 10:31AM
- }
- #else//#ifdef NEW_PARENTAL_GUI//zhaoyanhua add 2003-11-28 10:46
- //function inital name is setup_Checkpassword()
- //zhaoyanhua modify the function name 2003-11-29 20:34
- #if 1//def SETUP_PASSWORD_GUI //denghg markede 2004-12-17 22:06
- void ShowPasswordGUI()
- {
- #ifdef NEW_STYLE_SETUP
- GBM_run_setupmenu_flag =1;
- #endif
- #ifdef MODIFY_PARENTAL_GUI
- parental_gui_flag = 1;
- #endif//MODIFY_PARENTAL_GUI
- #if defined(SDRAM_16Mb_Mode)//&&defined(NEW_STYLE_SETUP)
- //NOTE:
- //when SDRAM_16M_Mode,ShowTitle() may destroyed
- // OSD memory. So must evaluate osd_base_addr again.
- //zhaoyanhua add 2003-11-10 17:06
- regs0->osd_base_addr=OSD_BASE_USE_ADDR;//P_BIDIR_LUMA;
- //clead 2004-3-26 add
- #endif
-
- full_scrn=SETUP;
- osd_init_setup();
- UINT16 P=0; //denghg add 2004-12-17 22:04
- UINT16 I=0;
- UINT16 S=0;
- P=setup_getItemPos(STR_OS_PASSWORD);
- I=P&0xff;
- P=P>>8;
- for( S=0; S<MAX_ITEM_SEL; S++) {
- if (setup_item[P][I][S]==STR_OS_LOCK) break;
- }
- setup_sel[P][I]=S;
- setup_VA[SETUP_VA_PASSWORD]=setup_sel[P][I];
- setup_mLevel = SETUP_ML3;
- setup_pos[SETUP_ML0] = setup_mLevel;
- setup_pos[SETUP_ML1] =P;
- setup_pos[SETUP_ML2] =I;
- setup_pos[SETUP_ML3] =S;
- setup_pos[SETUP_ML0] = setup_mLevel;
- setup_last_pos[0]=SETUP_ML2; //denghg add end 2004-12-17 22:04
- ShowSetupPage(1);
- /* setupLevel=2;
- #ifdef GBM_FULL_FUNCTION
- page = SysNextPage;
- #else//GBM_FULL_FUNCTION
- page = SYSPAGE;
- #endif//GBM_FULL_FUNCTION
- index_y=PASSWDITEM;
- index_y_start=0;
- index_y2=0;
- submenuStart=PASSWDITEM+2;
- ShowSetupPage(1);*/ //DENGHG MARKDE 20041216 22:30
- }
- #endif //endif of SETUP_PASSWORD_GUI
- #endif//#ifdef NEW_PARENTAL_GUI//zhaoyanhua add 2003-11-28 10:46
- #if defined(DVD_AUDIO)//20040302
- void check_dvd_audio_password(void)
- {
- // extern const char *const osd_err_str[N_OSD_LANGS][3];
- // const char *str;
-
- printf("tmp_passwd=%dn",tmp_passwd);
- if (pDSV->HGR_INF==tmp_passwd)
- {
- // osd_draw_region_rect(PASSWD_BUTTON_XSTART,PASSWD_BUTTON_YSTART,PASSWD_BUTTON_XLEN,PASSWD_BUTTON_YLEN,PASSWORD_BK_COLOR,0);
- //show UNLOCK state
- // str = _OsdMessegeFont1[osd_font_mode][STR_OS_UNLOCK];
- // osd_DrawRegionString(PASSWORD_XSTART, PASSWORD_YSTART, str , PASSWORD_FONT_COLOR, PASSWORD_BK_COLOR,0);
- /*
- osd_draw_region_rect(OKERROR_BUTTON_XSTART,OKERROR_BUTTON_YSTART,OKERROR_BUTTON_XLEN,OKERROR_BUTTON_YLEN,OKERROR_BK_COLOR,0);
- //show "OK"
- #ifdef PASSWORD_IN_CH
-
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART, _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWORD_RIGHT] , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #else
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART,"OK" , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #endif
- */
- #ifdef NEW_PARENTAL_GUI
- show_NewParentalGui_page_OK();
- #endif
-
- pDSV->hid_gp_chk_pwd=0;
-
- }
- else//if password id incorrect,show error message.
- {
- printf("uuuuuuu show dvd errornn");
- //show grade error
- //draw rect
- // osd_draw_region_rect(PASSWD_BUTTON_XSTART,PASSWD_BUTTON_YSTART,PASSWD_BUTTON_XLEN,PASSWD_BUTTON_YLEN,PASSWORD_BK_COLOR,0);
- //show UNLOCK state
- //show LOCK state
- // str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK];
- // osd_DrawRegionString(PASSWORD_XSTART-2, PASSWORD_YSTART, str , PASSWORD_FONT_COLOR, PASSWORD_BK_COLOR,0);
- /*
- // str = osd_err_str[osd_font_mode][PARENTAL_ERR-1];
- osd_draw_region_rect(OKERROR_BUTTON_XSTART,OKERROR_BUTTON_YSTART,OKERROR_BUTTON_XLEN,OKERROR_BUTTON_YLEN,OKERROR_BK_COLOR,0);
- #ifdef PASSWORD_IN_CH
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART, _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWORD_ERROR] , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #else
- osd_DrawRegionString(OKERROR_XSTART-1, OKERROR_YSTART,"ERROR" , OKERROR_FONT_COLOR, OKERROR_BK_COLOR,0); //2004-2-20 09:24张宇M
- #endif
- */
- #ifdef NEW_PARENTAL_GUI
- show_NewParentalGui_page_ERROR();
- #endif
- }
- delay_srv_10ms(200);
- }
- void ExitDVDAudioGUI(void)
- {
- full_scrn = 0;
- #ifdef NEW_PARENTAL_GUI
- new_parental_gui = 0;////avoid the error:when TRAY OUT enter SETUP ,show error infomation.
- #endif
- #if defined(MODIFY_PARENTAL_GUI)
- parental_gui_flag = 0;
- #endif//#if defined(MODIFY_PARENTAL_GUI)
- //zhaoyanhua add 2004-2-9 11:24
- #ifdef SDRAM_16Mb_Mode //Maoyong 2004.07.03
- regs0->osd_base_addr=regs0->osdya;
- #endif
- osd_init();
- // nav_param_by_user();
- }
- #endif//#if defined(DVD_AUDIO)//20040302
- /*
- * Show password GUI and get input password
- * NOTE:
- * these sentences are abstracted from ncmd_exe.
- *
- * zhaoyanhua 2003-11-28 22:23
- */
- void setup_CheckPasswd()
- {
-
- extern int user_input_pwd;
- /* UserSet.parental_ststus=0; //nono 2003-11-21 14:19*///denghg marked 2004-12-17 12:55
- UserSet.parental_ststus=C_LOCK;
-
- SetFullscrnCmdFuncPtr( setup_func_up, setup_func_down, setup_func_left,
- setup_func_right, setup_func_select);//denghg add 2004-12-16 20:57
- /*#ifdef SETUP_PASSWORD_GUI
- ShowPasswordGUI();
- #endif*/ //denghg markde 2004-12-16 20:46
- ShowPasswordGUI();//denghg add 2004-12-16 20:46
-
- user_input_pwd=1;
- while(user_input_pwd==1)
- polling();
-
- if(user_input_pwd==2)//nono 2-6-6 23:45 to avoid parental contrl invalid.
- {
- //Maoyong 2004.03.06 , Record disc check Level in SYSTEM_SETUP_BROWSER,
- //I use (user_input_pwd ==2 ) to check specical exit PTL Level Check(IRC_POWER , IRC_EJECT)
- #ifdef CHECK_RECORD_DISK_PARENT_LVL
- if( (system_state == SYSTEM_BROWSE) )
- #endif
- user_input_pwd=0;
- }
- else
- #ifdef NEW_PARENTAL_GUI//zhaoyanhua add 2003-11-28 19:50
- ExitParentalGUI();
- #else
- ircmd_setup();
- #endif
- }
- //#if defined(NEW_PARENTAL_GUI)&&defined(DVD_AUDIO)//20040302
- #if defined(DVD_AUDIO)//20040302
- void setup_CheckDVDAudioPasswd()
- {
- extern int user_input_pwd;
- extern UINT8 polling_avoid_reentry;
- #ifdef SETUP_PASSWORD_GUI
- ShowPasswordGUI();
- #endif
-
- user_input_pwd=1;
- polling_avoid_reentry=0;
- while(user_input_pwd==1)
- polling();
-
- if(user_input_pwd==2)//nono 2-6-6 23:45 to avoid parental contrl invalid.
- user_input_pwd=0;
- else
- #ifdef NEW_PARENTAL_GUI
- ExitDVDAudioGUI();
- #else
- ircmd_setup();
- #endif
- }
- #endif//#if defined(NEW_PARENTAL_GUI)&&defined(DVD_AUDIO)//20040302
- void setup_SetKey()
- {
- //SETUP_KEY = audio_key+8;
- //AudioSetKey(audio_key+8); //Key-shift command to DSP(1~15)
- setup_VA[SETUP_VA_KEY]=audio_key+MIN_ITEM_SEL+6;
- AUDIF_Set_Key(setup_VA[SETUP_VA_KEY]);//2004AUDDRV AudioSetKey(setup_VA[SETUP_VA_KEY]);
- #ifndef NOT_REWRITE_MIC_VALUE //axel 2004/2/14 03:19PM
- //run_save_sel_cmd(AUDPAGE, KEYITEM);
- run_save_sel_cmd(setup_VA[SETUP_VA_KEY], SETUP_VA_KEY);
- #endif //NOT_REWRITE_MIC_VALUE //axel 2004/2/14 03:19PM
- }
- void setup_SetEcho()
- {
- //SETUP_ECHO = echo_level+2;
- setup_VA[SETUP_VA_ECHO]=echo_level+MIN_ITEM_SEL;
- #ifdef USE_MIC_ECHO_PARAM
- AUDIF_Set_EchoPara(echo_level);//2004AUDDRV AudioSetEchoPara(echo_level);
- #else
- AUDIF_Set_Echo(echo_level, echo_level);//2004AUDDRV AudioSetEcho(echo_level, echo_level); //Echo command to DSP
- #ifndef NOT_REWRITE_MIC_VALUE //axel 2004/2/8 10:05PM
- run_save_sel_cmd(setup_VA[SETUP_VA_ECHO], SETUP_VA_ECHO);
- #endif //NOT_REWRITE_MIC_VALUE //axel 2004/2/14 03:19PM
- #endif //USE_MIC_ECHO_PARAM
- }
- void setup_SetMic()
- {
- //#ifdef MIC_2CHANNEL
- //if(id==STR_OS_MIC_VOL||id==STR_OS_MIC_VOL_1)
- //#endif
- #if defined(MIC_2CHANNEL)&&defined(MIC_FUNCTION_KEY)
- if(bFuncStep==1)
- {
- //SETUP_MIC_VOL = mic_volume+2;
- setup_VA[SETUP_VA_MIC_VOL_1]=mic_volume+MIN_ITEM_SEL;
- AUDIF_Set_MICVol(mic_volume);//2004AUDDRV AudioSetMICVol(mic_volume);
- //#ifdef MIC_2CHANNEL
- }
- else if(bFuncStep==5)
- {
- //SETUP_MIC_VOL_2 = mic_volume+2;
- setup_VA[SETUP_VA_MIC_VOL_2]=mic_volume+MIN_ITEM_SEL;
- AUDIF_Set_MICVol2(mic_volume);//2004AUDDRV AudioSetMICVol_2(mic_volume);
- }
- run_save_sel_cmd(setup_VA[SETUP_VA_MIC_VOL_1], SETUP_VA_MIC_VOL_1);
- run_save_sel_cmd(setup_VA[SETUP_VA_MIC_VOL_2], SETUP_VA_MIC_VOL_2);
- #else// //#ifdef MIC_2CHANNEL
- setup_VA[SETUP_VA_MIC_VOL] = mic_volume+2;
- AUDIF_Set_MICVol(mic_volume);//2004AUDDRV AudioSetMICVol(mic_volume); //fengjl edit it 2004-06-17 21:51
- #ifndef NOT_REWRITE_MIC_VALUE //axel 2004/2/14 03:19PM
- run_save_sel_cmd(setup_VA[SETUP_VA_MIC_VOL_1], SETUP_VA_MIC_VOL_1);
- #endif //NOT_REWRITE_MIC_VALUE //axel 2004/2/14 03:19PM
- #endif// //#ifdef MIC_2CHANNEL
- }
- int IsOSDChinese()
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_OSD);
- I=P&0xff;
- P=P>>8;
-
- //if (setup_item[LANGPAGE][LANGITEM][osd_font_mode+2]==LCD_ZH) return 1;
- if (setup_item[P][I][osd_font_mode+2]==LCD_ZH) return 1;
- else return 0;
- }
- #ifdef DOUBLE_LOGO //terry,2004/2/10 04:18PM
- //xiaosan 2-7-19 13:36
- //input :void
- //ouput :1->en,0->zh
- int OsdIsEnglish(void)
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_OSD);
- I=P&0xff;
- P=P>>8;
- //if(setup_item[LANGPAGE][LANGITEM][osd_font_mode+2]==LCD_EN)
- if(setup_item[P][I][osd_font_mode+2]==LCD_EN)
- return 1;
- else
- return 0;
- }
- #endif
- //20041222 JSLin // this function should always exist
- void setup_SetFreqMaskConfig()
- {
- UINT16 P, I, S;
- P=setup_getItemPos(STR_OS_FREQ_MASK);
- I=P&0xff;
- P=P>>8;
-
- if(P==0xff) // STR_OS_FREQ_MASK doesn't exist in setup_item[][][]
- {
- AUDIF_Set_FrqMsk(FREQ_MASK_DEFAULT);
- }
- else
- {
- S = setup_sel[P][I];
- switch(setup_item[P][I][S])
- {
- case STR_OS_48K:
- AUDIF_Set_FrqMsk(0);
- break;
- case STR_OS_96K:
- AUDIF_Set_FrqMsk(1);
- break;
- case STR_OS_192K:
- AUDIF_Set_FrqMsk(2);
- break;
- default:
- AUDIF_Set_FrqMsk(FREQ_MASK_DEFAULT);
- break;
- }
- /*
- #ifdef SPHE1000
- exe_setup_function(STR_OS_FREQ_MASK,setup_item[P][I][setup_VA[SETUP_VA_FREQ_MASK]],0);
- #else
- exe_setup_function(STR_OS_FREQ_MASK,setup_item[P][I][setup_VA[SETUP_VA_FREQ_MASK]],0);
- #endif
- */
- }
- }
- //not sure about this function ==> try to set STR_OS_DTS_DIGITAL??
- void setup_SetDTSCDConfig()
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- exe_setup_function(STR_OS_AUD_OUT, setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]], 0);
- //printf("nnsetup_SetDTSCDConfig in1n");
- //exe_setup_function(setup_item[AUDPAGE][DIGIOUTITEM][1],setup_item[AUDPAGE][DIGIOUTITEM][ SETUP_SPDIF ],0);
- //setup_SetDTSConfig();//terry,2004/2/10 03:51PM
- //printf("nnsetup_SetDTSCDConfig outn");
- }
- //not sure about this function ==> try to set spdif??
- void setup_SetSPDIFConfig()//2003-8-15 20:56 for avoid SPDIF noise when power on.
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- exe_setup_function(STR_OS_AUD_OUT, setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]], 0);
- //exe_setup_function(setup_item[AUDPAGE][DIGIOUTITEM][1],setup_item[AUDPAGE][DIGIOUTITEM][ SETUP_SPDIF ],0);
- }
- void setup_SetDTSDOWNMIXConfig()//NONO force set downmix 2003-11-24 14:23
- {
- // 3 -12-9 19:04 NONO MARKED.uopdate dsp code.
- if( (cd_type_loaded ==CDDA)&&(cd_subtype==CD_DTS) )
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- exe_setup_function(STR_OS_DOWNMIX_SETUP, setup_item[P][I][setup_VA[SETUP_VA_DOWNMIX]],0);
- }
- }
- //check whether MIC is OFF, Jeff 20020524
- int setup_IsMICOff()
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_MIC_ONOFF);
- I=P&0xff;
- P=P>>8;
- if (setup_item[P][I][setup_VA[SETUP_VA_MIC_ONOFF]]==STR_OS_OFF)//( (SETUP_MIC_ONF-1)==MICOFF)
- return 1;
- else
- return 0;
- }
- //Set MIC to Auto mode
- void setup_SetMICAuto()
- {
- UINT32 P, I, S;
- P=setup_getItemPos(STR_OS_MIC_ONOFF);
- I=P&0xff;
- P=P>>8;
- for(S=MIN_ITEM_SEL; S<MAX_ITEM_SEL; S++){
- if(setup_item[P][I][S]==STR_OS_AUTO)
- break;
- }
- setup_VA[SETUP_VA_MIC_ONOFF]=S;
-
- // 1st parameter was set to 0(OFF) originally, this seems like a bug
- AUDIF_Set_MICStatus(STATUS_AUTO, 0);//2004AUDDRV AudioSetMIC(0, 0); //Set MIC auto detect, 2:auto, (the second parameter:unsed now)
- run_save_sel_cmd(setup_VA[SETUP_VA_MIC_ONOFF], SETUP_VA_MIC_ONOFF); //gerry,3-10-20 17:10
- }
- void setup_SetMICOff()//nono 20020707
- {
- UINT32 P, I, S;
- P=setup_getItemPos(STR_OS_MIC_ONOFF);
- I=P&0xff;
- P=P>>8;
- for(S=MIN_ITEM_SEL; S<MAX_ITEM_SEL; S++){
- if(setup_item[P][I][S]==STR_OS_OFF)
- break;
- }
- setup_VA[SETUP_VA_MIC_ONOFF]=S;
-
- AUDIF_Set_MICStatus(STATUS_OFF, 0);//2004AUDDRV AudioSetMIC(0, 0); //Set MIC Off(the second parameter:unsed now)
- run_save_sel_cmd(setup_VA[SETUP_VA_MIC_ONOFF], SETUP_VA_MIC_ONOFF); //gerry,3-10-20 17:10
- }
- //wanghaoying 2003-9-15 15:15
- //***** 0: mic auto
- //***** 1: mic off
- #ifdef DEFAULT_MIC_OFF
- BYTE mic_flag=1;
- #else
- BYTE mic_flag=0;
- #endif
- void setup_MIC(BYTE set)//nono 20020707
- {
- #ifndef NO_MIC //Jack added 04/07/03
- int id;
- //BYTE font[]={STR_OS_ON,STR_OS_OFF};
- if(setup_IsMICOff())
- id= STR_OS_OFF; //mic_flag=1;
- else
- id= STR_OS_ON;
- if (set) {
- if(mic_flag==1)
- {
- id= STR_OS_ON;
- mic_flag=0;
- setup_SetMICAuto();
- }
- else
- {
- id= STR_OS_OFF;
- mic_flag=1;
- setup_SetMICOff();
- }
- }
- //id = font[mic_flag];
- //PrintOsdMsg(STR_OS_MIC_ONOFF|(id<<8),REGION1,1,4);
- PrintOsdMsg(STR_OS_MIC_ONOFF|(id<<OSDSTR_ID_TOTL_BIT),REGION1,1,4);
- #endif
- }
- /*
- **wanghaoying 2003-9-11 14:12
- **return value: 2--->DOWNMIXLTRT
- ** 3--->DOWNMIXSTEREO
- ** 4--->DOWNMIXVSRND
- ** 5--->AC3DOWNMIXOFF
- */
- UINT8 setup_GetDownmixMode(void)
- {
- return (setup_VA[SETUP_VA_DOWNMIX]);//(SETUP_SPK_DOWNMIX);
- }
- #ifdef SUPPORT_PROLOGIC_II //axel 2004/1/26 11:45
- /*
- **wanghaoying 2003-9-18 11:29
- **return value:
- **
- **
- */
- UINT8 setup_GetPrologicII(void)
- {
- return (setup_VA[SETUP_VA_PROLOGIC]);//(SETUP_PROLOGIC_II);
- }
- #endif
- #ifdef MIC_2CHANNEL//NONO 4-1-5 12:10//FOR MUTE_EXECUTE_MIC
- UINT8 setup_GetMICVol(void)
- {
- return (setup_VA[SETUP_VA_MIC_VOL_1]);
- }
- UINT8 setup_GetMICVol2(void)
- {
- return (setup_VA[SETUP_VA_MIC_VOL_2]);
- }
- #endif//MIC_2CHANNEL
- //gerry add for gbm,when we set to S-VIDEO,tv dac3 will be off,2004-5-13 15:44
- #if defined(S_VIDEO_OUT)&&defined(S_VIDEO_SET_TV_DAC3_OFF)
- /*
- ** gerry,2004-5-19 15:36
- **return value: 2--->S_VIDEO
- */
- UINT8 setup_GetVideoMode(void)
- {
- return (setup_VA[SETUP_VA_VIDEO]);//(SETUP_VIDEO_FORMAT);
- }
- #endif
- /*
- void SetSharpness(BYTE nVal)
- {
- printf("....SetSharpness = %dn", nVal);
- }
- */
- // video adjustment default setting ,seanlin 2004/08/17
- //#define CUSTOMER_ADJ_CURVE
- //#define EXTEND_CURVE_SCALE
- #define DEFAULT_CURVE1 16
- #define DEFAULT_CURVE2 224
- #ifdef CUSTOMER_ADJ_CURVE
- #define ADJ_SATURATION 2
- #define ADJ_CURVE1 16
- #define ADJ_CURVE2 224
- #else
- #define ADJ_SATURATION 0
- #define ADJ_CURVE1 16
- #define ADJ_CURVE2 224
- #endif
- #ifdef EXTEND_CURVE_SCALE
- #define CURVE_SCALE 10
- #else
- #define CURVE_SCALE 5
- #endif
- void SetBrightness(BYTE nVal)
- {
- int Src1, Src2, Dest1, Dest2;
- //Src1 = DEFAULT_CURVE1 + (SETUP_CONTRAST - 8) * 5;
- Src1 = DEFAULT_CURVE1 + (setup_VA[SETUP_VA_CONTRAST] - 8) * CURVE_SCALE;
- Dest1 = ADJ_CURVE1 + (nVal - 6) * CURVE_SCALE;
- if(Dest1<0) Dest1 =0;
- if(Src1<0) Src1 =0;
- //Src2 = DEFAULT_CURVE2 - (SETUP_CONTRAST - 8) * 5;
- Src2 = DEFAULT_CURVE2 - (setup_VA[SETUP_VA_CONTRAST] - 8) * CURVE_SCALE;
- Dest2 = ADJ_CURVE2 + (nVal - 6) * CURVE_SCALE;
- setup_vpp_curve (Src1,Dest1,Src2,Dest2);
- }
- void SetContrast(BYTE nVal)
- {
- int Src1, Src2, Dest1, Dest2;
-
- //joshua, 2005.1.3, increasing values of contrast and saturation in JPEG all-screen mode.
- if(Is_JPEG_PLAY_STATE())
- {
- nVal += 2;
-
- if(nVal>12)
- nVal = 12;
- }
- Src1 = DEFAULT_CURVE1 + (nVal - 6) * CURVE_SCALE;
- //Dest1 = ADJ_CURVE1 + (SETUP_BRIGHTNESS - 8) * 5;
- Dest1 = ADJ_CURVE1 + (setup_VA[SETUP_VA_BRIGHTNESS] - 8) * CURVE_SCALE;
- if(Dest1<0) Dest1 =0;
- if(Src1<0) Src1 =0;
- Src2 = DEFAULT_CURVE2 - (nVal - 6) * CURVE_SCALE;
- //Dest2 = ADJ_CURVE2 + (SETUP_BRIGHTNESS - 8) * 5;
- Dest2 = ADJ_CURVE2 + (setup_VA[SETUP_VA_BRIGHTNESS] - 8) * CURVE_SCALE;
- setup_vpp_curve (Src1,Dest1,Src2,Dest2);
- setup_tv_luma_scaling(nVal);
- }
- #ifdef IR_KEY_SET_VIDEO_MODE
- void SetBrightnessAdjust(BYTE nVal, BYTE nVal2)
- {
- int Src1, Src2, Dest1, Dest2;
- Src1 = DEFAULT_CURVE1 + (nVal2 - 8) * CURVE_SCALE;
- Dest1 = ADJ_CURVE1 + (nVal - 6) * CURVE_SCALE;
- if(Dest1<0) Dest1 =0;
- if(Src1<0) Src1 =0;
- Src2 = DEFAULT_CURVE2 - (nVal2 - 8) * CURVE_SCALE;
- Dest2 = ADJ_CURVE2 + (nVal - 6) * CURVE_SCALE;
- setup_vpp_curve (Src1,Dest1,Src2,Dest2);
- }
- void SetContrastAdjust(BYTE nVal, BYTE nVal2)
- {
- int Src1, Src2, Dest1, Dest2;
- Src1 = DEFAULT_CURVE1 + (nVal - 6) * CURVE_SCALE;
- Dest1 = ADJ_CURVE1 + (nVal2 - 8) * CURVE_SCALE;
- if(Dest1<0) Dest1 =0;
- if(Src1<0) Src1 =0;
- Src2 = DEFAULT_CURVE2 - (nVal - 6) * CURVE_SCALE;
- Dest2 = ADJ_CURVE2 + (nVal2 - 8) * CURVE_SCALE;
- setup_vpp_curve (Src1,Dest1,Src2,Dest2);
- }
- #endif//IR_KEY_SET_VIDEO_MODE
- #include <math.h>
- // the accepted range are from 0 to 100
- void SetHUE(BYTE nVal)
- {
- static const UINT8 lookup_table[][4] = {
- //bb br rb rr
- {1, 6, 0, 0}, // 0
- {0, 5, 0, 0}, // 1
- {0, 4, 0, 0}, // 2
- {0, 3, 0, 0}, // 3
- {0, 2, 0, 0}, // 4
- {0, 1, 0, 0}, // 5
- {0, 0, 0, 0}, // 6
- {0, 0, 1, 0}, // 7
- {0, 0, 2, 0}, // 8
- {0, 0, 3, 0}, // 9
- {0, 0, 4, 0}, // 10
- {0, 0, 5, 0}, // 11
- {0, 0, 6, 1}, // 12
- };
- if (nVal>12) nVal=6;
- setup_osd_hue (
- lookup_table[nVal][0], // bb
- lookup_table[nVal][1], // br
- lookup_table[nVal][3], // rr
- lookup_table[nVal][2] // rb
- );
- //printf("....SetHUE = %dn", nVal);
- }
- void SetSaturation(BYTE nVal)
- {
- //joshua, 2005.1.3, increasing values of contrast and saturation in JPEG all-screen mode.
- if(Is_JPEG_PLAY_STATE())
- {
- nVal += 6;
-
- if(nVal>12)
- nVal = 12;
- }
-
- // the input value is from (0,0,0) to (7,7,0)
- // here uses (0,0,0), (1,1,0), (2,2,0), (3,3,0), (4,4,0), (5,5,0), (6,6,0),
- // (7,2,0), (7,3,0), (7,4,0), (7,5,0), (7,6,0), (7,7,0),
- nVal += ADJ_SATURATION ;
-
- setup_osd_chroma(nVal, 0, 0);
- //printf("....SetSaturation = %dn", nVal);
- }
- #ifdef DIP_CFG_ENABLE
- void SetDeInterlace(BYTE nVal)
- {
- if(nVal <= 6)
- dip_sel = nVal;
- if( (dip_sel == 0)||(cd_type_loaded!=CDDVD) )
- dip_enable = 0;
- else
- dip_enable = 1;
- //printf("....dip_sel = %dn", dip_sel);
- //printf("....dip_enable = %dn", dip_enable);
- }
- #endif //#ifdef DIP_CFG_ENABLE
- #ifndef DVD_3D_SHOW_SPECTRUM //terry,2004/2/10 04:58PM
- void setup_DVD3DSound(BYTE set)
- {
- //BYTE newsel, newid;
- //newsel = SETUP_SPK_DOWNMIX;
- //newid = ITEM_SPK_DOWNMIX[newsel]; //Jeff 20020604
- UINT16 P, I, S;
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- S=setup_VA[SETUP_VA_DOWNMIX];
- if (set) {
- AUDIF_Set_Pause();//2004AUDDRV AudioSetPause(); //Jeff 20020605
- //delay_1ms(100);
- #ifdef NEW_SEARCH_OSD
- if(key_up_down == 1)
- {
- S++;
- }
- else if(key_up_down == 0)
- {
- S--;
- }
- #else
- S++;
- #endif
- /* marded by JS 20040822 //don't understand what this is!
- #ifdef NEW_SEARCH_OSD
- if (newsel > AC3DOWNMIXOFF) newsel=SPKSTART;
- if (newsel < SPKSTART) newsel=AC3DOWNMIXOFF;
- #elif defined(VTREK_DVD) //wanghaoying 2003-9-20 18:55
- if (newsel < DOWNMIXSTEREO)
- newsel = DOWNMIXSTEREO;
- else if ((newsel > DOWNMIXSTEREO)&&(newsel < AC3DOWNMIXOFF))
- newsel = AC3DOWNMIXOFF;
- else if (newsel > AC3DOWNMIXOFF)
- newsel = DOWNMIXSTEREO;
- #else
- if (newsel > AC3DOWNMIXOFF) newsel=2;
- #endif
- */
- if(setup_item[P][I][S]==0) {S=MIN_ITEM_SEL;}
-
- setup_VA[SETUP_VA_DOWNMIX] = S;
- //newid = ITEM_SPK_DOWNMIX[newsel]; //Jeff 20020604
- //to run speaker setup downmix mode
- exe_setup_function( STR_OS_DOWNMIX_SETUP, setup_item[P][I][S], 0);
- AUDIF_Set_Play();//2004AUDDRV AudioSetPlay(); //Jeff 20020605
- #ifdef NEW_SEARCH_OSD
- sound_type = setup_item[P][I][S];//newid;
- #endif
- }
- //PrintOsdMsg(STR_OS_SURR|(newid<<8),REGION1,1,4);
- PrintOsdMsg(STR_OS_SURR|(setup_item[P][I][S]<<OSDSTR_ID_TOTL_BIT),REGION1,1,4);
- }
- #endif
- #endif
- #ifdef USE_IR_TO_CHANGE_TVTYPE
- void setup_DVD_TVType(BYTE set) //STR_OS_TV_RATIO
- {
- UINT32 P, I, S;
- S = setup_VA[SETUP_VA_TV_RATIO];
-
- if (set) {
- S++;
- if (S > 4) {S=2;}
- setup_VA[SETUP_VA_TV_RATIO]=S;
- P=setup_getItemPos(STR_OS_TV_RATIO);
- I=P&0xff;
- P=P>>8;
- exe_setup_function( setup_item[P][I][1], setup_item[P][I][S], 0);
- ExitSetupPage(1); //nono 20031213
- if( 0 )//NP_P_CFG_for_Video != UserSet.P_V_CFG)
- {
- if(cd_type_loaded==CDDVD)
- {
- osd_disable();
- set_video_aspect();
- if( is_aspect_menu()== 0x02 )
- {
- osd_init();
- delay_srv_10ms(10);
- rep_run_the_menu();
- }
- }
- }
- }
-
- //PrintOsdMsg(STR_OS_SURR|(newid<<8),REGION1,1,4);
- PrintOsdMsg(STR_OS_TV_RATIO|(setup_item[P][I][S]<<OSDSTR_ID_TOTL_BIT),REGION1,1,4);
-
- run_save_sel_cmd(SYSPAGE,2);
- }
- #endif//USE_IR_TO_CHANGE_TVTYPE
- #ifdef AUTO_PLAY
- BYTE auto_play_on()
- {
- BYTE res;
- res = setup_VA[SETUP_VA_SSAVER]; //SETUP_SSAVER;
-
- if (res < 2) res=2;
- if (res==2) {
- res = 1;
- } else {
- res = 0;
- }
- return res;
- }
- #endif
- #ifdef VGA_CTRL_FORMAT
- int setup_IsVGAOn() //wangfeng,2003-10-23 13:15
- {
- int iRes=0;
- if ((id==STR_OS_TV_SYS)&&(tv_out_id==PC_VGA)) iRes=1;
- return iRes;
- }
- #endif
- #ifdef KARAOKE_MENU
- //JS 20040820 //this function should be modified to show KARAOKE page by new method
- void setup_KARAOKE()
- {
- #ifdef NEW_STYLE_SETUP
- GBM_run_setupmenu_flag =1;
- #endif
- if(KARAOKE_MENU_FLAG)
- KARAOKE_MENU_FLAG=0;
-
- else{
- full_scrn=SETUP;
- KARAOKE_MENU_FLAG=1;
- osd_init_setup();
- setupLevel=1;//2;
- page = AUDPAGE;
- index_y=MICONOFFITEM;//PASSWDITEM;
- index_y_start=0;
- index_y2=0;
- submenuStart=MICONOFFITEM+2;//PASSWDITEM+2;
-
- ShowSetupPage(2);
-
- }
- }
- #endif
- #ifdef SUPPORT_PROLOGIC_II
- int setup_IsPrologicOn() //wangfeng,2003-10-23 13:15
- {
- int iRes=0;
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_PROLOGIC);
- I=P&0xff;
- P=P>>8;
- if (setup_item[P][I][setup_VA[SETUP_VA_PROLOGIC]]!=STR_OS_OFF)
- {iRes=1;}
- return iRes;
- }
- /*
- * turn OFF PROLOGIC II
- * zhaoyanhua 2004-2-11 13:48
- */
- void setup_OffPrologic_II(void)
- {
- //#define PROLOGIC_OFF 4
- //printf("#### hehehehehehehhehehhe-----PRGLOCOG ---n");
- exe_setup_function(STR_OS_PROLOGIC,STR_OS_OFF,0);
- UINT16 P,I, S;
- P=setup_getItemPos(STR_OS_PROLOGIC);
- I=P&0xff;
- P=P>>8;
- for (S=MIN_ITEM_SEL; S<MAX_ITEM_SEL; S++){
- if(setup_item[P][I][S]==STR_OS_OFF)
- {break;}
- }
-
- setup_VA[SETUP_VA_PROLOGIC]=S;
- run_save_sel_cmd(setup_VA[SETUP_VA_PROLOGIC], SETUP_VA_PROLOGIC);
- }
- #endif
- //Maoyong 2004.05.19 for record password input state, used in ir_parser.c now
- BYTE setup_IsSettingPassword(void)
- {
- printf("nn <<<<setup_IsSettingPassword>>>n");
- if( (full_scrn & SETUP) && (setup_item[page][index_y][1] == STR_OS_PASSWORD) )
- return 1;
- else
- return 0;
- }
- #ifdef SHOW_STANDBY_TIMER //suqiaoli add 2003-8-2
- //JS 20040820 //this function should be modified to show standby timer in new method
- void polling_setup_standby_timer(void)
- {
- if((setup_item[page][index_y][1]==STR_OS_VFD_TIME)&&(setupLevel==1))
- {
- psprintf(linebuf, "%02d:%02d:%02d",show_standby_hour, show_standby_min, show_standby_sec);
- osd_DrawString(SETUP_SUB_XSTART+1,STANDBY_TIMER_ITEM+index_y, linebuf, SDEFAULTCOLOR,SBGCOLOR);
- }
- if (setup_item[page][index_y][1]==STR_OS_VFD_TIME)
- flag_standby_timer=1;
- else
- flag_standby_timer=0;
- }
- #endif
- #ifdef CORTROL_VCD_ONF
- int setup_IsVCD_OFF() //wangap add 2005/5/27
- {
- UINT16 P,I;
- P=setup_getItemPos(STR_OS_VCD);
- I=P&0xff;
- P=P>>8;
- if ( setup_item[P][I][setup_VA[SETUP_VA_VCD]]==STR_OS_OFF) return 1;
- else return 0;
- }
- #endif
- #ifdef SUPPORT_SPI_QSI
- //for spi cmd to setup ssaver uOnOff = 0: on, 1: off
- void setup_SPI_ssaver_onoff(UINT32 uOnOff)
- {
- setup_VA[SETUP_VA_SSAVER] = MIN_ITEM_SEL + uOnOff;
- //run_save_sel_cmd(setup_VA[SETUP_VA_SSAVER],SETUP_VA_SSAVER);
- }
- void custm_SPI_region_setting(UINT32 uRegion)
- {
- UINT8 uID;
- UINT16 P, I;
- UserSet.P_RCD = uRegion;
- //printf("-=-=-=-=-=--=-=-reg=%d UID=%dn",uRegion,UserSet.P_RCD);
- setup_VA[SETUP_VA_REGION_CODE] = uRegion + 2; //setup item update
- run_save_total_userSet(); //save user set update
- P=setup_getItemPos(STR_OS_REGION_CODE);
- I=P&0xff;
- P=P>>8;
- uID = setup_item[P][I][setup_VA[SETUP_VA_REGION_CODE]];
- //PrintOsdMsg(uID, REGION1, 1, 0);
- }
- #endif
- #ifdef TEST_BASS_MANAGEMENT
- UINT16 SetBassConfig()
- {
- UINT16 bass_config;
- int front,center,surround,sub;
-
- front = setup_VA[SETUP_VA_FSPK]-MIN_ITEM_SEL;//SETUP_SPK_FRONT-2;
- center = setup_VA[SETUP_VA_CSPK]-MIN_ITEM_SEL;//SETUP_SPK_CENTER-2;
- surround = setup_VA[SETUP_VA_SSPK]-MIN_ITEM_SEL;//SETUP_SPK_SURROUND-2;
- sub = setup_VA[SETUP_VA_SUBWOOFER]-MIN_ITEM_SEL;//SETUP_SPK_SUBWOOFER-2;
- bass_config = 0;
-
- printf("test : front=%d,center=%d,surround=%d,sub=%dn",front,center,surround,sub);
-
- //mapping table
- switch (front)
- {
- case 0: //Front Large
- if (surround==0) //Surround Large
- {
- if ((sub==0)||((sub==1)&&(center==1)))
- bass_config = 3; //config3
- else
- bass_config = 0; //x
- }
- else if(surround==2) //Surround None
- {
- if (center==1) //Center Small
- bass_config = 2; //simplified
- else //Center Large or None
- bass_config = 0; //x
- }
- else //Surround Small
- {
- bass_config = 2; //simplified
- }
- break;
- case 1: //Front Small
- if (surround==0) //Surround Large
- bass_config = 4; //car-simplified
- else
- bass_config = 1; //config1;
- break;
- }
- bass_config = 0x00ffff & ((front<<12)+(center<<8)+(surround<<4)+bass_config);
- printf ("test : return bass_config = %x,%dn",bass_config,bass_config);
- return bass_config;
- }
- #endif //TEST_BASS_MANAGEMENT
- #ifdef SELECT_MEDIA_IN_SETUPMENU //Maoyong 2004-8-9 18:12
- void setupSettingMediaItem(void)
- {
- //we shouldn't use the define of DISC_ITEM, USB_ITEM, and CARD_ITEM
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_MEDIA_TYPE);
- I=P&0xff;
- P=P>>8;
-
- if(media_type == MEDIA_CD){
- //SETUP_MEDIA_TYPE = DISC_ITEM + 2;
- setup_sel[P][I] = DISC_ITEM + MIN_ITEM_SEL;
- setup_VA[SETUP_VA_MEDIA_TYPE] = DISC_ITEM + MIN_ITEM_SEL;
- }
- else if(storage_type == USB_DEVICE){
- //SETUP_MEDIA_TYPE = USB_ITEM + 2;
- setup_sel[P][I] = USB_ITEM + MIN_ITEM_SEL;
- setup_VA[SETUP_VA_MEDIA_TYPE] = DISC_ITEM + MIN_ITEM_SEL;
- }
- else{
- //SETUP_MEDIA_TYPE = CARD_ITEM + 2;
- setup_sel[P][I] = CARD_ITEM + MIN_ITEM_SEL;
- setup_VA[SETUP_VA_MEDIA_TYPE] = CARD_ITEM + MIN_ITEM_SEL;
- }
- //run_save_sel_cmd(setup_VA[SETUP_VA_MEDIA_TYPE], SETUP_VA_MEDIA_TYPE);
- }
- #endif