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

DVD

开发平台:

C/C++

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *         Copyright (c) 2002 by Sunplus Technology Co., Ltd.             *
  4.  *                                                                        *
  5.  *  This software is copyrighted by and is the property of Sunplus        *
  6.  *  Technology Co., Ltd. All rights are reserved by Sunplus Technology    *
  7.  *  Co., Ltd. This software may only be used in accordance with the       *
  8.  *  corresponding license agreement. Any unauthorized use, duplication,   *
  9.  *  distribution, or disclosure of this software is expressly forbidden.  *
  10.  *                                                                        *
  11.  *  This Copyright notice MUST not be removed or modified without prior   *
  12.  *  written consent of Sunplus Technology Co., Ltd.                       *
  13.  *                                                                        *
  14.  *  Sunplus Technology Co., Ltd. reserves the right to modify this        *
  15.  *  software without notice.                                              *
  16.  *                                                                        *
  17.  *  Sunplus Technology Co., Ltd.                                          *
  18.  *  19, Innovation First Road, Science-Based Industrial Park,             *
  19.  *  Hsin-Chu, Taiwan, R.O.C.                                              *
  20.  **************************************************************************/
  21. /*--------------------------------------------------------------------------
  22. |  File Name   :  browse_func.c
  23. |
  24. |  Description :  NEW STYLE WINDOW function in it.it can exe some function.
  25.                   for example goto and display some information  etc.
  26. |
  27. |  Version    :  0.1  
  28. |  Rev Date         Author(s)      Status & Comments
  29. |---------------------------------------------------------------------------------
  30. |  0.1 2003/6/28        xiongyuyue         Creating
  31. |--------------------------------------------------------------------------------*/
  32. /*****************************************************
  33. Creater: xiongyuyue
  34. Date   : 2003/6/28 
  35. Description: browse function using 
  36. *****************************************************/
  37. #include "global.h"
  38. #include "osd.h"
  39. #include "func.h"
  40. #include "cfont.h"
  41. #include "util.h"
  42. #include "ircmd.h"
  43. #include "user_if.h" 
  44. #include "Icon.h"
  45. #include "kernel.h"
  46. #include "vpp.h"
  47. #include "browse_gui.h"
  48. #include "osd_arc.h"
  49. #include "stdlib.h"
  50. #ifdef MODIFY_OSD_SHOW_NEW_STYLE_WINDOW//zhaoyanhua add 2003-12-8 9:29
  51. #include "modify_browse_func.c"
  52. #else
  53. #ifndef DVDRELEASE
  54. //#define BROWSE_DBG
  55. #endif
  56. #ifdef DYNAMIC_SPECTRUM     //fengjl  3-10-30 12:34
  57. extern BYTE band_onoff;
  58. extern void Show3dspectrum(void); //axel 2003/12/2 11:31pm
  59. #endif
  60. #define browse_puts()           ((void)0)
  61. #define browse_show_function()  ((void)0)
  62. #ifdef  BROWSE_DBG
  63. #include "sio.h"
  64. #include "emuio.h"
  65. #undef  browse_puts
  66. #undef  browse_show_function
  67. #define browse_puts             puts_w
  68. #define browse_show_function()  do {browse_puts(__FUNCTION__); browse_puts("n");} while (0)
  69. #endif
  70. /////////////////////////////////////////////////////////////////////////
  71. //wanghaoying 2003-8-12 19:50 added
  72. extern void set_video_aspect(void);
  73. extern void startup_vpp_now(void);
  74. extern void set_vpp_disp_window(UINT32,UINT32,UINT32,UINT32);
  75. /////////////////////////////////////////////////////////////////////////
  76. extern UINT16 mp3_file_count(void);   //axel 2003/12/2 11:30pm
  77. #ifdef NEWSTYLE_WINDOW          //xiongyuyue 
  78. BYTE bInputState = NON_INPUT_STATE;
  79. int bInputIndex = 0;   //for title/chapter search function,
  80. BYTE bTimeInput = 0;
  81. BYTE update_definition = 40;
  82. extern UINT32 PlayBackLength;
  83. /**************************************************************************
  84.  *                                                                        *
  85.  *  Function Name: br_Draw8space                                          *
  86.  *                                                                        *
  87.  *  Purposes:                                                             *
  88.  *    display 8 space                                                     *
  89.  *  Descriptions:                                                         *
  90.  *    display 8 space between left string and right string                *
  91.  *  Arguments:    fontColor: display the font's color                     *
  92.  *                bkColor  : display the background's color               *
  93.  *                index    : the string index 0 1 2 3 4                   *
  94.  *  Returns:   NONE                                                       *
  95.  *                                                                        *
  96.  *  See also:  NONE                                                       *
  97.  *                                                                        *
  98.  **************************************************************************/
  99. void br_Draw8space(BYTE fontColor,BYTE bkColor,BYTE index)
  100. {//erase displayed word and disp new word when press updown key(for draw left item)
  101.     strcpy(linebuf,"            ");  //fengjl changed space from 8 to 12   3-11-24 18:52
  102.     osd_DrawRegionString(brArea[BR_ITEM_AREA].xStart,brArea[BR_ITEM_AREA].yStart+ITEM_HEIGHT*index,
  103.                         linebuf,fontColor,bkColor,arc_region_loc.region);
  104. }
  105. /**************************************************************************
  106.  *                                                                        *
  107.  *  Function Name: br_Draw18space                                         *
  108.  *                                                                        *
  109.  *  Purposes:                                                             *
  110.  *    display 18 space                                                    *
  111.  *  Descriptions:                                                         *
  112.  *    display 18 space between left string and right string               *
  113.  *  Arguments:    fontColor: display the font's color                     *
  114.  *                bkColor  : display the background's color               *
  115.  *                index    : the string index 0 1 2 3 4                   *
  116.  *  Returns:   NONE                                                       *
  117.  *                                                                        *
  118.  *  See also:  NONE                                                       *
  119.  *                                                                        *
  120.  **************************************************************************/
  121. void br_Draw18space(BYTE fontColor,BYTE bkColor,BYTE index)
  122. {//erase displayed word and disp new word when press updown key(for draw right item)
  123.     strcpy(linebuf,"                  ");
  124.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*index,
  125.                         linebuf,fontColor,bkColor,arc_region_loc.region);
  126. }
  127. /**************************************************************************
  128.  *                                                                        *
  129.  *  Function Name: br_DrawLeftItemStr                                     *
  130.  *                                                                        *
  131.  *  Purposes:                                                             *
  132.  *    draw the left item string in the gui                                *
  133.  *  Descriptions:                                                         *
  134.  *    draw the left item string in the gui                                *
  135.  *  Arguments:        hl_index:the left item string HL index 0-4          *
  136.  *                    str_index:the left item string  index               * 
  137.  *                    fontColor:display the font's color                  *
  138.  *                    bkColor: display the background's color             *
  139.  *  Returns:   NONE                                                       *
  140.  *                                                                        *
  141.  *  See also:  NONE                                                       *
  142.  *                                                                        *
  143.  **************************************************************************/
  144. void br_DrawLeftItemStr(BYTE hl_index,BYTE str_index,BYTE fontColor,BYTE bkColor)
  145. {
  146.     br_Draw8space(fontColor,bkColor,hl_index);//xyy 2003-7-29 17:12
  147. if(cd_type_loaded==CDDVD)
  148.         psprintf(linebuf,"%s",_OsdMessegeFont1[osd_font_mode][string_index_dvd[str_index]]);
  149. else if(cd_type_loaded==CDROM || cd_type_loaded==CDDA)
  150. psprintf(linebuf,"%s",_OsdMessegeFont1[osd_font_mode][string_index_cd[str_index]]);
  151.     else
  152.         psprintf(linebuf,"%s",_OsdMessegeFont1[osd_font_mode][string_index_vcd[str_index]]);
  153.     osd_DrawRegionString(brArea[BR_ITEM_AREA].xStart,brArea[BR_ITEM_AREA].yStart+ITEM_HEIGHT*(hl_index),
  154.                         linebuf,fontColor,bkColor,arc_region_loc.region);
  155. }
  156. /**************************************************************************
  157.  *                                                                        *
  158.  *  Function Name: browse_HL_leftItem                                     *
  159.  *                                                                        *
  160.  *  Purposes:                                                             *
  161.  *    browse HL left item                                                 *
  162.  *  Descriptions:                                                         *
  163.  *    browse HL left item  according  to the index                        *
  164.  *  Arguments:    index:  left item index 0-4                             *
  165.  *                fontColor:display the font's color                      *
  166.  *                pre_bkColor:HL's color                                  *
  167.  *                bkColor:display the background's color                  *
  168.  *                UPDN:0 no HL ;1 HL                                      *
  169.  *  Returns:   NONE                                                       *
  170.  *                                                                        *
  171.  *  See also:  NONE                                                       *
  172.  *                                                                        *
  173.  **************************************************************************/
  174. void browse_HL_leftItem(BYTE index,BYTE fontColor,BYTE pre_bkColor,BYTE bkColor,BYTE UPDN)
  175. {
  176.     if(UPDN == 0)//when press down key
  177.     {
  178.      if(index>1)
  179.     br_DrawLeftItemStr(index-2,info_index-1,fontColor,pre_bkColor);//xyy 2003-7-29 20:05
  180.     br_DrawLeftItemStr(index-1,info_index,fontColor,bkColor);//xyy 2003-7-29 20:05
  181.     }
  182.     else if(UPDN == 1)//when press up key
  183.     {
  184.      if(index < ITEM_PER_PAGE)
  185.     br_DrawLeftItemStr(index,info_index+1,fontColor,pre_bkColor);//xyy 2003-7-29 20:05
  186.     br_DrawLeftItemStr(index-1,info_index,fontColor,bkColor);//xyy 2003-7-29 20:05
  187.     }
  188. }
  189. /**************************************************************************
  190.  *                                                                        *
  191.  *  Function Name: br_Draw_TT_info                                        *
  192.  *                                                                        *
  193.  *  Purposes:                                                             *
  194.  *    display the title information                                       *
  195.  *  Descriptions:                                                         *
  196.  *    currently play title/all title                                      *
  197.  *  Arguments:    mmcMode=1:MMC mmcMode=0:SD                              *
  198.  *  Returns:   NONE                                                       *
  199.  *                                                                        *
  200.  *  See also:  NONE                                                       *
  201.  *                                                                        *
  202.  **************************************************************************/       
  203. void br_Draw_TT_info(void)
  204. {
  205.     BYTE dvd_title_Ns;
  206.     
  207.     if(cd_type_loaded==CDDVD)
  208.     {
  209. dvd_title=get_tt_info(DISP_TT); 
  210. dvd_title_Ns = get_tt_info(DISP_TT_Ns); 
  211. }
  212. else
  213. {
  214. /*
  215. dvd_title=disp_trk_now;
  216. dvd_title_Ns = cd_total_trk();
  217. */  
  218. dvd_title=disp_trk_now;
  219. if(cd_type_loaded==CDROM)//xyy 2003-9-11 17:12
  220. dvd_title_Ns = mp3_file_count();
  221. else 
  222. dvd_title_Ns = cd_total_trk(); 
  223. }
  224.     psprintf(linebuf, "%02d/%02d",dvd_title,dvd_title_Ns);
  225.     if(bBrowseLevel==1 && info_index==0)
  226.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart,
  227.      linebuf,INFO_FONTCOL,INFO_BKCOL,arc_region_loc.region);         
  228. else
  229.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart,
  230.      linebuf,INFO_FONTCOL,INFO_PRE_BKCOL,arc_region_loc.region);         
  231. }
  232. /**************************************************************************
  233.  *                                                                        *
  234.  *  Function Name: br_Draw_CHP_info                                       *
  235.  *                                                                        *
  236.  *  Purposes:                                                             *
  237.  *    display the chapter information                                     *
  238.  *  Descriptions:                                                         *
  239.  *     currently play chapter/all chapter                                 *
  240.  *  Arguments: VOID                                                       *
  241.  *  Returns:   NONE                                                       *
  242.  *                                                                        *
  243.  *  See also:  NONE                                                       *
  244.  *                                                                        *
  245.  **************************************************************************/
  246. void br_Draw_CHP_info(void)
  247. {
  248.     BYTE dvd_chp_Ns;
  249. dvd_chapter=get_tt_info(DISP_CH);  
  250. dvd_chp_Ns = get_tt_info(DISP_CH_Ns);
  251.     psprintf(linebuf, "%02d/%02d",dvd_chapter,dvd_chp_Ns);
  252. if(bBrowseLevel==1 && info_index==1)
  253.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*1,
  254.      linebuf,INFO_FONTCOL,INFO_BKCOL,arc_region_loc.region);         
  255.     else
  256.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*1,
  257.      linebuf,INFO_FONTCOL,INFO_PRE_BKCOL,arc_region_loc.region);         
  258. }
  259. /**************************************************************************
  260.  *                                                                        *
  261.  *  Function Name: browse_func_up                                         *
  262.  *                                                                        *
  263.  *  Purposes:                                                             *
  264.  *    use ir up_key to control browse function                            *
  265.  *  Descriptions:                                                         *
  266.  *    use ir up_key to control browse function                            *
  267.  *  Arguments: VOID                                                       *
  268.  *  Returns:   NONE                                                       *
  269.  *                                                                        *
  270.  *  See also:  NONE                                                       *
  271.  *                                                                        *
  272.  **************************************************************************/
  273. void browse_func_up(void)
  274. {
  275.     BYTE i,j;
  276.     if(bBrowseLevel==1 || info_index==0)
  277.         return;
  278.     else
  279.         info_index--;
  280.         
  281.     if(info_index<ITEM_PER_PAGE)
  282.      bInputState = NON_INPUT_STATE;
  283.     HL_index--;
  284.     if((info_index+1)%ITEM_PER_PAGE==0)
  285.     {
  286.         for(i=info_index-(ITEM_PER_PAGE-1),j=0;j<ITEM_PER_PAGE;i++,j++)
  287.             br_DrawLeftItem(i,j,INFO_FONTCOL,INFO_PRE_BKCOL);
  288.         br_DrawRightItem();
  289.         browse_HL_leftItem(ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL,INFO_BKCOL,1);
  290.     }
  291.     if(HL_index>0)
  292.         browse_HL_leftItem(HL_index,INFO_FONTCOL,INFO_PRE_BKCOL,INFO_BKCOL,1);
  293.     else
  294.         HL_index = ITEM_PER_PAGE;
  295. }
  296. /**************************************************************************
  297.  *                                                                        *
  298.  *  Function Name: browse_func_down                                       *
  299.  *                                                                        *
  300.  *  Purposes:                                                             *
  301.  *    use ir down_key to control browse function                          *
  302.  *  Descriptions:                                                         *
  303.  *    use ir down_key to control browse function                          *
  304.  *  Arguments: VOID                                                       *
  305.  *  Returns:   NONE                                                       *
  306.  *                                                                        *
  307.  *  See also:  NONE                                                       *
  308.  *                                                                        *
  309.  **************************************************************************/
  310. void browse_func_down(void)
  311. {
  312.     BYTE i,j;
  313.     if(bBrowseLevel==1)
  314.         return;
  315.     if((cd_type_loaded==CDROM || cd_type_loaded==CDDA) && info_index==2)//xyy 2003-9-12 14:22
  316.      return;
  317.     if(cd_type_loaded==CDDVD)
  318.     {
  319.     if(info_index>=DVD_MAXITEM-1)
  320.         return;
  321.     else
  322.         info_index++;
  323. }
  324. else
  325. {
  326.     if(info_index>=VCD_MAXITEM-1)
  327.         return;
  328.     else
  329.         info_index++;
  330. }
  331.     if(info_index>=ITEM_PER_PAGE)
  332.      bInputState = INPUT_STATE;
  333.     HL_index++;
  334.     if((info_index%ITEM_PER_PAGE==0) && (info_index<DVD_MAXITEM))
  335.     {
  336.         for(i=info_index,j=0;j<ITEM_PER_PAGE;i++,j++)
  337.             br_DrawLeftItem(i,j,INFO_FONTCOL,INFO_PRE_BKCOL);
  338.         br_DrawRightItem();
  339.         browse_HL_leftItem(1,INFO_FONTCOL,INFO_PRE_BKCOL,INFO_BKCOL,0);
  340.     }
  341.     if(HL_index<=ITEM_PER_PAGE)
  342.         browse_HL_leftItem(HL_index,INFO_FONTCOL,INFO_PRE_BKCOL,INFO_BKCOL,0);
  343.     else
  344.         HL_index = 1;
  345.     }
  346. /**************************************************************************
  347.  *                                                                        *
  348.  *  Function Name: init_time_search                                       *
  349.  *                                                                        *
  350.  *  Purposes:                                                             *
  351.  *    init time search and display                                        *
  352.  *  Descriptions:                                                         *
  353.  *    init time search and display                                        *
  354.  *  Arguments: VOID                                                       *
  355.  *  Returns:   NONE                                                       *
  356.  *                                                                        *
  357.  *  See also:  NONE                                                       *
  358.  *                                                                        *
  359.  **************************************************************************/
  360. void init_time_search(void)
  361. {
  362. bTimeInput = 1;
  363. goto_time = 0;
  364. psprintf(linebuf,"%02d:%02d:%02d",0,0,0);
  365.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*(HL_index-1),
  366.                             linebuf,INFO_FONTCOL,INFO_BKCOL,arc_region_loc.region); 
  367.     br_Draw_tmhl(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*(HL_index-1),"_",INFO_FONTCOL,INFO_BKCOL);    
  368. }
  369. /**************************************************************************
  370.  *                                                                        *
  371.  *  Function Name: br_Draw_FBicon                                         *
  372.  *                                                                        *
  373.  *  Purposes:                                                             *
  374.  *    draw the FB icon,likes  <<                                          *
  375.  *  Descriptions:                                                         *
  376.  *    draw the FB icon,likes  <<                                          *
  377.  *  Arguments:  VIOD                                                      *
  378.  *  Returns:   NONE                                                       *
  379.  *                                                                        *
  380.  *  See also:  NONE                                                       *
  381.  *                                                                        *
  382.  **************************************************************************/
  383. #ifdef  SUPPORT_PLAYBACK_ICON
  384. void br_Draw_FBicon(void)
  385. {
  386. memset(linebuf,0,sizeof(linebuf));
  387. strcat1(linebuf, OSD_ICON_FB);
  388.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*(HL_index-1),
  389.                             linebuf,INFO_FONTCOL,INFO_BKCOL,arc_region_loc.region);//xyy 2003-8-11 16:25
  390. }
  391. /**************************************************************************
  392.  *                                                                        *
  393.  *  Function Name: br_Draw_FFicon                                         *
  394.  *                                                                        *
  395.  *  Purposes:                                                             *
  396.  *    draw the FF icon,likes  >>                                          *
  397.  *  Descriptions:                                                         *
  398.  *    draw the FF icon,likes  >>                                          *
  399.  *  Arguments:  VIOD                                                      *
  400.  *  Returns:   NONE                                                       *
  401.  *                                                                        *
  402.  *  See also:  NONE                                                       *
  403.  *                                                                        *
  404.  **************************************************************************/
  405. void br_Draw_FFicon(void)
  406. {
  407.     strcat1(linebuf, OSD_ICON_FF);
  408.     osd_DrawRegionString(brArea[BR_CONTENT_AREA].xStart+ITEM_WIDTH,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*(HL_index-1),
  409.                             linebuf,INFO_FONTCOL,INFO_BKCOL,arc_region_loc.region); //xyy 2003-8-11 16:25 
  410. }
  411. #else
  412. void br_Draw_FBicon(void){}
  413. void br_Draw_FFicon(void){}
  414. #endif
  415. /**************************************************************************
  416.  *                                                                        *
  417.  *  Function Name: br_Draw_underline                                      *
  418.  *                                                                        *
  419.  *  Purposes:                                                             *
  420.  *    Draw underline                                                      *
  421.  *  Descriptions:                                                         *
  422.  *    Draw underline                                                      *
  423.  *  Arguments:   xStart; yStart;lineColor; bkColor;                       *
  424.  *  Returns:   NONE                                                       *
  425.  *                                                                        *
  426.  *  See also:  NONE                                                       *
  427.  *                                                                        *
  428.  **************************************************************************/
  429. void br_Draw_underline(BYTE xStart, BYTE yStart, BYTE lineColor,BYTE bkColor)
  430. {
  431.     BYTE *s="__";
  432.     bInputState = INPUT_STATE;
  433.     if(bInputIndex==0)
  434.     osd_DrawRegionString(xStart,yStart,s,lineColor,bkColor,arc_region_loc.region);  
  435. }
  436. /**************************************************************************
  437.  *                                                                        *
  438.  *  Function Name: exe_time_goto                                          *
  439.  *                                                                        *
  440.  *  Purposes:                                                             *
  441.  *    exe time goto function in browse                                    *
  442.  *  Descriptions:                                                         *
  443.  *    exe time goto function in browse                                    *
  444.  *  Arguments: VOID                                                       *
  445.  *  Returns:   NONE                                                       *
  446.  *                                                                        *
  447.  *  See also:  NONE                                                       *
  448.  *                                                                        *
  449.  **************************************************************************/
  450. extern void preDealGoto_time(void);
  451. extern void time_trans2hms(void);
  452. extern void exe_timesearch_func(UINT32 goto_ff,UINT32 fail);
  453. void exe_time_goto(void)
  454. {
  455.     index_x=0;
  456. time_trans2hms();  //xyy  2003-7-29 13:17           
  457. preDealGoto_time();//xyy 2003-7-29 13:18
  458. exe_timesearch_func(0,0);//xyy 2003-7-29 13:25
  459. bInputState = NON_INPUT_STATE;
  460. bTimeInput=0;
  461. }
  462. /**************************************************************************
  463.  *                                                                        *
  464.  *  Function Name: br_Draw_rtSpecialItem                                  *
  465.  *                                                                        *
  466.  *  Purposes:                                                             *
  467.  *   select and exe some function according to different cases            *
  468.  *  Descriptions:                                                         *
  469.  *   select and exe some function according to different cases            *
  470.  *  Arguments:    mmcMode=1:MMC mmcMode=0:SD                              *
  471.  *  Returns:   NONE                                                       *
  472.  *                                                                        *
  473.  *  See also:  NONE                                                       *
  474.  *                                                                        *
  475.  **************************************************************************/
  476. void br_Draw_rtSpecialItem(void)//include audio language,sub-picture,repeat_all,multi-angle
  477. {
  478.     br_Draw18space(INFO_FONTCOL,INFO_PRE_BKCOL,HL_index-1);//xyy 2003-7-29 17:32
  479. br_Draw_FBicon();//xyy 2003-7-29 15:52
  480.     switch(info_index)
  481.     {
  482.     //info_index:the index of string_index_dvd array or string_index_vcd array
  483.     case 2://DVD:STR_OS_TIME ; VCD:STR_OS_TITLETIME ;CD:STR_OS_REP
  484.      if(cd_type_loaded==CDROM || cd_type_loaded==CDDA)
  485.      ircmd_repeat_all();
  486.      break;
  487. case 3://DVD:STR_OS_SUBTITLE_LANG_SETUP;
  488. ircmd_sub_picture();
  489. break;
  490. case 4://DVD:STR_OS_AUDIO_LANG_SETUP; VCD:STR_OS_REP
  491. if(cd_type_loaded==CDDVD)
  492. ircmd_audio_language();
  493. else
  494.      ircmd_repeat_all();
  495. break;
  496. case 5://DVD:STR_OS_ANGLE
  497.         ircmd_angle();
  498. break;
  499. case 8://DVD:STR_OS_REP
  500.      ircmd_repeat_all();
  501. break;
  502. }    
  503. br_Draw_FFicon();//xyy 2003-7-29 16:51
  504. }
  505. /**************************************************************************
  506.  *                                                                        *
  507.  *  Function Name: browse_func_select                                     *          *
  508.  *                                                                        *
  509.  *  Purposes:                                                             *
  510.  *    use enter key to select some function that according to             *  
  511.  *    different cases  ,for example  select CH and TT for DVD.            *
  512.  *    when the key was used ,the HL will be changed                       *
  513.  *  Descriptions:                                                         *
  514.  *    use enter key to select some function that according to             *  
  515.  *    different cases  ,for example  select CH and TT for DVD.            *
  516.  *    when the key was used ,the HL will be changed                       *                         *
  517.  *  Arguments: VOID                                                       *
  518.  *  Returns:   NONE                                                       *
  519.  *                                                                        *
  520.  *  See also:  NONE                                                       *
  521.  *                                                                        *
  522.  **************************************************************************/
  523. void browse_func_select(void)
  524. {
  525. //info_index:the index of string_index_dvd array or string_index_vcd array
  526. //which is defined in file browse_gui.h
  527.     if(info_index==6||info_index==7)//the value of title time and chapter time is not changeable
  528.      return;
  529.     if(cd_type_loaded==CDDVD)
  530.     {
  531.     if(info_index<=1 && bInputIndex<2 && bBrowseLevel==1)
  532.      return;
  533.     }
  534.     else
  535.     {
  536.     if(info_index==0 && bInputIndex<2 && bBrowseLevel==1)
  537.      return;
  538.     }
  539.     if(bBrowseLevel==0)
  540.     {
  541. #if defined(ADJUSTING_ACTION_VALID_RIGHT_NOW)//xyy 2003-9-9 16:10
  542. action_click = 2; // alan, 2003/8/28 05:45PM
  543. #else
  544. action_click = 0;
  545. #endif
  546. //     action_click = 2; // alan, 2003/8/28 05:45PM
  547.         switch(info_index)
  548.         {
  549.             case 0://title(DVD) or track(VCD/CD/MP3) information
  550.         bBrowseLevel = 1;     //xyy 2003-8-11 17:14   
  551.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  552.              br_Draw_TT_info();
  553.                 br_Draw_underline(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*(HL_index-1),UNDERLINECOL,INFO_BKCOL);    
  554.              break;
  555.             case 1://chaprter(DVD) or playtime(VCD/CD/MP3) information
  556.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  557.             if(cd_type_loaded==CDDVD)
  558.             {
  559.         bBrowseLevel = 1;      //xyy 2003-8-11 17:14  
  560.              br_Draw_CHP_info();
  561.              br_Draw_underline(brArea[BR_CONTENT_AREA].xStart,brArea[BR_CONTENT_AREA].yStart+ITEM_HEIGHT*(HL_index-1),UNDERLINECOL,INFO_BKCOL); //xyy 2003-8-11 16:16   
  562.           }
  563. else
  564. init_time_search();
  565.                break;
  566.             case 2://playtime(DVD) or title time(VCD) or repeat setup(CD/MP3)information
  567.             if(cd_type_loaded==CDDVD)
  568.             {
  569.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  570.              init_time_search();
  571.              }
  572. else if(cd_type_loaded==CDROM || cd_type_loaded==CDDA)//xyy 2003-9-12 13:38
  573. {
  574.         bBrowseLevel = 1;//zhaoyanhua add 2003-12-8 9:39
  575.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  576.     br_Draw_rtSpecialItem();
  577. }
  578.                 else
  579.                 return;
  580.                break;
  581.             case 3://sub-title language setup(DVD) or chapter time(VCD) information
  582.             if(cd_type_loaded==CDDVD)
  583.             {
  584.                 if(pDSV->dAv_SPST_Ns<2)
  585.                     return;
  586.         bBrowseLevel = 1;//zhaoyanhua add 2003-12-8 9:39
  587.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  588.     br_Draw_rtSpecialItem();
  589.             }
  590.             else
  591.              return;                          
  592.                 
  593.                 break;    
  594.             case 4://audio language setup(DVD) or repeat setup(VCD) information
  595.             if(cd_type_loaded==CDDVD)
  596.             {
  597.              if(pDSV->dAv_AST_Ns<=1)
  598.              return;
  599.     }
  600.     else
  601.     {
  602.      if( IsPBCOn() )
  603.      return;
  604. }            
  605.         bBrowseLevel = 1;//zhaoyanhua add 2003-12-8 9:39
  606.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  607. br_Draw_rtSpecialItem();
  608.                 break;
  609.             case 5://multi-angle(only DVD)information
  610.              if(get_angle_Ns()<1)
  611.              return;
  612.                 bBrowseLevel = 1;//zhaoyanhua add 2003-12-8 9:39
  613.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  614.     br_Draw_rtSpecialItem();
  615.                 break;
  616.             case 8://repeat setup(DVD)information
  617.         bBrowseLevel = 1;//zhaoyanhua add 2003-12-8 9:39
  618.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_PRE_BKCOL);
  619.     br_Draw_rtSpecialItem();
  620.                 break;
  621.                 
  622.         }
  623.         bBrowseLevel = 1;        
  624.     }
  625.     else if(bBrowseLevel == 1)
  626.     {
  627.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_BKCOL);//xyy 2003-8-11 16:08
  628.         switch(info_index)
  629.         {
  630.             case 0://title(DVD) or track(VCD/CD/MP3) information
  631.                 if(bInputIndex==1)
  632.                     return;
  633.                 if(bInputIndex > 1)
  634.                 {
  635.                     bInputIndex = 0;
  636.                     if(cd_type_loaded==CDDVD)
  637.                     {
  638.                     if(info_index==0)
  639.                      dvd_chapter = 1;
  640.                     
  641.                     if(UOP_check(UOP_PTT_PS)&&(dvd_chapter==1))
  642.              dvd_chapter = 0;//TT play,terry,3-8-23 19:35
  643.              
  644.                 ircmd_post_func(CMD_FUNC|CMD_PTT_PLAY);
  645.                 }
  646.                     else
  647.                     ircmd_post_func(CMD_SELECT | dvd_title);
  648.                     bInputState = NON_INPUT_STATE;    
  649.                 }
  650.                 break;
  651.             case 1://chaprter(DVD) or playtime(VCD/CD/MP3) information
  652.              if(cd_type_loaded==CDDVD)
  653.              {
  654.                 if(bInputIndex==1)
  655.                     return;
  656.                 if(bInputIndex > 1)
  657.                 {
  658.                     bInputIndex = 0;
  659.                     
  660.                     if(UOP_check(UOP_PTT_PS)&&(dvd_chapter==1))
  661.       dvd_chapter = 0;//TT play,terry,3-8-23 19:35
  662.       
  663.                 ircmd_post_func(CMD_FUNC|CMD_PTT_PLAY);
  664.                     bInputState = NON_INPUT_STATE;    
  665.                 }
  666.                 }
  667.                 else
  668.                  exe_time_goto();
  669.                 break;
  670.             case 2://playtime(DVD) or title time(VCD) or repeat setup(CD/MP3)information
  671.             if(cd_type_loaded==CDDVD)
  672.              exe_time_goto();
  673.             else
  674.                  br_DrawRightItem();
  675.                 break;
  676.             case 3://sub-title language setup(DVD) or chapter time(VCD) information
  677.             case 4://audio language setup(DVD) or repeat setup(VCD) information
  678.             case 5://multi-angle(only DVD)information
  679.             case 8://repeat setup(DVD)information
  680.                 br_DrawRightItem();
  681.                 break;
  682.         }
  683.         bBrowseLevel = 0;
  684.     }
  685. }
  686. /**************************************************************************
  687.  *                                                                        *
  688.  *  Function Name: browse_func_clear                                      *
  689.  *                                                                        *
  690.  *  Purposes:                                                             *
  691.  *    clear the unuseful informaton which had been selected               *
  692.  *  Descriptions:                                                         *
  693.  *    clear the unuseful informaton which had been selected               *
  694.  *  Arguments: VOID                                                       *
  695.  *  Returns:   NONE                                                       *
  696.  *                                                                        *
  697.  *  See also:  NONE                                                       *
  698.  *                                                                        *
  699.  **************************************************************************/
  700. #ifdef CLEAR_KEY_IN_WINDOW //Maoyong 2004.02.18
  701. void browse_func_clear(void)
  702. {
  703. //DVD not in CHP, TT, CHP and TT time item, no use
  704. if(cd_type_loaded == CDDVD)
  705. {
  706. if((info_index != 5)&&(info_index != 6)&&(info_index != 0)&&(info_index != 1))
  707. return;
  708. }
  709. else //CDROM, CDVCD..., not DVD
  710. {
  711. if( (info_index != 0) && (info_index != 1) && (info_index != 2) ) 
  712. return;
  713. }
  714. index_x=0;
  715. bBrowseLevel = 0;
  716. bInputState = NON_INPUT_STATE;
  717.     bInputIndex = 0;
  718. browse_func_select();
  719. }
  720. #endif
  721. UINT32 ten_power(BYTE exponent)
  722. {
  723. UINT32 temp=1,i;
  724. for(i=0;i<exponent;i++)
  725. temp = temp*10;
  726. return temp;
  727. }
  728. /**************************************************************************
  729.  *                                                                        *
  730.  *  Function Name: browse_func_left                                       *
  731.  *                                                                        *
  732.  *  Purposes:                                                             *
  733.  *    use ir left_key to control browse function                          *
  734.  *  Descriptions:                                                         *
  735.  *    use ir left_key to control browse function                          *
  736.  *  Arguments: VOID                                                       *
  737.  *  Returns:   NONE                                                       *
  738.  *                                                                        *
  739.  *  See also:  NONE                                                       *
  740.  *                                                                        *
  741.  **************************************************************************/
  742. void browse_func_left(void)
  743. {
  744.     if(bBrowseLevel==0)
  745.         return;
  746.     if((cd_type_loaded==CDDVD && info_index <= 1) || (cd_type_loaded!=CDDVD && info_index==0))
  747.     {
  748.         bInputState = NON_INPUT_STATE;
  749.         bInputIndex = 0;
  750.         bBrowseLevel = 0;
  751.         UpdateTT_CHP_info();
  752.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_BKCOL);//xyy 2003-8-11 17:06
  753.     }
  754.     else if((cd_type_loaded==CDDVD && info_index == 2) || (cd_type_loaded!=CDDVD && info_index==1))
  755.     {
  756.         br_DrawLeftItem(info_index,info_index%ITEM_PER_PAGE,INFO_FONTCOL,INFO_BKCOL);//xyy 2003-8-11 17:06
  757.      br_DrawRightItem();
  758.         bBrowseLevel = 0;
  759.         bTimeInput = 0;
  760.         index_x = 0; // alan, 2003/9/5 02:16