ircmd_num.c
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:27k
源码类别:

DVD

开发平台:

C/C++

  1. /*
  2. *  Terry,2004/1/14 02:36PM
  3. */
  4. /*******************************************************
  5. ** FUNCTION
  6. **    ircmd_select_number
  7. **
  8. ** DESCRIPTION:
  9. ** Function for IR number-key
  10. **
  11. ** In:
  12. **    num: numer 0~10
  13. ** Out:
  14. **    None
  15. ************************************************************/
  16. //xulf added temporary here 2004-2-12 11:53
  17. #if defined(SUPPORT_BASS_TREBLE)//xyy 2004-3-8
  18. extern BYTE flag_BassAdjust,flag_TrebleAdjust;       //xulf 2004-01-12
  19. #endif
  20. //extern void ddx_ircmd_BassAdjust(int updown);
  21. //extern void ddx_ircmd_TrebleAdjust(int updown);
  22. #if defined(AMP_SUPPORT_EQ)
  23. extern void ddx_EQ_Toggle(void);
  24. #endif
  25. #if defined(SUPPORT_REVERBERATION)
  26. extern void ddx_Revb_Toggle(void);
  27. #endif
  28. #ifdef  MP3_DIRECT_SELECT_FAST2NORM     //Maoyong 2004.02.28 15:54
  29. #define FAST2NORM           0x01<<0     
  30. #define NOT_REALPLAY        0
  31. extern void chg2normal_play(UINT8 md,UINT8 realplay);
  32. extern UINT16 Is_JPEG_STATE(void);
  33. #endif
  34. //#ifdef XINGQIU_RECEIVER_PANNEL//xyy 2004-5-24
  35. #ifdef SUPPORT_STATION_INPUT//xyy 2004-8-15
  36. #include "radio_mv114_kst.h"
  37. #endif
  38. #ifdef CONTINUOUS_NUM_KEY_SELECT//Jack added 04/11/13
  39. #define psdList        (pFsJpeg->List)
  40. void ir_continuous_num_clr(void)
  41. {
  42.     ir_num1 = 0;
  43. ir_num2 = 0;
  44. ir_num3 = 0;
  45. ir_num4 = 0;
  46. ir_num_timer = 0;
  47. ir_select_number = 0;
  48. ir_num_state = NUM_STATE0;
  49. }
  50. #endif
  51. void    ircmd_input_number(int num)
  52. {
  53.     UINT8 invalid=0;
  54. #ifdef DVB1000_OSD_MENU
  55.     if(!((full_scrn & DVB_MENU) ||(full_scrn & SETUP)||(full_scrn & SOUND))&&(system_state == SYSTEM_TS))
  56.     {
  57.         int progCount;
  58.         stProgramInfo_t *progInfo; 
  59.         now_num_ns++;
  60.         if(now_num_ns==1)
  61.         {//getime
  62.             //get_tod(&timeout_playback);
  63.             printf("timeout_playback=%dn",timeout_playback);
  64.             ir_select_number =num;
  65.             psprintf(RegionValStr[REGION1],"-%01d",ir_select_number);
  66.             PrintOsdMsg(STR_OS_SPACE, REGION1, 2, 1);
  67.         }
  68.         else if(now_num_ns==2)
  69.         {
  70.             ir_select_number = ir_select_number*10 + num;
  71.             printf("ir_select_number = %dn",ir_select_number);
  72.             psprintf(RegionValStr[REGION1],"%02d",ir_select_number);
  73.             PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
  74.             full_scrn = 0;  
  75.             if(CurrService ==DIGITAL_TV_SERVICE)//eric 2004-12-20 17:33
  76.          {
  77. progCount = g_iTVCount;
  78. progInfo = g_stTVInfo;
  79. printf("DIGITAL_TV_SERVICE :index_y = %dn",currPlayProgIndex);
  80.          }
  81.         else if(CurrService ==DIGITAL_RADIO_SERVICE)
  82.          {
  83. progCount = g_iRadioCount;
  84. progInfo = g_stRadioInfo;
  85. printf("DIGITAL_RADIO_SERVICE :index_y = %dn",currPlayProgIndex);
  86.        }
  87.            
  88.            if(ir_select_number<progCount) 
  89.             {
  90.                 if(ir_select_number!=currPlayProgIndex)
  91.                 {
  92.             index_y=ir_select_number;
  93.             dvbgui_select_program(progCount, SCREEN_TYPE_FULL, progInfo, g_stObject2);
  94.                 }
  95.             }
  96.             else
  97.             {
  98.                 psprintf(RegionValStr[REGION1],"INVALID PROGRAM");
  99.                 PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
  100.             }
  101.     now_num_ns=0;
  102.         }
  103.         return;
  104.     }   
  105. #endif
  106. #ifdef CONTINUOUS_NUM_KEY_SELECT
  107.     if((!(full_scrn&PROGRAM))&&(!(full_scrn&SETUP))&&(!(full_scrn&GOTO)))
  108.     {
  109.       if(((cd_type_loaded==CDVCD20)||(cd_type_loaded==CDSVCD)) && IsPBCOn() && (is_menu()==0))       //wanghaoying 2003-8-25 23:01
  110.     {
  111.         invalid_key();
  112.         return;
  113.      }
  114.     }
  115. #endif 
  116. #ifdef SUPPORT_MIDIDISK_TITLE
  117.         if (bIsPlayMidiTitle)
  118.         {
  119. invalid_key();
  120. return;
  121.         }
  122. #endif
  123. #ifdef INVALID_NUMBER_IN_DVD_MENU     //XLJ2004-3-31
  124. //invaild number keys during the short film in DVD menu, but need them available 
  125. //in choosing Menu, so use both is_menu()  and HL_exist. heqiang, 2004-4-23 9:52
  126.     if(is_menu()&&(HL_exist!=1)&&(cd_type_loaded==CDDVD)&&(!(full_scrn&PROGRAM))&&(!(full_scrn&SETUP))&&(!(full_scrn&GOTO)))    
  127.     {
  128.         invalid_key();
  129.         return;
  130.     }
  131. #endif//INVALID_NUMBER_IN_DVD_MENU
  132. #ifdef INVALID_NUMBER_IN_REPEAT//wuxiaofeng 2004-03-05
  133.     if(cd_type_loaded==CDDVD)//only for DVD use
  134.     {
  135.         if((rep_mode!=REPEAT_IDLE)||(rep_mode!=REPEAT_AB_IDLE))
  136.         {
  137.             invalid_key();
  138.             return;
  139.         }
  140.     }
  141. #endif
  142.     
  143. #ifndef JPG_EFFECT  
  144.     if ( Is_JPEG_SlideMode() ) return;
  145. #endif
  146.     
  147. //3-12-9 19:04 NONO MARKED.uopdate dsp code.  
  148. //    if((cd_type_loaded == CDDVD) && (coding_mode_now == AUDIF_CODING_MODE_DTS))
  149. //    setup_SetDTSDOWNMIXConfig();//3-11-25 22:55 zhangyu
  150. #ifdef JPG_EFFECT
  151.     num_sel_in_jpg = 1;
  152. #endif  
  153. #if defined(FAT_Write_UI)||defined(CF_CARD_WRITE)//||defined(WRITE_USB)//liweihua 2003-10-30 10:32
  154.     extern void input_name(int num);
  155.     extern BYTE input_flag;
  156.     if((full_scrn & PERIPHERAL) && (input_flag == 1))
  157.     {
  158.         if(num ==10)
  159.             invalid_key();
  160.         else
  161.             input_name(num);
  162.         return;
  163.     }
  164. #endif
  165.     switch(play_state)//kenny 891009
  166.     {
  167.     case VCD_STATE_IDLE://for no disc
  168.     case VCD_STATE_OPEN:
  169.         if(!full_scrn)
  170.             invalid=1;
  171.         break;
  172.     case VCD_STATE_PREVIEW:
  173. #ifdef DVD_PREVIEW_FUNCTION//terry,2004/2/7 07:11PM    
  174.         if(cd_type_loaded!=CDDVD)        
  175. #endif        
  176.         {
  177.             int max=cd_trk_hi-cd_trk_lo_now+1;
  178.             if(v11_trk_now >= cd_trk_lo_now+9*((int)(max/9)))
  179.             {
  180.                 if(num> max%9)
  181.                     invalid=1;
  182.             }
  183.         }
  184.     case VCD_STATE_9FRAMES:
  185.         if(num==0 || num==10)
  186.             invalid=1;
  187.         break;
  188.     } //end case
  189. #if defined(SUPPORT_STATION_INPUT)//xyy 2004-5-24 just for xingqiu
  190.     if(system_state== SYSTEM_DOING_TUNER)
  191.     {
  192.         ir_select_number = num;
  193.         if(tuner_oper_mode!=FREQ_DIRECT_CALL)//xyy 2004-7-28
  194.         tuner_oper_mode = RECALL_OR_STORE;
  195.         if(ir_select_number == 10)
  196.             ir_select_number = 0;
  197.         tuner_func_input();   
  198.         return;
  199.     }
  200. #endif  
  201. #if defined(SUPPORT_POWER_OFF_CLOCK_FUNC)//xyy 2004-10-12
  202. if(system_state==SYSTEM_DOING_CLOCK_FUNC)
  203. {
  204. ir_select_number = num;
  205. if(ir_select_number == 10)
  206. ir_select_number = 0;
  207. ClockFuncInput();
  208. return;
  209. }
  210. #endif
  211.     if(shuffle_flag)
  212.         invalid=1;
  213.     if(invalid)
  214.     {
  215.         invalid_key();
  216.     }else  if(full_scrn&PROGRAM)
  217.     {
  218.         ir_select_number=num;
  219.         prog_func_input(num);
  220. //  }else if(full_scrn&READ)
  221. //  {
  222. //      read_func_input(num);
  223.     }else if(full_scrn&SETUP)
  224.     {
  225. #ifdef SCRN_SAVER_WHEN_PAUSE//zhaoyanhua add 2004-2-17 17:48        
  226.         //NOTE:
  227.         // add these code there to avoid the BUG:
  228.         // when Slide Show JPEG, ROTATE,then SETUP,enter password GUI
  229.         // when the number is more than two(such as "01"), it will excute SELECT 01
  230.         // OR appear the SCREEN saver.
  231.         // I don't know  whether adding these codes like this is reasonable.
  232.         // But the result is correct.
  233.         // zhaoyanhua add 2004-2-17 17:53
  234.         
  235.         extern UINT32 save_srn_start_t;
  236.         save_srn_start_t = get_rtc_val();//axel 2004/3/11 02:44pm
  237.         
  238.        // save_srn_start_t = 0;
  239. #endif//ifdef  SCRN_SAVER_WHEN_PAUSE  
  240.         ir_select_number=num;
  241.         setup_password();
  242. #ifdef SHOW_STANDBY_TIMER //suqiaoli  add 2003-8-5
  243.         setup_standby_timer_input();
  244. #endif      
  245.     }else if(full_scrn&GOTO) //kenny 2001/5/16
  246.     {
  247.         OSD1000ISP_STATUS(OSDISP_NUMGOTO, num);
  248. #ifdef NEW_SEARCH_OSD
  249.         if(t_disp%10 ==1) // ren 910725
  250.         {            // ren 910725
  251.             ir_select_number=num;
  252.             search_func_input();
  253.         }
  254. #else
  255.       #ifdef NEW_GOTO_TIME  //wangfeng 2003-11-15 21:47
  256.         if((index_x==7)||(index_x==9)){
  257.             if(num<6)
  258.         ir_select_number=num;
  259.             else
  260.             return;
  261.         }
  262.         else 
  263.       #endif  
  264.         ir_select_number=num;
  265.         search_func_input();
  266. #endif
  267.     }
  268. #ifdef SUPPORT_FUNCTION_MENU
  269.     #ifdef SUPPORT_DISPLAY_MENU
  270.     else if(In_Goto_Menu() && (full_scrn&SETUP_PLUS))
  271.     {
  272.         setup_menu_plus_timer = DISPLAY_MENU_SHOW_TIME;
  273.         ir_select_number = num;
  274.         search_func_input();
  275.         ShowSetupPage_plus(MENU_REFRESH);
  276.         ir_select_number = 0;
  277.     }
  278.     #endif//end #ifdef SUPPORT_DISPLAY_MENU
  279. #endif//#ifdef SUPPORT_FUNCTION_MENU
  280. #ifdef NEWSTYLE_WINDOW            //xiongyuyue 20030703
  281.     else if(full_scrn&MESSAGE)
  282.     {
  283.         ir_select_number=num;
  284.         browse_func_input();
  285.     }
  286. #endif
  287. #ifdef SUPPORT_REP_READ //Maoyong 2004.06.07
  288.     else if(IsReadSetPBTimes()){
  289.         ir_select_number = num;
  290.         read_func_input();        
  291.     }
  292. #endif
  293. #ifdef DVB1000_OSD_MENU
  294.     else if(full_scrn&DVB_MENU){
  295.         ir_select_number = num;
  296.         pfnDvbInput();        
  297.     }
  298. #endif
  299.     else
  300. #ifndef IR_10_PLUS
  301.     {
  302.         {
  303.             UINT8 max=2;
  304.             UINT8 f[10]={" ---"};
  305.             UINT8 jp=1;
  306.           #if defined(SUPPORT_CARD_STORAGE)||defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)
  307.            if (media_type!=MEDIA_CARD)  //wthsin, 2004/7/7 02:34pm
  308.           #endif 
  309.             if(IsPBCOn() && (is_menu()==0))       //wanghaoying 2003-8-25 23:01
  310.             {
  311.                 invalid_key();
  312.                 return;
  313.             }
  314.             now_num_ns++;
  315.             ir_select_number=ir_select_number*10+num;
  316.             //printf("now_num_ns:%x num:%x ir_select_number:%xn",now_num_ns,num,ir_select_number);
  317.             if(cd_type_loaded==CDROM)
  318.             {
  319.                 UINT16 tt=mp3_file_count();
  320.                 if(tt>=1000)//nono 2-7-15 9:47
  321.                     max=4;
  322.                 else if(tt>=100)
  323.                     max=3;
  324.                 else
  325.                     max=2;
  326.             }
  327.             jp+=(max-now_num_ns);
  328.             if(jp>1)
  329.             {
  330.                 f[jp]='%';
  331.                 f[jp+1]='0';
  332.                 f[jp+2]='0'+now_num_ns;
  333.                 f[jp+3]='d';
  334.                 f[jp+4]=0;
  335.                 psprintf(RegionValStr[REGION1],f,ir_select_number);
  336.                 PrintOsdMsg(STR_OS_SELECT,REGION1,1,1);
  337. #ifdef SUPPORT_TUNER       // add tuner 2-6-14 23:17
  338.                 if(play_state!=VCD_STATE_POWER)
  339. #endif
  340.                     timeout_osd[REGION1]=150;//terry,0508, avoid waiting too long
  341.             }else
  342.             {
  343.                 ir_num_select(ir_select_number);
  344.             }
  345.             return;
  346.         }
  347.     }
  348. #else
  349.     {
  350.         if(num==10)
  351.         {
  352.             int max;
  353.             if(IsPBCOn() && (is_menu()==0)&&(play_state!=VCD_STATE_STOP)
  354.                 #if defined(SUPPORT_CARD_STORAGE) || defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)//liweihua add 2004-3-26
  355.                 && (media_type != MEDIA_CARD)
  356.                 #endif
  357.                 )       //wanghaoying 2003-8-25 23:01
  358.             {
  359.                 invalid_key();
  360.                 return;
  361.             }
  362.             
  363.             ir_10p=1;
  364.             ir_select_number+=10;
  365.             if (cd_type_loaded==CDROM)//nono 20040226 for nintaus
  366.                 max=10000;
  367.             else if(cd_type_loaded==CDDVD)
  368.                 max=1000;
  369.             else
  370.                 max=100;
  371.             if(ir_select_number>=max)
  372.                 ir_select_number=ir_select_number%max;
  373.             OSD1000ISP_STATUS(ir_select_number/10, num);
  374.             psprintf(RegionValStr[REGION1],"%02d+",ir_select_number);
  375.             PrintOsdMsg(STR_OS_SELECT,REGION1,1,1);
  376.         }
  377.         else
  378.         {
  379.             int x;
  380.             if(num==0)
  381.             {
  382.                 if(ir_select_number>0)
  383.                     x = ir_select_number+num;
  384.                 else
  385.                 {
  386. #ifdef ONLY_0//for "0" &"10" not in a key.
  387.                     x = 0;
  388. #else
  389.                     x = 10;
  390. #endif
  391.                 }
  392.             }
  393.             else
  394.             {
  395.                 if(ir_select_number<10)
  396.                     ir_select_number = 0;
  397.                 x = ir_select_number + num;
  398.             }
  399.             #ifdef SUPPORT_MIDI_MENU_SEL 
  400.             if(gIsMidiSelMenu) 
  401.             {
  402.                 ircmd_post_func(CMD_SELECT | (num));
  403.                 return;
  404.             }
  405.             #endif
  406.             OSD1000ISP_STATUS(x/10, num);
  407.             
  408.             #ifdef CONTINUOUS_NUM_KEY_SELECT 
  409.             ir_num_timer = IR_NUM_TIMER; 
  410.             
  411.             {
  412.   if(ir_num_state == NUM_STATE0)
  413.   {
  414.     ir_num1 = x;
  415.     x = ir_num1;
  416.     ir_num_state = NUM_STATE1;
  417.     psprintf(RegionValStr[REGION1]," %d",ir_num1);
  418.   }
  419.   else if(ir_num_state == NUM_STATE1)
  420.   {
  421.     ir_num2 = x;
  422.     x = ir_num1*10+ir_num2;
  423.     ir_num_state = NUM_STATE2;
  424.     psprintf(RegionValStr[REGION1]," %d%d",ir_num1,ir_num2);
  425.   }
  426.   else if(ir_num_state == NUM_STATE2)
  427.   {
  428.     ir_num3 = x;
  429.     x = ir_num1*100+ir_num2*10+ir_num3;
  430.     ir_num_state = NUM_STATE3;
  431.     psprintf(RegionValStr[REGION1]," %d%d%d",ir_num1,ir_num2,ir_num3);
  432.   }
  433.   else if(ir_num_state == NUM_STATE3)
  434.   {
  435.     ir_num4 = x;
  436.     x = ir_num1*1000+ir_num2*100+ir_num3*10+ir_num4;
  437.     ir_num_state = NUM_STATE4;
  438.     psprintf(RegionValStr[REGION1]," %d%d%d%d",ir_num1,ir_num2,ir_num3,ir_num4);
  439.   }
  440.   else
  441.   {
  442.     ir_continuous_num_clr();
  443.     invalid_key();
  444.     return;
  445.   }  
  446. }
  447. PrintOsdMsg(STR_OS_SELECT,REGION1,1,1);
  448. //psprintf(RegionValStr[REGION2]," %d%d%d----%d",ir_num1,ir_num2,ir_num3 ,x);
  449.     //PrintOsdMsg(STR_OS_OPEN,REGION2,1,1);
  450. if(x)
  451.             #endif //end #ifdef CONTINUOUS_NUM_KEY_SELECT
  452.             
  453.             ir_num_select(x);
  454.             
  455.             #ifdef CONTINUOUS_NUM_KEY_SELECT 
  456. if(ir_num_timer)
  457.   return;
  458.             #endif
  459.             
  460.             resumeMSF=0;//wanghaoying 2003-11-5 10:40
  461.         }
  462.         return;
  463.     }
  464. #endif
  465.     ir_select_number = 0;
  466. }
  467. void init_ir_num(void)
  468. {
  469.     ir_10p=0;
  470.     ir_select_number=0;
  471.     now_num_ns=0;
  472. }
  473. void ir_num_select(int x)
  474. {
  475.     #ifdef MOVE_HIGH_LIGHT_IN_PROG_MODE
  476.      if((!full_scrn)&&(cd_type_loaded== CDROM)){     //wsf  2004-7-20 14:55  changed for cancel program when select other ,just in CDROM DISC
  477.         if(!Is_OTHER_STATE()){              
  478.             prog_cnt=0;
  479.             prog_func_off();
  480.             prog_func_clear();        
  481.         }
  482.     }
  483.     #endif
  484.     int dir_num;
  485. #ifdef IRCMD_DBG
  486.     printf("================= ir_num_select (%x) =================n",x);
  487. #endif
  488. #ifdef SUPPORT_TUNER       // add tuner 2-6-14 23:17
  489.     if(play_state==VCD_STATE_POWER)
  490.     {
  491.         ir_select_number= x;
  492.         psprintf(RegionValStr[REGION1]," %02d",ir_select_number);
  493.         PrintOsdMsg(STR_OS_SELECT,REGION1,1,1);
  494.     }
  495.     else
  496. #endif
  497.     {
  498.         if (cd_type_loaded==CDROM)
  499.         {
  500.             ir_select_number = x;
  501.             //wangap add if the dir_num is mp3 or jpeg or game 2003/12/22 
  502.             // yltseng 2004/04/12, use relative method to access pFsJpeg->count_dir
  503.             if( pFsJpeg->gifsFuncBtn != FS_FUNC_IDLE )
  504.                 dir_num = pFsJpeg->count_dir[ pFsJpeg->gifsFuncBtn - FS_FUNC_MP3 ];
  505.             else
  506.                 dir_num = 0;
  507.             //wanghaoying changed 2003-12-4 17:14
  508.             //Focus in dir-area, the number must be less than the total dir count
  509.             //Focus in file-area, the number must be less than the total file count of the dir
  510.             if((pFsJpeg->ControlArea==CNT_AREA_FILE)&&(ir_select_number > mp3_file_count()))
  511.                 ir_select_number = 0;
  512.             if((pFsJpeg->ControlArea==CNT_AREA_DIR)&&(ir_select_number > dir_num))
  513.                 ir_select_number = 0; 
  514.             if (play_state==VCD_STATE_STOP)
  515.             {
  516.                 if (ir_select_number > mp3_file_count())    //Maoyong 2004.03.10
  517.                     ir_select_number = 0;
  518.                 else
  519.                 {
  520.                     resumeMSF = 0;
  521.                     pFsJpeg->file_current = ir_select_number;
  522.                 }
  523.             }
  524. // 2004/04/13 yltseng mark, it's no need now
  525. /*
  526. #ifdef SUPPORT_FILE_SYSTEM_MODE  // Robert 021007
  527.             if (IsOtherStatePlayMode())
  528.                 ir_select_number = 0;
  529. #endif
  530. */
  531.         }else
  532.         {
  533.            #ifdef MIX_CDMP3_DISC_DISPLAY_REAL_CD_TRK    //linrc add 2004-10-29 11:20
  534.            /*when play the cd+mp3 disc(ABEX TEST CD 786),it display the real CD TRK*/
  535.             if((cd_type_loaded == CDDA)&&((pFsJpeg->cdrom.track_info[1]&0x40000000) == 0x40000000))
  536.             {
  537.                 ir_select_number = x-1;
  538.                 x += (cd_trk_lo_now-2); 
  539.             }
  540.             else
  541.             #endif
  542.             {
  543.             ir_select_number = x;
  544.             x += (cd_trk_lo_now-1);
  545.             }
  546.             if(cd_type_loaded!=CDDVD)
  547.             {
  548.                 if(!IsPBCOn()||(play_state==VCD_STATE_STOP))
  549.                 {
  550.                     if(((x<cd_trk_lo_now)||(x>cd_trk_hi))&&(play_state!=VCD_STATE_9FRAMES))
  551.                     {
  552.                         ir_select_number=0;
  553.                     }
  554.                 }
  555.             }
  556.             
  557.             #ifdef CONTINUOUS_NUM_KEY_SELECT
  558.             if((!(full_scrn&PROGRAM))&&(!(full_scrn&SETUP))&&(!(full_scrn&GOTO)))
  559.             {
  560.                 if(((cd_type_loaded==CDVCD20)||(cd_type_loaded==CDSVCD)) && IsPBCOn())
  561.                 {
  562.                   if(x<psdList.s.bsn || x>=psdList.s.bsn+psdList.s.nos)
  563.                   {
  564.                     ir_continuous_num_clr();
  565.                     ir_select_number = 0;
  566.                   }
  567.                 }
  568.                 else if(cd_type_loaded==CDDVD)
  569.                 {
  570.                   //if(is_menu()&&(HL_exist==1))
  571.                   {
  572.                     if((x>get_tt_info(DISP_CH_Ns)) && (x>get_tt_info(DISP_TT_Ns)))
  573.                     {
  574.                       ir_continuous_num_clr();
  575.                       ir_select_number = 0;  
  576.                     }
  577.                   }
  578.                 }
  579.             }
  580.             #endif
  581.              
  582.         }
  583. /***************************/
  584. //Add the code for judge the input and the file count in the dir(when repeat dir and repeat 1!!).
  585. #ifdef  NUMBER_SELECTION_WHEN_REPEAT    //wuxiaofeng add for Minton 2004-03-10
  586.         if(cd_type_loaded == CDROM)
  587.         {
  588.             if( ( (rep_mode==REPEAT_TRACK)//prevent inputing other track
  589.                     &&(ir_select_number!=disp_trk_now) )//except the current track
  590.                 ||((rep_mode==REPEAT_DIRECTORY)//prevent inputing other directory
  591.                     &&((ir_select_number > pFsJpeg->first_mp3_seq+pFsJpeg->file_specify_in_dir)//except the current directory
  592.                     ||(ir_select_number < pFsJpeg->first_mp3_seq+1)) )
  593.                 )
  594.                 ir_select_number=0;
  595.         }
  596. #endif//#ifdef  NUMBER_SELECTION_WHEN_REPEAT
  597. /***************************/
  598.         if(ir_select_number)
  599.         {
  600. #ifdef TCL_DIRECT_SELECT_CHAPTER// 2004-3-22 14:20 lijd
  601.             if(cd_type_loaded==CDDVD)
  602.             {
  603.                 dvd_title = get_tt_info(DISP_TT);
  604.                 dvd_chapter=get_tt_info(DISP_CH_Ns);
  605.             if(ir_select_number<=dvd_chapter)
  606.             {
  607.                 dvd_chapter = ir_select_number; 
  608.                 if(dvd_title == 0)
  609.                 {
  610.                         dvd_title =  1;
  611.                         ircmd_post_func(CMD_FUNC|CMD_FUNC_PLAY );
  612.                 }
  613.                 else
  614.                 {
  615.                     ircmd_post_func(CMD_FUNC|CMD_FUNC_PLAY );
  616.                 }
  617.             }
  618.             else
  619.                 {
  620.                 invalid_key();
  621.                 return;
  622.                 }
  623.             }
  624.             else
  625. #endif
  626.             /*Maoyong 2004.02.28
  627.               When select MP3
  628.              */
  629.             #ifdef  MP3_DIRECT_SELECT_FAST2NORM     
  630.             if( (cd_type_loaded == CDROM) && (!Is_JPEG_STATE()) )
  631.                 chg2normal_play(FAST2NORM, NOT_REALPLAY);
  632.             #endif
  633.             
  634.             #ifdef CONTINUOUS_NUM_KEY_SELECT
  635. if(ir_num_timer)
  636.     ir_select_number = 0;
  637. else
  638.                 ircmd_post_func(CMD_SELECT | (ir_select_number));
  639.             #else
  640.             ircmd_post_func(CMD_SELECT | (ir_select_number));
  641.             #endif
  642.             if(ir_select_number)
  643.             {
  644. #ifdef ZOOM_DIRECT_STOP_SLIDE//nono 4-8-21 11:07
  645.                 if(jpg_slide_time == 0xffffffff)
  646.                 {
  647.                     if(Is_JPEG_SlideMode())
  648.                     {
  649.                         jpg_slide_time = JPEG_SLIDE_TIME;
  650.                     }
  651.                  
  652.                 }
  653. #endif
  654.                 if(!bIntro)
  655.                 {
  656.                     #if (defined(JIEKE_DVD)||defined(AD_TCL))//2004-3-22 13:09 lijd
  657.                                 if(Is_JPEG_STATE())//wangfeng 2003-12-22 9:18                 
  658.                         disp_trk_now = ir_select_number; 
  659.                             #endif
  660.                     #ifdef MIX_CDMP3_DISC_DISPLAY_REAL_CD_TRK  //linrc add 2004-10-29 11:20
  661.                     /*when play the cd+mp3 disc(ABEX TEST CD 786),it display the real CD TRK*/
  662.                     if((cd_type_loaded == CDDA)&&((pFsJpeg->cdrom.track_info[1]&0x40000000) == 0x40000000))
  663.                     psprintf(RegionValStr[REGION1]," %02d",ir_select_number+1);
  664.                     else
  665.                     #endif
  666.                     psprintf(RegionValStr[REGION1]," %02d",ir_select_number);
  667.                     PrintOsdMsg(STR_OS_SELECT,REGION1,1,1);
  668.                 }
  669.                 if(rep_mode)
  670.                 {//terry,2002/5/2 03:26PM
  671.                     //cancel repeat status ,avoiding dvd/vcd difference in repeat mode.
  672.  
  673. #ifdef MINTON_DVD       //wanghaoying 2003-8-4 16:24 added the limitation
  674.                     //if((cd_type_loaded==CDDVD) //Marked by Wuxiaofeng for support DVD repeat
  675.                     if(Is_JPEG_PLAY_STATE()&&pFsJpeg->gbfsSlide==0)//if not JPEG slide then cancel repeat
  676. #endif
  677. #ifndef NUMBER_SELECT_REPEAT_MODE_OFF   //clead 
  678.                         rep_mode=0;//only cancel in (JPEG & !slide) mode
  679.                     ShowRepInfo();
  680. #endif //clead                  
  681. #ifdef  NUMBER_SELECTION_WHEN_REPEAT    //wuxiaofeng add for Minton 2004-03-12
  682.                     psprintf(RegionValStr[REGION2]," %02d",ir_select_number);
  683.                     PrintOsdMsg(STR_OS_SELECT,REGION2,1,1);//display select info in region 2
  684. #endif//#ifdef  NUMBER_SELECTION_WHEN_REPEAT
  685.                 }
  686.             }
  687.         }else
  688.             invalid_key();
  689.         init_ir_num();
  690.     }
  691. }
  692. #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  693. //Maoyong 2004.05.26, just for record test on DVD platform
  694. void TestRecordCmd(BYTE cmd)
  695. {
  696.     switch(cmd)
  697.     {
  698.         case 0: //stop
  699.             printf("nRecord test: Press KEY 1 as STOP buttonn");
  700.             break;
  701.         case 1: //record
  702.             printf("nRecord test: Press KEY 2 as RECORD buttonn");
  703.             break;
  704.         case 2: //play
  705.             printf("nRecord test: Press KEY 3 as PLAY buttonn");
  706.             break;
  707.         case 3: //pause
  708.             printf("nRecord test: Press KEY 4 as PAUSE buttonn");
  709.             break;
  710.         case 4: //set record quality High
  711.             printf("nRecord test: Press KEY 5 to set High quality n");
  712.             break;
  713.         case 5: //set record quality High
  714.             printf("nRecord test: Press KEY 6 to set Middle qualityn");
  715.             break;
  716.         case 6: //set record quality High
  717.             printf("nRecord test: Press KEY 7 to set Low qualityn");
  718.             break;
  719.         default:
  720.             break;
  721.     }
  722.     DSP_AudioIOControl(RECORDMIC,cmd,0);//2004AUDDRV AudioIOControl(RECORDMIC,cmd,0);
  723. }
  724. #endif //#if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  725. #ifdef QSI_SHOW_ERR_RATE
  726. #include "ircmd_QSI.c"
  727. #endif
  728. void    ircmd_0(void)
  729. {
  730. #ifdef QSI_SHOW_ERR_RATE
  731. if(QSI_PIPO_TEST==0x1)    
  732.     QSI_setMSF(0);
  733. else    
  734. #endif
  735.     ircmd_input_number(0);
  736. }
  737. void    ircmd_1(void)
  738. {
  739. #ifdef QSI_SHOW_ERR_RATE
  740. if(QSI_PIPO_TEST==0x1)    
  741.     QSI_setMSF(1);
  742. else    
  743. #endif
  744.     #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  745.     TestRecordCmd(0);   //stop
  746.     #else
  747.         ircmd_input_number(1);
  748.         #endif
  749. }
  750. void    ircmd_2(void)
  751. {
  752. #ifdef QSI_SHOW_ERR_RATE
  753. if(QSI_PIPO_TEST==0x1)    
  754.     QSI_setMSF(2);
  755. else    
  756. #endif
  757.     #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  758.     TestRecordCmd(1);   //record
  759.         #else
  760.     ircmd_input_number(2);
  761.         #endif
  762. }
  763. void    ircmd_3(void)
  764. {
  765. #ifdef QSI_SHOW_ERR_RATE
  766. if(QSI_PIPO_TEST==0x1)    
  767.     QSI_setMSF(3);
  768. else    
  769. #endif
  770.     #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  771.     TestRecordCmd(2);   //play
  772.     #else
  773.         ircmd_input_number(3);
  774.         #endif
  775. }
  776. void    ircmd_4(void)
  777. {
  778. #ifdef QSI_SHOW_ERR_RATE
  779. if(QSI_PIPO_TEST==0x1)    
  780.     QSI_setMSF(4);
  781. else    
  782. #endif
  783.     #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  784.     TestRecordCmd(3);   //pause
  785.     #else
  786.         ircmd_input_number(4);
  787.         #endif
  788. }
  789. void    ircmd_5(void)
  790. {
  791. #ifdef QSI_SHOW_ERR_RATE
  792. if(QSI_PIPO_TEST==0x1)    
  793.     QSI_setMSF(5);
  794. else    
  795. #endif
  796.     #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  797.     TestRecordCmd(4);   //quality H
  798.     #else
  799.         ircmd_input_number(5);
  800.         #endif
  801. }
  802. void    ircmd_6(void)
  803. {
  804. #ifdef QSI_SHOW_ERR_RATE
  805. if(QSI_PIPO_TEST==0x1)    
  806.     QSI_setMSF(6);
  807. else    
  808. #endif
  809.     #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  810.     TestRecordCmd(5);   //quality M
  811.         #else
  812.     ircmd_input_number(6);
  813.         #endif
  814. }
  815. void    ircmd_7(void)
  816. {
  817. #ifdef QSI_SHOW_ERR_RATE
  818. if(QSI_PIPO_TEST==0x1)    
  819.     QSI_setMSF(7);
  820. else    
  821. #endif
  822.     #if defined(SUPPORT_REP_READ) && defined(REP_READ_TEST_RECORD)
  823.     TestRecordCmd(6);   //quality L
  824.         #else
  825.     ircmd_input_number(7);
  826.         #endif
  827. }
  828. void    ircmd_8(void)
  829. {
  830. #ifdef QSI_SHOW_ERR_RATE
  831. if(QSI_PIPO_TEST==0x1)    
  832.     QSI_setMSF(8);
  833. else    
  834. #endif
  835.     ircmd_input_number(8);
  836. }
  837. void    ircmd_9(void)
  838. {
  839. #ifdef QSI_SHOW_ERR_RATE
  840. if(QSI_PIPO_TEST==0x1)    
  841.     QSI_setMSF(9);
  842. else    
  843. #endif
  844.     ircmd_input_number(9);
  845. }
  846. void    ircmd_p10(void)
  847. {
  848. #ifdef SUPPORT_MIDI_MENU_SEL 
  849.     if(gIsMidiSelMenu) 
  850.     {
  851.         return;
  852.     }           
  853. #endif   
  854. #if defined(QSI_SHOW_ERR_RATE) && defined(SUPPORT_SPI_QSI)
  855.     if(QSI_PIPO_TEST==0x1)    
  856.     {
  857.         if(QSI_PIPO_FLAG!=0)
  858.         {
  859.             MSF_trigger=2;
  860.             QSI_PIPO_FLAG = 0;
  861.             psprintf(linebuf, "QSI_PIPO> STOP testing!n<Pressed any num key to continue> Or n<Second press to finish phase of run-in.>n");
  862.             UART0_puts(linebuf);
  863.         }
  864.         else if(MSF_trigger==2)
  865.         {
  866.             spi_cmd_run_in_final();
  867.         }
  868.         else
  869.         {
  870.             psprintf(linebuf, "<Pressed NUM 0-9 to start PIPO testing>n");
  871.             UART0_puts(linebuf);
  872.         }
  873.     }
  874.     else    
  875. #endif
  876.     ircmd_input_number(10);
  877. }
  878. void    ircmd_10(void)
  879. {
  880.     ircmd_input_number(0);
  881. }
  882. //============================ending===========================================