setup_ui_sel.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:37k
源码类别:

DVD

开发平台:

C/C++

  1. /*
  2. **  Freyman, 2004-3-29 17:57
  3. */
  4. #ifdef SELECT_MEDIA_IN_SETUPMENU
  5. extern BYTE media_changed_flag;
  6. #endif
  7. #ifdef EASTWIN
  8. #include "gpio.h"
  9. #endif
  10. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)
  11. static inline void bbk_sel_main_setup_menu(void)
  12.     {
  13.         switch(index_x)
  14.         {
  15.             case ONE_KEY_PASS_X :
  16.                 one_key_pass_flag = 1;  
  17.                 main_setup = 0;
  18.                 ShowOneKeyPassPage();   
  19.                 break;
  20.             case SETUP_X:
  21.                 one_key_pass_flag = 0; 
  22.                 main_setup = 0; 
  23.                 ShowProfessionalSetup();
  24.                 break;
  25.             case EXIT_SETUP_MENU_X:
  26.                 index_x = 0;
  27.                 one_key_pass_flag = 0;
  28.                 main_setup = 0;  
  29.                 ExitSetupPage(1);
  30.                 break;
  31.         }
  32. }
  33. #endif
  34. #ifdef NEXTPAGE_SYS
  35. static inline void sel_show_turnpage(BYTE id)
  36. {
  37.     if (id==STR_OS_NEXT_PAGE)
  38.     {
  39.         page=SysNextPage;
  40.         printf("======      clead next       ======nn");
  41.     }else
  42.     //if (id==STR_OS_PREV_PAGE)
  43.     {
  44.         page=SYSPAGE;
  45.         printf("======      clead PREV       ======nn");
  46.     }
  47.     setupLevel=1;
  48.     index_y = 0;
  49.     index_y_start=0;
  50.     ShowSetupPage(1);
  51.     ShowSetupPage(2);
  52.     return;
  53. }
  54. #endif
  55. static inline void sel_func_lock_state(void)
  56. {
  57. #ifdef SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-15 14:20
  58.     if(passwdGUI_state == INPUT_OLD_PASSWD_STATE)
  59.     {
  60.         //input old password
  61.         passwdGUI_state = INPUT_NEW_PASSWD_STATE;
  62.         setup_PasswdGUIRefresh(passwdGUI_state);
  63.         UserSet.parental_ststus =C_UNLOCK;
  64.         digit_cnt = 0;
  65.     }
  66.     else if(passwdGUI_state == INPUT_GRADE_PASSWD_STATE)
  67.     {
  68.         passwdGUI_state = SHOW_OK_STATE;
  69.         setup_PasswdGUIRefresh(passwdGUI_state);
  70.         UserSet.parental_ststus = C_LOCK ;
  71.         digit_cnt = 0;
  72.     }
  73.     else if(passwdGUI_state == NO_GUI_STATE)
  74. #endif
  75.         show_lock(C_UNLOCK,1);
  76. }
  77. void setup_func_select(void)
  78. {
  79.     const char *str;
  80.     #ifdef STORE_VIDEO_PARAMETER
  81.     BYTE res; 
  82.     #endif 
  83.     
  84.     #ifdef SUPPORT_FUNCTION_MENU
  85.     if((full_scrn&SETUP_PLUS) || (setup_menu_plus_timer))
  86.     {
  87.       #ifdef SUPPORT_DISPLAY_MENU
  88.          if(In_Display_Menu())
  89.          {
  90.             setup_menu_plus_timer = DISPLAY_MENU_SHOW_TIME;
  91.         
  92.           if((index_y == PBC_MENU_ITEM) && (cd_type_loaded == CDDVD))
  93.           {
  94.              call_ir_func(IRC_ROOT_MENU);//ircmd_root_menu();
  95.             
  96.               ShowSetupPage_plus(MENU_REFRESH);  
  97.           }
  98.           else if((index_y == TIME_ITEM))
  99.           {
  100.           if(!In_Goto_Menu())
  101.                 {
  102.                    //printf("go into goto state at the first time.....n");
  103.                    goto_time = 0;
  104.                    ir_select_number = 0;
  105.                    index_x = 6;
  106.                    Set_Goto_menu_flag();
  107.                    ShowSetupPage_plus(MENU_REFRESH);
  108.                 }
  109.                 else 
  110.                 {
  111.                    //printf("exe goto function,goto_time:%d.....n",goto_time);
  112.                    goto_sec = goto_time%100;            
  113.    goto_min = (goto_time%10000)/100;
  114.    goto_hour = goto_time/10000;
  115.                    search_func_select();
  116.                    Clear_Goto_menu_flag();
  117.                 } 
  118.           }
  119.           else
  120.             return;
  121.          }
  122.          else
  123.          #endif//end #ifdef SUPPORT_DISPLAY_MENU
  124.          if((!(full_scrn&SETUP_PLUS)) && (setup_menu_plus_timer))
  125.          {//have exited menu plus,only adjust the brightness.
  126.              setup_menu_plus_timer = MENU_PLUS_SHOW_TIME;
  127.              
  128.                #ifdef DEBUG_FUNCTION_MENU
  129.              printf("brightness ++,:%dn",setup_sel_plus[0][1]);
  130.                 #endif
  131.             
  132.              //range is 0~14(-7~7)
  133.              if(setup_sel_plus[0][1] >= BRIGHTNESS_TOTAL_CLASS)
  134.                setup_sel_plus[0][1] = 0;
  135.             else
  136.                setup_sel_plus[0][1]++;
  137.                
  138.              #ifdef SUPPORT_SPI
  139.              scommand = ADJUST_BRIGHTNESS; 
  140.              #endif
  141.              
  142.              show_level(BRIGHTNESS_PLUS_ID,setup_sel_plus[0][1],BRIGHTNESS_TOTAL_CLASS);
  143.              
  144.           /*
  145.               ExitSetupPage(0);
  146.               
  147.               if(setup_sel_plus[page][index_y] < 7)
  148.                 psprintf(RegionValStr[REGION1],":-%d",(7-setup_sel_plus[page][index_y]));
  149.               else if(setup_sel_plus[page][index_y] == 7)
  150.                 psprintf(RegionValStr[REGION1],":%d",(7-setup_sel_plus[page][index_y]));
  151.               else
  152.                 psprintf(RegionValStr[REGION1],":+%d",(setup_sel_plus[page][index_y]-7));
  153.                 
  154.               PrintOsdMsg(STR_OS_BRIGHTNESS,REGION1,1,1);
  155.           */
  156.         }
  157.         //in menu plus
  158.         else if(setupLevel == 1)
  159.         {
  160.             if(setup_item_plus[page][index_y][1] == STR_OS_DISPLAY)
  161.             {//will call the display function
  162.                 #ifdef DEBUG_FUNCTION_MENU
  163.                 printf("call display functionn");
  164.                 #endif
  165.                 //退出菜单
  166.           #ifdef SUPPORT_DISPLAY_MENU
  167. ircmd_display_menu();
  168. #else
  169.                 setup_menu_plus_timer = 0;
  170.                 ExitSetupPage(0);
  171.                 
  172.                 //call display function
  173.                 ircmd_display();
  174.           #endif
  175.             }
  176.             else if(setup_item_plus[page][index_y][0] == SET_SCALE) 
  177.             {//Brightness
  178.               //退出菜单
  179.               ExitSetupPage(0);
  180.               //显示亮度设定之osd
  181.               show_level(BRIGHTNESS_PLUS_ID,setup_sel_plus[0][1],BRIGHTNESS_TOTAL_CLASS);
  182.              
  183.             }
  184.             else if(setup_item_plus[page][index_y][1] == STR_OS_TV_RATIO)
  185.             {//exe right function to show the sub menu
  186.               setup_func_right();
  187.             }
  188.             else if(setup_item_plus[page][index_y][0] == SET_SHOW)
  189.             {//Battery status
  190.               #ifdef DEBUG_FUNCTION_MENU
  191.               printf("Show battery status!!!n");
  192.               #endif
  193.               //退出菜单
  194.               setup_menu_plus_timer = 0;
  195.               ExitSetupPage(0);
  196.               //显示电池电量
  197.               
  198.               linebuf[0] = battery_status[setup_sel_plus[0][3]];
  199.               linebuf[1] = NULL;
  200.               
  201.               strcpy(RegionValStr[REGION1], linebuf);
  202.               PrintOsdMsg(0, REGION1, 3, 1);             
  203.             }
  204.             else //if(setup_item_plus[page][index_y][1] == STR_OS_SETUP)
  205.             {//enter setup menu!!!
  206.                 #ifdef DEBUG_FUNCTION_MENU
  207.                 printf("call setup menu functionn");
  208.                 #endif
  209.                 //退出菜单
  210.                 setup_menu_plus_timer = 0;
  211.                 //call function
  212.                 ircmd_setup();
  213.             }
  214.         }
  215.         else if(setupLevel == 2)
  216.         {//只有在LCD Mode下有效
  217.             #ifdef DEBUG_FUNCTION_MENU
  218.             printf("select and return,y:%d y2:%dn",index_y,index_y2);
  219.             #endif
  220.              
  221.               submenuStart = index_y+SETUP_MENU_YSTART_PLUS;
  222.               sel = setup_sel_plus[page][index_y];
  223.              
  224.             //将之前选中的菜单项转为正常显示
  225.               id = setup_item_plus[page][index_y][sel];
  226.               #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39
  227.               osd_draw_setup_button(SETUP_SUB_XSTART_PLUS, (sel-2)+submenuStart, SETUP_MAX_WIDTH_PLUS-SETUP_SUB_XSTART_PLUS, SBGCOLOR, 0);
  228.               #endif
  229.               str = setup_SetItemString();
  230.               osd_DrawString(SETUP_SUB_XSTART_PLUS+1, (sel-2)+submenuStart, (char *)str, SFONTCOLOR, SBGCOLOR);
  231.               
  232.               //将选中的菜单项反显以表示选中
  233.               id = setup_item_plus[page][index_y][index_y2+2];
  234.               #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39
  235.               osd_draw_setup_button(SETUP_SUB_XSTART_PLUS, (index_y2+submenuStart), SETUP_MAX_WIDTH_PLUS-SETUP_SUB_XSTART_PLUS, SANTIBGCOLOR, 1);
  236.               #endif
  237.               str = setup_SetItemString();
  238.               osd_DrawString(SETUP_SUB_XSTART_PLUS+1, index_y2+submenuStart, (char *)str, SANTIFONTCOLOR, SANTIBGCOLOR);
  239.             
  240.             //We need to send special command to MCU,how to do it?
  241.             //MPEG control or MCU control?
  242.               setup_sel_plus[page][index_y] = index_y2 + 2;
  243.               sel = setup_sel_plus[page][index_y];
  244.             
  245.               #ifdef SUPPORT_SPI
  246.               if(sel == MIN_ITEM_SEL_PLUS)
  247.                 scommand = LCD_NORMAL_FORMAT;
  248.               else if(sel == MIN_ITEM_SEL_PLUS+1)
  249.                 scommand = LCD_WIDE_FORMAT;
  250.               /*
  251.               else
  252.                 scommand = LCD_FULL_FORMAT;
  253.               */
  254.               #else
  255.               if(setup_item_plus[page][index_y][0] == SET_FUNC)
  256.                 exe_setup_function(setup_item_plus[page][index_y][1],setup_item_plus[page][index_y][index_y2 + 2],1);
  257.               #endif
  258.             //return to the first menu
  259.               setup_func_left();
  260.             }  
  261.     } //if((full_scrn&SETUP_PLUS) || (setup_menu_plus_timer))
  262.     else
  263.     {
  264.     #endif //end #ifdef SUPPORT_FUNCTION_MENU
  265.     UINT8   md=setup_item[page][index_y][0];
  266.         
  267. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE
  268.     if(main_setup)
  269.     {
  270.         bbk_sel_main_setup_menu();
  271.         return;
  272.     }
  273. #endif  //defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)
  274. #ifdef NEW_PARENTAL_GUI//zhaoyanhua add 2003-11-28 14:56
  275.     if(new_parental_gui)
  276.     {
  277.         check_parent_password();
  278.         new_parental_gui = 0;
  279.         return;    
  280.     }
  281. #endif
  282.     
  283. #ifdef SUPPORT_FUNCTION_MENU
  284.     #ifdef SUPPORT_SPI
  285.     if (setup_item[page][index_y+index_y_start][0] == SET_SHOW) 
  286.       return;
  287.     #endif
  288. #endif
  289.     
  290. #if defined(DVD_AUDIO)//20040302
  291.     if(pDSV->hid_gp_chk_pwd==2)
  292.     {
  293.         check_dvd_audio_password();//nono 2004/3/2 05:40PM
  294.               return; 
  295.     }
  296. #endif//#if defined(DVD_AUDIO)
  297.     
  298.     if(setupLevel==0)
  299.     {
  300.         #ifdef SETUP_DONGLI459          //oujx for tonic auto down when press select
  301.         setup_func_down();
  302.         #endif
  303.         return;
  304.     }
  305.     else if (setupLevel == 1)
  306.     {
  307. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  308.         if(one_key_pass_flag)//zhaoyanhua add 2003-11-18 17:26
  309.             sel = GetOneKeyPageSel(index_y);
  310.         else
  311. #endif
  312.         sel=setup_sel[page][index_y+index_y_start];
  313.         
  314.         id=setup_item[page][index_y+index_y_start][1];
  315.         if (id == STR_OS_RETURN_MAIN_SETUP)
  316.         {
  317.             if (full_scrn&CUSTM)
  318.             {
  319.                 ExitSetupPage(1);
  320.             }
  321.             else 
  322.             {
  323.                 #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE
  324.                 main_setup = 1;
  325.                 if(index_x == ONE_KEY_PASS_X)
  326.                     one_key_pass_flag = 0;
  327.                 
  328.                  osd_init_bbk_setup();           
  329.                 ShowSetupMainPage();
  330.                 return;
  331.                 #endif
  332.             
  333.             #ifdef NEXT_PAGE_SHOW_ADVANCED_SETUP            //gerry,2004-3-12 13:19
  334.                 sel_show_turnpage(id);
  335.                 return;
  336.             #endif//NEXT_PAGE_SHOW_ADVANCED_SETUP
  337.                 ExitSetupPage(1);
  338.             }
  339.         }
  340.         else
  341.         #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:07
  342.         if((id==STR_OS_NEXT_PAGE)||(id==STR_OS_PREV_PAGE))
  343.         {
  344.             sel_show_turnpage(id);
  345.         }
  346.         else
  347. #endif      
  348.         {
  349. #ifdef VIDEO_SETUP_NEW_GUI//zhaoyanhua add 2004-1-8 17:03
  350.         if(page == VIDEOPAGE)
  351.         {   
  352.             setupLevel = 2;
  353.             setup_ShowVideoGUI(id);
  354.         }
  355.         else
  356. #endif//VIDEO_SETUP_NEW_GUI
  357. #ifndef DVB_MENU_SETUP_STYLE
  358.             setup_func_right();
  359. #else
  360. {
  361. if(system_state == SYSTEM_TS)
  362. {
  363. //if((page == INSTALLPAGE)||(page == CHANNELPAGE))
  364. if(IsDvbSubMenuPageItem()) {
  365. setup_func_right();
  366. }
  367. else
  368.             {
  369.                 dvb_func_select();
  370.                 printf(" page = %d n", page);
  371.                 return;
  372.             }
  373. }
  374. else
  375.         setup_func_right();
  376. }
  377. #endif
  378.         }
  379.     }
  380.     else if (setupLevel == 2)
  381.     {
  382. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  383.         if(one_key_pass_flag)//OENKEYPASSPAGE
  384.         {
  385.             sel = GetOneKeyPageSel(index_y);
  386.         }
  387.         else
  388. #endif
  389.         sel=setup_sel[page][index_y];
  390.         
  391.         id=setup_item[page][index_y][1];
  392. #ifdef SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-16 9:58
  393.         //if pasword ITEM,show  password GUI
  394.         if((page == SYSPAGE) && (index_y == PASSWDITEM) && (passwdGUI_state == NO_GUI_STATE))
  395.         {
  396.             UserSet.parental_ststus = C_LOCK;
  397.             passwdGUI_state = INPUT_OLD_PASSWD_STATE;
  398.             setup_ShowPasswdGUI();
  399.             return;
  400.         }
  401. #endif//SETUP_PASSWORD_GUI
  402.         
  403.         //PASSWORD item
  404. #ifdef SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-16 9:58
  405.         //in password GUI,then can input password
  406.         if(((passwdGUI_state != NO_GUI_STATE) && (full_scrn & SETUP))//SETUP state
  407.           || ((md == SET_NM) && (full_scrn & CUSTM)) )//CUSTM state
  408. #else       
  409.         if (md==SET_NM)
  410. #endif//SETUP_PASSWORD_GUI  
  411.         {
  412.             if(digit_cnt == PASSWORD_LENGTH)
  413.             {
  414.                 if (UserSet.parental_ststus==C_LOCK && (tmp_passwd==UserSet.parent_passwd 
  415.                     #ifdef USER_SUPER_PASSWORD
  416.                     ||tmp_passwd==USER_SUPER_PASSWORD 
  417.                     #endif
  418.                     ))
  419.                 {
  420.                     sel_func_lock_state();
  421.                 }
  422.                 else
  423.                 {
  424. #ifdef SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-30 11:25
  425.                     //old password error.
  426.                     //refresh passwd GUI
  427.                     if((passwdGUI_state == INPUT_OLD_PASSWD_STATE)
  428.                        ||(passwdGUI_state == INPUT_GRADE_PASSWD_STATE))
  429.                     {
  430.                         BYTE tmp_state = passwdGUI_state;
  431.                         
  432.                         passwdGUI_state = SHOW_ERROR_STATE;
  433.                         setup_PasswdGUIRefresh(passwdGUI_state);
  434.                         passwdGUI_state = tmp_state;
  435.                     }
  436. #endif//SETUP_PASSWORD_GUI
  437.                     if(UserSet.parental_ststus==C_UNLOCK)
  438.                     {
  439.                         UserSet.parent_passwd=tmp_passwd;
  440. #ifdef  SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-15 16:18
  441.                         if(passwdGUI_state == INPUT_NEW_PASSWD_STATE)
  442.                         {       
  443.                         //old password is correct.
  444.                         //so permit input new password
  445.                         passwdGUI_state = SHOW_OK_STATE;
  446.                         setup_PasswdGUIRefresh(passwdGUI_state);
  447.                         digit_cnt = 0;
  448.                         }
  449. #endif//SETUP_PASSWORD_GUI                  
  450.                     }
  451. #ifdef TONIC_DVD
  452.                     if(UserSet.parental_ststus==C_LOCK)
  453.                     ShowPasswordErr=1;
  454. #endif
  455. #ifndef SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-15 14:19
  456.                     if (!(full_scrn&CUSTM))//zhaoyanhua tmep mask 2004-1-15 15:00
  457.                         show_lock(C_LOCK,1);
  458. #endif//SETUP_PASSWORD_GUI              
  459.                 }
  460.             #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  461.                 if(one_key_pass_flag)
  462.                 {
  463.                     switch(index_y)
  464.                     {
  465.                         case 0:
  466.                             SETUP_TV_FORMAT = sel;//to make ONEKEYPAGE and SYSPAGE same.
  467.                             break;
  468.                         case 1: 
  469.                             SETUP_SPK_DOWNMIX = sel;// to make ONEKEYPAGE and MULTISPKPAGE same. 
  470.                             break;
  471.                     }
  472.                 }
  473.             #endif
  474.                 
  475.                 if(user_input_pwd!=1)//2002-6-13 for huajia
  476.                     run_save_sel_cmd(page,index_y);
  477.             }
  478. #ifdef SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-15 14:21
  479.             else if((passwdGUI_state == SHOW_OK_STATE) && (digit_cnt==0))
  480.             {
  481.                 passwdGUI_state = NO_GUI_STATE; //exit PASSWORD GUI, return main setup
  482.                 UserSet.parental_ststus = C_LOCK ;
  483.                 //for GRADE ITEM, save level
  484.                 if ( (page==SYSPAGE) && (index_y==GRADEITEM) ) 
  485.                 {   
  486.                     SETUP_GRADE = index_y2 + 2;
  487.                     sel = index_y2+2;
  488.                     SETUP_CUSTM_GRADE = SETUP_GRADE;
  489.                     exe_setup_function(setup_item[page][index_y][1],setup_item[page][index_y][sel],1);//zhaoyanhua add 2004-2-9 15:47
  490.                     run_save_sel_cmd(page, index_y); 
  491.                 }
  492.                 //reset SANTIBGCOLOR.
  493.                 //before enter GUI , make SANTIBGCOLOR not trantent
  494.                 //when exit GUI, must reset SANTIBGCOLOR
  495.                 //SetOsdCol(mn_osd_col2);  //fengjl mask 2004-06-22 23:10
  496.                 #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-2 17:38
  497.                 SetOsdCol(mn_osd_col1);
  498.                 #endif
  499.                 setupLevel = 1;
  500.                 ShowSetupPage(2);
  501.                 return;
  502.             }
  503. #endif//SETUP_PASSWORD_GUI
  504. #ifdef ENTER_USE_OLD_PASSWD         
  505.             else if( (UserSet.parental_ststus==C_UNLOCK)&&(digit_cnt==0) )
  506.             {//terry,2003/8/29 12:10AM,auto lock
  507.                 show_lock(C_LOCK,1);
  508.                 run_save_sel_cmd(page,index_y);
  509.             }
  510. #endif
  511.             reset_passwd_cnt();
  512.             
  513. #ifdef  SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-15 14:43
  514.             if(passwdGUI_state == NO_GUI_STATE)
  515. #endif      
  516.             
  517.             setup_func_left();
  518.             return;
  519.         }
  520.         else
  521.         if (setup_item[page][index_y][0]==SET_SCALE)
  522.         {
  523.             // run_save_sel_cmd(page,index_y);
  524.             //    setup_func_left();
  525.         }
  526.         else
  527. #ifdef SHOW_STANDBY_TIMER  //suqiaoli  add 2003-8-8 
  528.         if (setup_item[page][index_y][1]==STR_OS_VFD_TIME)
  529.         {
  530.             if(index_x!=0)
  531.                 exe_standby_timer();
  532.             else
  533.                 setup_func_left();
  534.         }
  535.         else
  536. #endif      
  537.         if ((index_y2+2) != sel)
  538.         {
  539. #ifdef SETUP_PASSWORD_GUI//zhaoyanhua add 2004-1-16 9:48
  540.             if ( (page==SYSPAGE) && (index_y == GRADEITEM) && (passwdGUI_state == NO_GUI_STATE)) 
  541.             {
  542.                 UserSet.parental_ststus = C_LOCK;
  543.                 passwdGUI_state = INPUT_GRADE_PASSWD_STATE;
  544.                 printf("### --- GRADE :passwdGUI_state--%d-n",passwdGUI_state);
  545.                 setup_ShowPasswdGUI();
  546.                 
  547.                 return;
  548.             }
  549.             #endif//SETUP_PASSWORD_GUI          
  550.             
  551.             //UP origional
  552.             id = setup_item[page][index_y][sel];
  553.             #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39
  554.             osd_draw_setup_button(SETUP_SUB_XSTART, (sel-2)+submenuStart+1, SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, SBGCOLOR, 0);
  555.             #endif
  556.             str = setup_SetItemString();
  557.             osd_DrawString(SETUP_SUB_XSTART+1, (sel-2)+submenuStart+1, (char *)str, SFONTCOLOR, SBGCOLOR);
  558.             //DOWN current
  559.             id = setup_item[page][index_y][index_y2+2];
  560.             #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39
  561.             osd_draw_setup_button(SETUP_SUB_XSTART, (index_y2+submenuStart)+1, SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, SANTIBGCOLOR, 1);
  562.             #endif
  563.                         
  564.             str = setup_SetItemString();
  565.             
  566.             osd_DrawString(SETUP_SUB_XSTART+1, index_y2+submenuStart+1, (char *)str, SANTIFONTCOLOR, SANTIBGCOLOR);
  567.             setup_sel[page][index_y] = index_y2 + 2;
  568. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  569.             if(one_key_pass_flag)
  570.             {
  571.                 switch(index_y)
  572.                 {
  573.                     case 0:
  574.                         SETUP_SPK_DOWNMIX = index_y2+2;// to make ONEKEYPAGE and MULTISPKPAGE same. 
  575.                         break;
  576.                     case 1: 
  577.                         SETUP_TV_FORMAT = index_y2+2;//to make ONEKEYPAGE and SYSPAGE same.
  578.                         break;
  579.                     default: sel = 2;
  580.                 }
  581.                 sel = index_y2+2;
  582.             }
  583.             else
  584.             {
  585.                 setup_sel[page][index_y] = index_y2 + 2;
  586.             sel = setup_sel[page][index_y];
  587.             }
  588. #else
  589.             setup_sel[page][index_y] = index_y2 + 2;
  590.             sel = setup_sel[page][index_y];
  591. #endif
  592.             
  593.             id = setup_item[page][index_y][1];
  594.             if ( (page==CUSTMPAGEINDEX) && (id==STR_OS_RATING) )
  595.             {
  596.                 SETUP_GRADE = SETUP_CUSTM_GRADE;
  597.                 run_save_sel_cmd(SYSPAGE, GRADEITEM);
  598.             }
  599.             //zhaoyanhua add these sentence 2003-12-2 11:13
  600.             //to avoid the bug when set rating in SYSPAGE ,then excute"DEFAULT VALUE"
  601.             //can not lock the disc.
  602.             else if((page == SYSPAGE)&&(id == STR_OS_RATING))
  603.             {
  604.                 SETUP_CUSTM_GRADE = SETUP_GRADE;
  605.                 run_save_sel_cmd(CUSTMPAGEINDEX, CUSTMRATEITEM); //20040325
  606. //              run_save_sel_cmd(CUSTMPAGEINDEX, CUSTMPASSWDITEM); 
  607.             }
  608.             if (md==SET_FUNC)
  609.             {
  610. #ifdef SET_PARENTAL_STS_AUTO_LOCK 
  611.                 if( (UserSet.parental_ststus==C_UNLOCK)&& (page==SYSPAGE)&&(id==STR_OS_RATING)  )
  612.                 {//nono,2003-11-21 12:06,auto lock
  613.     
  614.                     UserSet.parental_ststus=C_LOCK;
  615.                     SETUP_PASSWORD = MIN_ITEM_SEL+C_LOCK;
  616.                     run_save_sel_cmd(SYSPAGE,PASSWDITEM);
  617.                 }
  618. #endif //SET_PARENTAL_STS_AUTO_LOCK
  619.  #ifdef SUPPORT_SPI
  620.          if(setup_item[page][index_y][1] == STR_OS_VIDEO)
  621.          {
  622.            switch(setup_item[page][index_y][sel])
  623.            {
  624.            case STR_OS_P_SCAN_YUV:
  625.              tv_out_id = P_SCAN;
  626.              
  627.          
  628.              if(pdvd_mode == AV_OUTPUT_MODE)
  629.              {
  630.                sp8200tv_setup_custom_output(TV_OUT_YBRYBR);
  631.                //printf("in output mode and YPbPr ouputn");
  632.              }
  633.              else
  634.              {//just record
  635.                //printf("in Pdvd mode and setup YPbPr ouput ,just record...n");
  636.              }
  637.            break;
  638.            case STR_OS_YCbCr:
  639.              tv_out_id = INTERLACE;
  640.            
  641.              if(pdvd_mode == AV_OUTPUT_MODE)
  642.              {
  643.                sp8200tv_setup_custom_output(TV_OUT_YUVRGB);
  644.                //printf("in output mode and YCbCr ouputn");
  645.              }
  646.              else
  647.              {//just record
  648.                //printf("in Pdvd mode and setup YCbCr ouput,just record...n");
  649.              }
  650.            break;
  651.            case STR_OS_S_VIDEO:
  652.              tv_out_id = TV_SVIDEO;
  653.            
  654.              if(pdvd_mode == AV_OUTPUT_MODE)
  655.              {
  656.                sp8200tv_setup_custom_output(TV_OUT_CScRGB);
  657.                //printf("in output mode and SV/CVBS ouputn");
  658.              }
  659.              else
  660.              {//just record id!!!
  661.                //printf("in Pdvd mode and setup SV/CVBS ouput,just record...n");
  662.              }
  663.             break;
  664.             }
  665.             search_ap_tv_out_id();
  666.          
  667.             #ifdef STORE_VIDEO_PARAMETER
  668.             res = WriteToI2c(0xa0, TV_OUT_ID_ADDR,(BYTE *)&tv_out_id,1);
  669.             if(res<0)
  670.             {
  671.               BYTE i=0;
  672.               for(i=0;((i<15)&&(res<0));i++)
  673.               {
  674.                 res = WriteToI2c(0xa0, TV_OUT_ID_ADDR, (BYTE *)&tv_out_id, 1);
  675.                 printf("sel tv_out_id store error,retry.......i%d res:%dn",i,res);
  676.               }
  677.             }
  678.             #endif
  679.           }  
  680.           else if(setup_item[page][index_y][1] == STR_OS_TV_SYS)
  681.           {
  682.             switch(setup_item[page][index_y][sel])
  683.             {
  684.             case STR_OS_NTSC:
  685.               tv_format=MODE_NTSC;
  686.             break;
  687.             #ifdef SUPPORT_PAL60
  688.             case STR_OS_PAL60:
  689.               tv_format=MODE_PAL60;
  690.             break;
  691.             #endif//SUPPORT_PAL60
  692.             #ifdef SUPPORT_PALM         //gerry,2004-1-8 13:49
  693.             case STR_OS_PALM:
  694.               tv_format=MODE_PALM;
  695.             break;
  696.             #endif//SUPPORT_PALM
  697.             case STR_OS_PAL:
  698.               tv_format=MODE_PAL;
  699.             break;
  700.             #ifdef SUPPORT_PALN
  701.             case STR_OS_PALN:
  702.               tv_format=MODE_PALN;
  703.             break;
  704.             #endif//SUPPORT_PAL60
  705.             #ifdef SUPPORT_PALNc
  706.             case STR_OS_PALNc:
  707.               tv_format=MODE_PALNC;
  708.             break;
  709.             #endif//SUPPORT_PAL60
  710.             #ifdef SUPPORT_PALNc
  711.             case STR_OS_PALNc:
  712.               tv_format=MODE_PALNC;
  713.             break;
  714.             #endif//SUPPORT_PAL60
  715.             case STR_OS_AUTO:
  716.               tv_format=MODE_AUTO;
  717.             break;
  718.             }
  719.             
  720.             #ifdef STORE_VIDEO_PARAMETER
  721.             res = WriteToI2c(0xa0, TV_FORMAT_ADDR,(BYTE *)&tv_format,1);
  722.             if(res<0)
  723.             {
  724.               BYTE i=0;
  725.               for(i=0;((i<15)&&(res<0));i++)
  726.               {
  727.                 res = WriteToI2c(0xa0, TV_FORMAT_ADDR, (BYTE *)&tv_format, 1);
  728.                 printf("tv_out_id store error,retry.......i%d res:%dn",i,res);
  729.               }
  730.             }
  731.             //printf("record tv_format:%d.....n",tv_format);
  732.             #endif
  733.             setup_tv_format(tv_format);
  734.             update_tv_format_sel();
  735.           } 
  736.           else
  737.           #endif
  738.                 exe_setup_function(setup_item[page][index_y][1],setup_item[page][index_y][sel],1);
  739.                 #ifdef SELECT_MEDIA_IN_SETUPMENU    //Maoyong force to exit setup after media switch 2004-8-10 11:28
  740.                 if(media_changed_flag){
  741.                     media_changed_flag = 0;
  742.                     return;
  743.                 }
  744.                 #endif
  745.                 #ifdef SETUP_ADJUST_LOCATION_WHEN_PAL //wangap add this for current in setup 2004/5/9
  746.                 if(setup_item[page][index_y][1]==STR_OS_TV_SYS){
  747.                 osd_init_setup();
  748.                 ShowSetupPage(2);
  749.                 }
  750.                 #endif//SETUP_ADJUST_LOCATION_WHEN_PAL
  751. /*
  752. #ifdef  OFF_PROLOGIC_WHEN_NOT_DOWNMIXOFF//zhaoyanhua 2003-12-10 9:37
  753.                 //if PROLOGIC_II is NOT OFF ,DOWNMIX MODE is not DOWNMIXOFF, must turn PRLOGIC OFF. 
  754.                 //zhaoyanhua add 2003-12-10 9:48
  755.                 if((SETUP_SPK_DOWNMIX!=AC3DOWNMIXOFF)&&(SETUP_PROLOGIC_II != 4))
  756.                 {
  757.                      SETUP_PROLOGIC_II =4;
  758.                      exe_setup_function(STR_OS_PROLOGIC,STR_OS_OFF,0);   
  759.                     
  760.                 }
  761. #endif*/
  762. #if defined(SUPPORT_PROLOGIC_II)// && !defined(TEMP_TWO_CHANNEL)//terry,2004/1/9 10:58AM
  763.                 if ( (setup_item[page][index_y][1]==STR_OS_PROLOGIC) &&
  764.                      (setup_item[page][index_y][sel]!=STR_OS_OFF)
  765.                    )
  766.                 {
  767.                     SETUP_SPK_DOWNMIX=AC3DOWNMIXOFF;
  768.                     //exe_setup_function(STR_OS_DOWNMIX_SETUP,setup_sel[MULTISPKPAGE][AC3DOWNMIXOFF],1);
  769.                     exe_setup_function(STR_OS_DOWNMIX_SETUP,STR_OS_OFF,0);//nono 2004-2-16 11:04
  770.                     run_save_sel_cmd(MULTISPKPAGE, AC3DOWNMIXITEM);//nono 2004-2-16 15:04
  771.                 }
  772.                 
  773.                 if ( (setup_item[page][index_y][1]==STR_OS_DOWNMIX_SETUP) &&
  774.                      (setup_item[page][index_y][sel]!=STR_OS_OFF)
  775.                    )
  776.                 {
  777.                     SETUP_PROLOGIC_II=PROLOGIC_OFF;    // alan, 2003/8/11 01:56PM                           
  778.                     exe_setup_function(STR_OS_PROLOGIC,STR_OS_OFF,0);
  779.                     run_save_sel_cmd(AUDPAGE, PROLOGIC_II);//nono 20031117
  780.                 }               
  781. #endif//SUPPORT_PROLOGIC_II
  782. #ifdef VGA_CTRL_FORMAT  //wangfeng,2003-10-20 22:47
  783.                 if ( (setup_item[page][index_y][1]==STR_OS_VIDEO) &&
  784.                      (setup_item[page][index_y][sel]==STR_OS_PC_VGA)
  785.                    )
  786.                 {
  787.                     temp_format=SETUP_TV_FORMAT;//wangfeng 2003-12-18 15:59
  788.                     SETUP_TV_FORMAT=2;
  789.                     exe_setup_function(STR_OS_TV_SYS,STR_OS_NTSC,1);
  790.                     //run_save_sel_cmd(SYSPAGE,TV_FORMAT);
  791.                     
  792.                 }
  793.                 else if(temp_format)//wangfeng 2003-12-18 16:44         
  794.                 {
  795.                     UINT8 temp;
  796.                     switch(temp_format){
  797.                     case 2:
  798.                         temp=STR_OS_NTSC;
  799.                         break;
  800.                     case 3:
  801.                         temp=STR_OS_PAL60;
  802.                         break;
  803.                     case 4:
  804.                         temp=STR_OS_PAL;
  805.                         break;
  806.                     case 5:
  807.                         temp=STR_OS_AUTO;
  808.                         break;
  809.                     default:
  810.                         break;
  811.                     }
  812.                     SETUP_TV_FORMAT=temp_format;
  813.                     temp_format=0;
  814.                     exe_setup_function(STR_OS_TV_SYS,temp,1);
  815.                     //run_save_sel_cmd(SYSPAGE,TV_FORMAT);
  816.                 }
  817.                     run_save_sel_cmd(SYSPAGE,TV_FORMAT);
  818.                 WriteToI2c(0xa0, ADDR_I2C_VGA,(BYTE *)&temp_format,sizeof(temp_format));
  819. /*              
  820.                 if ( (setup_item[page][index_y][1]==STR_OS_VIDEO) &&
  821.                      (setup_item[page][index_y][sel]==STR_OS_YCbCr)
  822.                    )
  823.                 {
  824.                     SETUP_TV_FORMAT=4;                          
  825.                     exe_setup_function(STR_OS_TV_SYS,STR_OS_PAL,1);
  826.                     run_save_sel_cmd(SYSPAGE,TV_FORMAT);
  827.                     
  828.                 }
  829.                 if ( (setup_item[page][index_y][1]==STR_OS_VIDEO) &&
  830.                      (setup_item[page][index_y][sel]==STR_OS_P_SCAN_YUV)
  831.                    )
  832.                 {
  833.                     SETUP_TV_FORMAT=4;                          
  834.                     exe_setup_function(STR_OS_TV_SYS,STR_OS_PAL,1);
  835.                     run_save_sel_cmd(SYSPAGE,TV_FORMAT);
  836.                 }   
  837. */
  838. #endif//VGA_CTRL_FORMAT
  839.             }
  840. #ifdef  SCART_TV_5  //wangfeng 2003-12-2 11:43 for himage HJ-023 
  841. if(setup_item[page][index_y][1]==STR_OS_VIDEO){
  842.     if (setup_item[page][index_y][sel]==STR_OS_PC_VGA)
  843.     {
  844.         //printf("is vga out put------n");
  845.         ReSetScartTV5();
  846.     }   
  847.     else
  848.     {
  849.         SetScartTV5();
  850.         //printf("is not vga out put------n");
  851.     }
  852.     
  853. }   
  854. #endif
  855. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  856.     if(one_key_pass_flag)
  857.     {
  858.         switch(index_y)
  859.         {
  860.             case 0:
  861.                 run_save_sel_cmd(MULTISPKPAGE,0);// to make ONEKEYPAGE and MULTISPKPAGE same. 
  862.                 break;
  863.             case 1: 
  864.                 run_save_sel_cmd(SYSPAGE,0);//to make ONEKEYPAGE and SYSPAGE same.
  865.                 break;
  866.         }
  867.     }
  868.     else
  869. #endif      
  870.             run_save_sel_cmd(page,index_y);
  871.             //  setup_func_left();
  872.         }
  873.         //ShowSetupPage(2);
  874. #ifdef VIDEO_SETUP_NEW_GUI//zhaoyanhua add 2004-1-8 11:29       
  875.         if((page == VIDEOPAGE) && (setup_item[page][index_y][0] == SET_SCALE))
  876.         {   
  877.             //setup_ShowVideoGUI(setup_item[page][index_y][1]);
  878.             setupLevel = 1;
  879.             ShowSetupPage(2);
  880.         }
  881.         else
  882. #endif//VIDEO_SETUP_NEW_GUI             
  883.         setup_func_left();
  884.         if (id==STR_OS_DEFAULT_SETUP)
  885.         {
  886.             set_default_value();
  887.             run_set_variable();
  888. #if defined(YUV_DEFAULT_OUTPUT) && defined(DELETE_VIDEO_ITEM)
  889.         #ifdef S_VIDEO_OUT
  890.        regs0->emu_cfg[1]|=0x100;
  891.         #endif //#ifdef S_VIDEO_OUT
  892.         setup_tv_out(INTERLACE);//set S-video output(composited+component)(0x00:D0-D1-D2-D3=CVBS-V-Y-U)
  893.         search_ap_tv_out_id();//terry,2003/8/19 03:21PM
  894. #endif      
  895. #ifdef YUXING_MIDI_DVD 
  896.         exe_setup_function( STR_OS_SELECT_LOGO, STR_OS_RESTORE_SETUP, 0 );//nono 2004-10-23 15:07
  897. #endif
  898.         
  899.             run_save_total_sel();
  900. #ifdef EASTWIN
  901. load_customer_default();
  902. init_lcd_display_mode();
  903. init_an2526h(); // Kevin Sep 20,04 
  904. #endif             
  905.             #if defined(DELETE_VIDEO_ITEM)&&defined(SYBER_DVD)//liweihua add 20031218
  906.             page=0;
  907.             #endif
  908. #ifdef DVB_MENU_SETUP_STYLE
  909. if(system_state ==SYSTEM_TS)
  910. page = SYSPAGE;
  911. else
  912. page = SYSPAGE;
  913. #endif
  914.             setupLevel = 1;
  915.             
  916.         #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  917.             if(one_key_pass_flag)
  918.             {   
  919.                 page = ONEKEYPASSPAGE;
  920.             }
  921.         #endif
  922.             ShowSetupPage(2);
  923. //3-12-9 19:04 NONO MARKED.uopdate dsp code.
  924.             //nono 2003-8-26 1:42 for DTS mute after setup_default
  925. //          exe_setup_function(setup_item[MULTISPKPAGE][AC3DOWNMIXITEM][1],
  926. //                  setup_item[MULTISPKPAGE][AC3DOWNMIXITEM][ SETUP_SPK_DOWNMIX ],0);//nono 2003-8-26 0:50
  927. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  928.         ExitSetupPage(0);
  929. #endif
  930.         #ifdef IR_KEY_SET_VIDEO_MODE
  931.         video_mode_val=VIDEO_MODE_VAL_DEFAULT;
  932.         set_video_val(video_mode_val);
  933.         //WriteToI2c(0xa0, 220,(BYTE *)&video_mode_val,1);
  934.         #endif
  935.             #ifdef VOLUME_RECODE
  936.             {
  937.                 int volume;
  938.                 int i=0;
  939.                 #ifdef CNTR_5SPK_VOLUME//wangfeng 2003-11-11 21:27
  940.                 for (i=0; i<7; i++){
  941.                 #ifdef SW_VOL_63    
  942.                 if(i==6)
  943.                 {
  944.                 audio_volume = SUB_DEFAULT;       //set to max volume when we default gerry 2-11-6 9:26;
  945.                 volume=WriteToI2c(0xa0, ADDR_I2C_VOLUME+6, (BYTE *)&audio_volume,sizeof(audio_volume));
  946.                 }else
  947.                 #endif
  948.                 {
  949.                 #endif    
  950.                 audio_volume = DEFAULT_VOL;
  951.                 volume=WriteToI2c(0xa0, ADDR_I2C_VOLUME+i, (BYTE *)&audio_volume,sizeof(audio_volume));
  952.                 #ifdef CNTR_5SPK_VOLUME//wangfeng 2003-11-11 21:26
  953.                 }
  954.                 
  955.                 volume_5SPK[i]      = audio_volume;//VOL_VALUE; //set to maximum volume
  956.                         if(i==0)
  957.                         idVolume_5SPK[i]    = Volume_Font_ID;
  958.                         else
  959.                         idVolume_5SPK[i]    = VOL_FL_ID+i-1;
  960.                 //DSPReset();
  961.             }
  962.         
  963.                 volume_Switch=0;
  964.                 audio_volume = volume_5SPK[0] ;//wangfeng 2003-11-07 15:41
  965.                 #endif//#else
  966.             }
  967.             #ifndef CNTR_5SPK_VOLUME
  968.             AUDIF_Set_Volume(audio_volume);//2004AUDDRV AudioSetVolume(audio_volume);
  969.             #endif
  970.             #endif //#ifdef VOLUME_RECODE
  971.        
  972. //3-12-23 21:02 NONO for dts-cd
  973.         setup_SetDTSDOWNMIXConfig();
  974.             //nono 2003-8-26 1:42 for DTS mute after setup_default
  975. //          exe_setup_function(setup_item[MULTISPKPAGE][AC3DOWNMIXITEM][1],
  976. //                  setup_item[MULTISPKPAGE][AC3DOWNMIXITEM][ SETUP_SPK_DOWNMIX ],0);//nono 2003-8-26 0:50
  977.        
  978. #ifndef SETUP_DONT_PAUSE    // alan, 3-8-5 17:47
  979. #ifdef  SETUP_DEFAULT_DONT_PAUSE  
  980. //terry,2003/12/12 04:16PM
  981. //bbk ,empty
  982. #else
  983.             AUDIF_Set_Pause();//2004AUDDRV AudioSetPause(); //Jeff 20021017
  984. #endif          
  985. #endif
  986.           #ifdef ARGUS_PORTABLE_DVD
  987.           #ifdef SUPPORT_SPI
  988.           scommand = MCU_RESET;
  989.           #endif
  990.            #endif
  991.         } //if (id==STR_OS_DEFAULT_SETUP)
  992.     }
  993.     #ifdef SUPPORT_FUNCTION_MENU
  994.     }
  995.     #endif //end #ifdef SUPPORT_FUNCTION_MENU
  996. }
  997. #ifdef DVB_MENU_SETUP_STYLE
  998. #include "sp_dtv.h"
  999. void dvb_func_select()
  1000. {
  1001. if(system_state == SYSTEM_TS)
  1002. {
  1003. if((page == INSTALLPAGE)||(page == CHANNELPAGE))
  1004. {
  1005. switch(id)
  1006. {
  1007. case STR_OS_DVBT_CONFIG:
  1008. ShowDvbTInstMenu();
  1009. break;
  1010. case STR_OS_AUTO_SCAN:
  1011. break;
  1012. case STR_OS_TV_CHANNEL:
  1013. dvb_channel_func_select(STR_OS_TV_CHANNEL);
  1014. break;
  1015. case STR_OS_RADIO_CHANNEL:
  1016. dvb_channel_func_select(STR_OS_RADIO_CHANNEL);
  1017. break;
  1018. //case STR_OS_EDIT_LIST:
  1019. // break;
  1020. case STR_OS_ADD_CHANNEL:
  1021. ShowDvbAddChannels();
  1022. break;
  1023. case STR_OS_EDIT_CHANNEL:
  1024. break;
  1025. case STR_OS_DEL_CHANNEL:
  1026. dvb_channel_func_select(STR_OS_DEL_CHANNEL);
  1027. break;
  1028. }
  1029. }
  1030. }
  1031. }
  1032. #endif