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

DVD

开发平台:

C/C++

  1. /**************************************************************
  2. ** FILE
  3. ** fsGUI_new.c
  4. **
  5. ** DESCRIPTION
  6. ** To collect the public function in fsGUI1.c and fsGUI_new.c
  7. **
  8. **
  9. **   Creator:   Freyman
  10. **   Date:     2004-4-19 19:07
  11. ****************************************************************/
  12. #include "global.h"
  13. #include "func.h"
  14. #include "memmap.h"
  15. #include "util.h"
  16. #include "graph.h"
  17. #include "memcfg.h"
  18. #include "framebuf.h"
  19. #include "macro.h"
  20. #include "stc.h"
  21. #include "cfont.h"
  22. #include "vfdfunc.h"
  23. #include "osd.h"
  24. #include "image.h"
  25. #include "nesinit.h"
  26. #include "fs96602.h"
  27. #include "fsNAV.h"
  28. #include "fsGUI.h"
  29. #include "fsGUI1.h"
  30. #include "user_if.h"
  31. #include "fsGUIX.h"
  32. #ifdef POWER_RESUME
  33. extern UINT32 ReadSameMP3Para ( UINT8 para ) ;
  34. extern UINT8 IsTheSameMP3 ( void ) ;
  35. #endif   // POWER_RESUME , added by caiyh , 14:12 , Nov 5th , 2004
  36. #ifdef JPG_EFFECT
  37. #include "jpegeffect.h"
  38. #endif
  39. #ifdef FS_BMP_GUI
  40. #include "fsGUI_BmpUI.h"
  41. #endif
  42. ///////////////////////////////////////////////////////////////////
  43. //define main menu look-and-feel style
  44. //Notes : to avoid blinking (when white/black line displaying in n/n+1 line, with interlace mode)
  45. //        SHADOW_WID , LIGHT_WID should >=2
  46. //        X1, Y1, Y3 should be 2*n
  47. //wanghaoying 2004-8-5 11:32 move to fsGUI1.h
  48. #ifdef NEW_MP3_GUI
  49. //for draw corner.
  50. const BYTE  CornerLT[6][6] = {
  51.                                 {0,0,0,0,1,1},
  52.                                 {0,0,1,1,2,2},
  53.                                 {0,1,1,2,2,2},
  54.                                 {0,1,2,2,2,2},
  55.                                 {1,2,2,2,2,2},
  56.                                 {1,2,2,2,2,2},
  57.                             };// Left_TOP 1/4 circle
  58. const BYTE CornerRT[6][6] = {
  59.                           {3,1,1,0,0,0},
  60.                           {2,3,1,1,0,0},
  61.                           {2,2,3,1,1,0},
  62.                           {2,2,2,1,1,1},
  63.                           {2,2,2,2,1,1},
  64.                           {2,2,2,2,1,1},
  65.                         };// Right_Left 1/4 circle
  66. const BYTE CornerLB[6][6] = {
  67.                           {1,2,2,2,2,2},
  68.                           {1,2,2,2,2,2},
  69.                           {0,1,2,2,2,2},
  70.                           {0,1,1,2,2,2},
  71.                           {0,0,1,1,2,2},
  72.                           {0,0,0,0,1,1},
  73.                          };// Right_Top 1/4 circle
  74. const BYTE CornerRB[6][6] = {
  75.                                 {2,2,2,2,2,1},
  76.                                 {2,2,2,2,2,1},
  77.                                 {2,2,2,2,1,0},
  78.                                 {2,2,2,1,1,0},
  79.                                 {2,2,1,1,0,0},
  80.                                 {1,1,0,0,0,0},
  81.                             };  // Right_Bottom 1/4 circle
  82. //for draw RECT. zhaoyanhua add 3-7-25 15:01
  83. #ifdef MP3_LARGE_GUI
  84. const BTNAREA Rect[] ={
  85.                 //path  Rect
  86.                 {120,      50,
  87.                   540,    28  },
  88.                 //background Rect
  89.                 { 0,        0,
  90.                   720,      470},
  91.                   //avoid the bug :when VGA,there is a red line in background.
  92.                   //zhaoyanhua modify 2003-12-5 13:17
  93.                 //{ 0,          0,
  94.                 //  352,     288  },
  95.                 //Dir  Rect
  96.                 { 50,     90,
  97.                   295,     300},
  98.                 //File Rect
  99.                 {365,       90,
  100.                   295,  300},
  101.                 //preview Rect .it is to clear the previous JPEG.
  102.                 {  //30,       80,
  103.                   //130,     120
  104.                     72,    100,
  105.                     245,   280,
  106.                 },
  107.                 //JPEG size When at preview state.
  108.                 {
  109.                    //40,     100,//x must be 8*x, //y must be 2*x
  110.                    //120,      90
  111.                    72,     100,
  112.                    245,    280,
  113.                 }
  114. };
  115. #else
  116. const BTNAREA Rect[] ={
  117. //path  Rect
  118. { 51,      40,
  119.   280,     17  },
  120. //background Rect
  121. { 0,       0,
  122.   352,      280},
  123. //Dir  Rect
  124. { 24,     65,
  125.   150,     170},
  126. //File Rect
  127. { 178,     65,
  128.   150,     170},
  129. //preview Rect .it is to clear the previous JPEG.
  130. {
  131.                   30,     66,  //Jeff update, 20030818
  132.                   130,     168
  133. },
  134. //JPEG size When at preview state.
  135. {
  136.    //x must be 8*x, //y must be 2*x
  137.                    40,     70,  //Jeff update, 20030818
  138.                    120,    160
  139. },
  140. #ifdef SUPPORT_MULTI_PARTITION//liweihua 2004-8-26
  141. //multiple HDD 
  142. {
  143.     32,     65,
  144.     280,    170     
  145. },
  146. #endif
  147. #ifdef FAT_FILE_MODE
  148. //Disk title rect
  149. {
  150.     24+5,      34+15,
  151.     150,     22
  152. },
  153. //Card title rect
  154. {
  155.     178+5,     34+15,
  156.     150,     22     
  157. },
  158. //Warning rect
  159. {
  160.     24,      240,
  161.     304,     27     
  162. },
  163. //Disk icon rect
  164. {
  165.  24,     65,
  166.   150,     170     
  167. },
  168. //card icon rect
  169. {
  170. 178,     65,
  171.     150,   50//liweihua mod 2004-11-2     
  172. },
  173. //disk item rect
  174. {
  175.   24+8,     65,
  176.     150-8,     170 //liweihua mod 2004-11-2     
  177. },
  178. #endif
  179. #ifdef FILE_MODE_WRITE     //sunzhh 20041225
  180. //SRCE title rect
  181. {
  182.     24+5,      34+15,
  183.     150,       22
  184. },
  185. //DEST title rect
  186. {
  187.     178+5,     34+15,
  188.     150,       22     
  189. },
  190. //infomation rect
  191. {   24,        25,
  192.     304,       17  },
  193. #endif
  194. };
  195. #endif
  196. #define LT  1//CornerLT
  197. #define LB  2//CornerRT
  198. #define RT  3//CornerLB
  199. #define RB  4//CornerRB
  200. #endif//NEW_MP3_GUI
  201. #ifdef FS_BMP_GUI //suqiaoli 2004-6-11
  202. //wanghaoying 2004-8-5 11:32 moved the definations to fsGUI1.h
  203. const BTNAREA fsArea[] =
  204. {
  205. // background area
  206. { 0, 0, //x, y start
  207. 720, 480 }, //x-size, y-size
  208. // dir icon area
  209. { DIR_AREA_XSTART + 11, DIR_AREA_YSTART + 15,
  210. FS_DIRICON_XLEN, FS_FILELIST_YSTEP },
  211. // dir item area
  212. { DIR_AREA_XSTART + 5, DIR_AREA_YSTART + 12 ,
  213. FS_DIRITEM_XLEN,     PER_PAGE * FS_FILELIST_YSTEP },
  214. // file icon area
  215. { FILE_AREA_XSTART + 11, FILE_AREA_YSTART +15 ,
  216. FS_FILEICON_XLEN, FS_FILELIST_YSTEP },
  217. // file item area
  218. { FILE_AREA_XSTART + 5,     FILE_AREA_YSTART + 12 ,
  219. FS_FILEITEM_XLEN, PER_PAGE * FS_FILELIST_YSTEP },
  220. // file scroll bar area
  221. { FS_DIRSCROLLLEN_XSTART + LEN_DIRFILE  , FS_DIESCROLLLEN_YSTART,
  222. FS_DIRSCROLLLEN_XSIZE,             FS_DIRSCROLLLEN_YSIZE          },
  223. // file move bar area
  224. { FS_DIRSCROLLLEN_XSTART + LEN_DIRFILE + 5, FS_DIESCROLLLEN_YSTART + 7  ,
  225. FS_DIRSCROLLLEN_XSIZE - 10,                 FS_DIRSCROLLLEN_YSIZE - 14 },
  226. // path info area
  227. { 132, 84,
  228. 300, 18 },
  229. // preview area
  230.     {   DIR_AREA_XSTART + 28,     DIR_AREA_YSTART ,//120+16,  //Jeff update, 20030818
  231.         210,                        280},
  232.     //button title area
  233. { 100, 45,
  234. 0, 0 },
  235.     //button title background area
  236.     {
  237. 100, 27,
  238.      100, 1 },
  239. //path background
  240. { 89, 76,
  241. 546, 1 },
  242. //button background
  243. { 73, 27,
  244. 646, 1 },
  245. // dir scroll bar area
  246. { FS_DIRSCROLLLEN_XSTART , FS_DIESCROLLLEN_YSTART,
  247. FS_DIRSCROLLLEN_XSIZE, FS_DIRSCROLLLEN_YSIZE },
  248. // dir move bar area
  249. { FS_DIRSCROLLLEN_XSTART + 5, FS_DIESCROLLLEN_YSTART + 7 ,
  250. FS_DIRSCROLLLEN_XSIZE - 10, FS_DIRSCROLLLEN_YSIZE - 14 },
  251. };
  252. #elif defined(MP3_LARGE_GUI)
  253. const BTNAREA fsArea[] = //20020731
  254. {
  255.     // background area
  256.     {   0,                      0, //x, y start
  257.         720,                        480                             }, //x-size, y-size
  258.     // dir icon area
  259.     {   FS_DIRLIST_XSTART - 60,     FS_DIRLIST_YSTART,
  260. 32, PER_PAGE*FS_FILELIST_YSTEP },
  261.     // dir item area
  262.     {   FS_DIRLIST_XSTART-20 ,          FS_DIRLIST_YSTART,  //Jeff 20020518
  263. X1 - FS_DIRLIST_XSTART + 20, PER_PAGE * FS_FILELIST_YSTEP },
  264.     // file icon area
  265.     {   FS_FILEICON_XSTART,         FS_DIRLIST_YSTART,
  266. 32, 24 },
  267.         // file item area
  268.     {   FS_FILEICON_XSTART + 36,                            FS_DIRLIST_YSTART,
  269.         240,                                                PER_PAGE * FS_FILELIST_YSTEP    },
  270.     // scroll bar area
  271.     {   FILE_AREA_XSTART+FILE_AREA_XLEN- ARROW_SIZE-2-1,    FS_DIRLIST_YSTART  ,
  272.         ARROW_SIZE,                                     PER_PAGE * FS_FILELIST_YSTEP    },
  273.     // move bar area
  274.     {   FILE_AREA_XSTART+FILE_AREA_XLEN -ARROW_SIZE-2-1,    FS_DIRLIST_YSTART +ARROW_SIZE,
  275.         ARROW_SIZE,                                         PER_PAGE * FS_FILELIST_YSTEP   - ARROW_SIZE*2 },
  276.     // path info area
  277.     {   120,                            50,
  278.         540,                              28                                },
  279. #ifdef JPG_EFFECT
  280.     //preview help message area
  281.     {
  282.         60,                         10,
  283.         600,                            28                              },
  284. #else
  285.     // preview area
  286.     {   32,                         236, // xStart = multiple of 8, yStart = multiple of 2
  287.         48,                         36                              }, // xSize : ySize = 4 : 3
  288. #endif
  289.     // button area
  290.     {   400,                            400,
  291.         150,                            48                              },
  292. };
  293. #else
  294. const BTNAREA fsArea[] =
  295. {
  296. // background area
  297. { 0, 0, //x, y start
  298. 352, 288 }, //x-size, y-size
  299. // dir icon area
  300. { FS_DIRLIST_XSTART - 26, FS_DIRLIST_YSTART,
  301. 20, PER_PAGE*FS_FILELIST_YSTEP },
  302.     //Maoyong 2004.06.23 HL too long will cause GUI bug when chang dir page use UP/DOWN.
  303.     #if defined (SUPPORT_CHINESE_FONT) || defined (SUPPORT_JOLIET_FORMAT)
  304. // dir item area
  305. { FS_DIRLIST_XSTART - 5, FS_DIRLIST_YSTART,
  306. X1 - FS_DIRLIST_XSTART + 6, PER_PAGE * FS_FILELIST_YSTEP },
  307.     #else
  308.     { FS_DIRLIST_XSTART - 5, FS_DIRLIST_YSTART,
  309. X1 - FS_DIRLIST_XSTART, PER_PAGE * FS_FILELIST_YSTEP },
  310.     #endif
  311.     #if defined(FAT_FILE_MODE)||defined(FILE_MODE_WRITE)//liweihua add 2004-11-2//sunzhh 2005-1-13
  312.     // file icon area
  313. { FS_FILEICON_XSTART, FS_DIRLIST_YSTART,
  314. 12+4, 12 },
  315.     #else
  316. // file icon area
  317. { FS_FILEICON_XSTART, FS_DIRLIST_YSTART,
  318. 12, 12 },
  319.     #endif//#ifdef FAT_FILE_MODE
  320. #ifdef NEW_MP3_GUI
  321.     #if defined(FAT_FILE_MODE)||defined(FILE_MODE_WRITE)//liweihua add 2004-11-2//sunzhh 2005-1-13
  322.     // file item area
  323. { FS_FILEICON_XSTART + 15 +2+4,     FS_DIRLIST_YSTART,
  324. 120, PER_PAGE * FS_FILELIST_YSTEP },
  325.     #else
  326. // file item area
  327. { FS_FILEICON_XSTART + 15 +2,     FS_DIRLIST_YSTART,
  328. 120, PER_PAGE * FS_FILELIST_YSTEP },
  329.     #endif//#ifdef FAT_FILE_MODE
  330. // scroll bar area
  331. { FILE_AREA_XSTART+FILE_AREA_XLEN- ARROW_SIZE-2-1, FS_DIRLIST_YSTART - 1,
  332. ARROW_SIZE+2, PER_PAGE * FS_FILELIST_YSTEP },
  333. // move bar area
  334. { FILE_AREA_XSTART+FILE_AREA_XLEN -ARROW_SIZE-1-1, FS_DIRLIST_YSTART +ARROW_SIZE,
  335. ARROW_SIZE, PER_PAGE * FS_FILELIST_YSTEP - 2 - ARROW_SIZE*2 },
  336. #else
  337. // file item area
  338. { FS_FILEICON_XSTART + 15, FS_DIRLIST_YSTART,
  339. 120, PER_PAGE * FS_FILELIST_YSTEP },
  340. // scroll bar area
  341. { 320, FS_DIRLIST_YSTART - 1,
  342. 8, PER_PAGE * FS_FILELIST_YSTEP },
  343. // move bar area
  344. { 321, FS_DIRLIST_YSTART,
  345. 6, PER_PAGE * FS_FILELIST_YSTEP - 2 },
  346. #endif
  347. // path info area
  348. #ifdef HANYANG_FS_LONGNAME
  349. { 14, Y1 - 18,
  350. 200, 18 },
  351. #else
  352. { 25, Y1 - 18,
  353. 300, 18 },
  354. #endif
  355. #ifdef NEW_MP3_GUI//nono 2004-4-29 23:28
  356. //preview help message area
  357. {
  358. 60, 20,
  359. 260, 16 },
  360. #else
  361. // preview area
  362. { 32, 236, // xStart = multiple of 8, yStart = multiple of 2
  363. 48, 36 }, // xSize : ySize = 4 : 3
  364. #endif
  365. #ifdef FILE_MODE_WRITE    //sunzhh 20041225
  366. // button area
  367. { 90, 245,
  368. 82, 25 },
  369. #else
  370. // button area
  371. { 180, 245,
  372. 82, 25 },
  373. #endif
  374. #ifdef FAT_FILE_MODE//liweihua 2004-10-9 21:59
  375. // disk icon area
  376. { FS_DIRLIST_XSTART - 26-8, FS_DIRLIST_YSTART,
  377. 20, PER_PAGE*FS_FILELIST_YSTEP },
  378. // disk list area
  379.     //Maoyong 2004.06.23 HL too long will cause GUI bug when chang dir page use UP/DOWN.
  380.     #if defined (SUPPORT_CHINESE_FONT) || defined (SUPPORT_JOLIET_FORMAT)
  381. { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
  382. X1 - FS_DIRLIST_XSTART + 6, PER_PAGE * FS_FILELIST_YSTEP },
  383.     #else
  384.     { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
  385. X1 - FS_DIRLIST_XSTART, PER_PAGE * FS_FILELIST_YSTEP },
  386.     #endif
  387. //warning message area
  388. {
  389. 24+5,      240+5,
  390. 304-5,    27-5
  391. },
  392. //dir slot area
  393. {
  394. FS_DIRSCROLLLEN_XSTART , FS_DIESCROLLLEN_YSTART,
  395. FS_DIRSCROLLLEN_XSIZE, FS_DIRSCROLLLEN_YSIZE
  396. },
  397. //dir movebar area
  398. {
  399. FS_DIRSCROLLLEN_XSTART + 5, FS_DIESCROLLLEN_YSTART + 7 ,
  400. FS_DIRSCROLLLEN_XSIZE - 10, FS_DIRSCROLLLEN_YSIZE - 14
  401. },
  402. #endif
  403. //#endif
  404. #ifdef FILE_MODE_WRITE//sunzhh 2004-12-25
  405. // disk icon area
  406. { FS_DIRLIST_XSTART - 26-8, FS_DIRLIST_YSTART,
  407. 20, PER_PAGE*FS_FILELIST_YSTEP },
  408. // disk list area
  409.     //Maoyong 2004.06.23 HL too long will cause GUI bug when chang dir page use UP/DOWN.
  410.     #if defined (SUPPORT_CHINESE_FONT) || defined (SUPPORT_JOLIET_FORMAT)
  411. { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
  412. X1 - FS_DIRLIST_XSTART + 6, PER_PAGE * FS_FILELIST_YSTEP },
  413.     #else
  414.     { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
  415. X1 - FS_DIRLIST_XSTART, PER_PAGE * FS_FILELIST_YSTEP },
  416.     #endif
  417. //warning message area
  418. {   30,                         26,
  419.     304,                        17                              },
  420. //dir slot area
  421. {
  422. FS_DIRSCROLLLEN_XSTART , FS_DIESCROLLLEN_YSTART,
  423. FS_DIRSCROLLLEN_XSIZE, FS_DIRSCROLLLEN_YSIZE
  424. },
  425. //dir movebar area
  426. {
  427. FS_DIRSCROLLLEN_XSTART + 5, FS_DIESCROLLLEN_YSTART + 7 ,
  428. FS_DIRSCROLLLEN_XSIZE - 10, FS_DIRSCROLLLEN_YSIZE - 14
  429. },
  430. #endif
  431. };
  432. #endif
  433. const UINT8  cluty_fsgui[2] =
  434. {
  435.     YELLOW_Y,
  436.     BLACK_Y,
  437. };
  438. const UINT16  clutc_fsgui[2] =
  439. {
  440.     YELLOW_CRCB,
  441.     BLACK_CRCB,
  442. };
  443. #ifdef APEX_MP3_ICON
  444. const BYTE mp3fileIcon[24][72] =
  445. {
  446.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  447.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, },
  448.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, },
  449.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, },
  450.  {0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, },
  451.  {0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, },
  452.  {0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, },
  453.  {0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  454.  {0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  455.  {0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  456.  {0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, },
  457.  {0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, },
  458.  {0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, },
  459.  {0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, },
  460.  {0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, },
  461.  {0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, },
  462.  {0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, },
  463.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  464.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  465.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  466.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0x57, 0xff, 0xff, 0x57, 0xff, 0xff, 0x57, 0xff, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  467.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0x57, 0x57, 0xff, 0x57, 0xff, 0xff, 0x57, 0xff, 0x57, 0x57, 0xff, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0x57, 0x57, 0xff, 0x57, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  468.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0x57, 0xff, 0xff, 0x57, 0xff, 0xff, 0x57, 0xff, 0xff, 0x57, 0xff, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  469.  {0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0xff, 0x57, 0x57, 0xff, 0x57, 0x57, 0xff, 0x57, 0xff, 0xff, 0xff, 0xff, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, 0x57, },
  470. };
  471. #endif//APEX_MP3_ICON
  472. ////////////////////////////module global functions for internal reference/////////////////////////
  473. //void    DirList();
  474. //void    FileList(void);
  475. void    DrawFolderIcon(int x, int y, BYTE type);
  476. void    ShowDirItem(int iItem, const char *s);
  477. //void    FSShowDirIcon(void);
  478. //void    ShowFileIcon(void);
  479. void    DrawScroll(void);
  480. void    ClearArea(UINT16 iIndex);
  481. void    SelectHL();
  482. void    ShowButtonHL(int x, int y,int len);
  483. void    FSGUI_FlashFileIcon(int iFlash);
  484. #ifdef NEW_MP3_GUI
  485. void ShowHL(void);
  486. void    DrawFileIconX(int x, int y, int type, int mono);
  487. #define DrawFileIcon(x,y,t) DrawFileIconX(x,y,t,0)
  488. #elif defined FS_BMP_GUI//zhaoyanhua add 2004-6-8 10:15
  489. void ShowHL(void);
  490. void    DrawFileIcon(int x, int y, int type);
  491. UINT16  file_focus_y = FS_FONTCOLOR_FILE_Y;
  492. UINT16  file_focus_CrCb = FS_FONTCOLOR_FILE_CrCb;
  493. #else
  494. void    ShowHL(int x, int y,int len,int high);
  495. void    DrawFileIcon(int x, int y, int type);
  496. #endif
  497. UINT16  CountSpecifyFile(int iDir);
  498. //int     PrepareForChangeFilePage(UINT16 iPage, UINT16 iSpecialTrk,UINT16 iDirect);
  499. //void    CalcDirNow(UINT16 *iDir);
  500. ///////////for MP3_Lyrics_Drawed////////////////////
  501. #ifdef MP3_TXT_DISPLAY
  502. extern UINT16 MP3TotalNo;
  503. extern BYTE MP3_Lyrics_Drawed;
  504. extern void ShowLyricsWhileHL(void);
  505. #endif
  506. ///////////////////////////////////////////////////////////////////////
  507. #ifdef NEW_MP3_GUI
  508. void   DrawArrow(int xStart, int yStart, BYTE updown);
  509. void   DrawRectCorner(BTNAREA  Rect, int CornerRad,  BYTE updown, UINT8 step, UINT16 RegionColor_C);
  510. void   ClearRectArea(BTNAREA  Rect, UINT16 RectColorStep,UINT16 RegionColor_C,int iIndex,int iItem);
  511. void   ShowPlayFrame(int x, int y,int len,int high);
  512. void   ShowCurrentDirPlaying();
  513. void   ShowCurrentFilePlaying();
  514. #elif defined (FS_BMP_GUI)//zhaoyanhua 2004-6-8 10:15
  515. //temp has the same function with NEW_MP3_GUI.
  516. //we will modify the functions later.
  517. void   DrawRectCorner(BTNAREA  Rect, int CornerRad,  BYTE updown, UINT8 step, UINT16 RegionColor_C);
  518. void   ShowPlayFrame(int x, int y,int len,int high);
  519. void   ShowCurrentDirPlaying();
  520. void   ShowCurrentFilePlaying();
  521. #endif
  522. ///////////////////////////////////////////////////////////////////////
  523. #ifdef APEX_MP3_ICON
  524. void    DrawMp3ApexIcon(int x, int y);
  525. #endif//#ifdef APEX_MP3_ICON
  526. //======================================================================
  527. #ifdef FSGUI_NO_BLINK_SCROLL
  528. void MoveScroll(UINT16 , INT8);
  529. #else
  530. void MoveScroll(UINT16);
  531. #endif
  532. #ifdef HANYANG_LR_CHANGE_PAGE
  533. //When enter in DIR area, right to file area
  534. void FSGUI_Dir2FileArea(void);
  535. void FSGUI_File2DirArea(void);
  536. #endif
  537. //module global variables for internal reference
  538. /*
  539. UINT16  Hl_x;
  540. UINT16  Hl_y;
  541. UINT16  Hl_len;
  542. UINT16  Hl_high;
  543. UINT16  Hl_x_btn;
  544. UINT16  Hl_y_btn;
  545. UINT16  Hl_len_btn;
  546. UINT16  old_file_page;         // index of current page
  547. UINT16  old_dir_page;
  548. UINT16  refresh_file_page;
  549. UINT16  refresh_dir_page;
  550. UINT16  refresh_dir_icon;
  551. */
  552. #ifdef AUDIO_SHOW_SAVER
  553. BYTE    bDisableGUI = 0;
  554. #endif
  555. //David add 2004-01-05
  556. #ifdef FSGUI_NO_BLINK_SCROLL
  557. BYTE up_down_done=0;
  558. char tempbuf[22];
  559. #define SCROLLBAR_UP 1
  560. #define SCROLLBAR_REFRESH 0
  561. #define SCROLLBAR_DOWN -1
  562. #endif
  563. extern BYTE jpg_break_up_down; //Maoyong 2004.04.19
  564. //===================================================================
  565. //zhaoyanhua new add 3-7-25 15:16
  566. //for HL
  567. #if defined (NEW_MP3_GUI) || defined (FS_BMP_GUI)
  568. int    fsnav_dir_HL =0; //save the current playing dir
  569. int    fsnav_file_HL=0; //save the current playing file
  570. int    HL_Width =0, HL_Heighth = HL_RECT_HEIGHTH;//HL width and heighth.
  571. int    old_ControlArea=0; //record last ControlArea.
  572. int    HL_show=0;//record HL .
  573. //
  574. // a flag to avoid blinkling when show JPEG.
  575. // when show the first JPEG , need draw the whole rectangle.
  576. // But the following JPEG will only  clear the part of the rectangle.
  577. BYTE   JPEG_Preview_drawed = DIR_LIST_IN_DIR_AREA;
  578. BYTE   flagRefresh;
  579. #endif
  580. //===================================================================
  581. void DrawRect(int x, int y, int xSize, int ySize, UINT16 selected, UINT16 color_Y, UINT16 color_CrCb)
  582. {
  583. #ifdef AUDIO_SHOW_SAVER
  584.     if (bDisableGUI) return;
  585. #endif
  586. FSGUI_FillFrameBuf(x, y, xSize, ySize, color_Y, color_CrCb);
  587. if (selected == 1)
  588. {
  589. // rect selected
  590. FSGUI_FillFrameBuf(x, y, xSize, DEMENSION_SIZE, BLACK_Y, BLACK_CRCB);
  591. FSGUI_FillFrameBuf(x, y, DEMENSION_SIZE, ySize, BLACK_Y, BLACK_CRCB);
  592. FSGUI_FillFrameBuf(x + xSize - DEMENSION_SIZE, y + DEMENSION_SIZE, DEMENSION_SIZE, ySize - DEMENSION_SIZE, WHITE_Y, WHITE_CRCB);
  593. FSGUI_FillFrameBuf(x + DEMENSION_SIZE, y + ySize - DEMENSION_SIZE, xSize - DEMENSION_SIZE, DEMENSION_SIZE ,WHITE_Y, WHITE_CRCB);
  594. }
  595. else
  596. {
  597. // rect release
  598. FSGUI_FillFrameBuf(x, y, xSize, DEMENSION_SIZE, WHITE_Y, WHITE_CRCB);
  599. FSGUI_FillFrameBuf(x, y, DEMENSION_SIZE, ySize, WHITE_Y, WHITE_CRCB);
  600. FSGUI_FillFrameBuf(x + xSize - DEMENSION_SIZE, y, DEMENSION_SIZE, ySize, BLACK_Y, BLACK_CRCB);
  601. FSGUI_FillFrameBuf(x, y + ySize - DEMENSION_SIZE, xSize ,DEMENSION_SIZE ,BLACK_Y, BLACK_CRCB);
  602. }
  603. }
  604. #if !defined(FS_BMP_GUI)&& !defined(MP3_LARGE_GUI)
  605. void DrawButton(void)
  606. {
  607. #ifdef AUDIO_SHOW_SAVER
  608.     if (bDisableGUI) return;
  609. #endif
  610. #ifdef APEX_MP3_ICON
  611. DrawMp3ApexIcon(fsArea[FS_AREA_BUTTON].xStart -90, fsArea[FS_AREA_BUTTON].yStart );
  612. #endif
  613. //draw MP3 icon
  614. if (pFsJpeg->gifsMP3Count)
  615. {
  616.     #ifdef MP3_NOICON     //caohui 2004-4-23 06:36
  617. DrawRect(fsArea[FS_AREA_BUTTON].xStart+40, fsArea[FS_AREA_BUTTON].yStart-205,
  618. 50, 17,
  619. pFsJpeg->gifsFuncBtn == FS_FUNC_MP3 ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  620.     #else
  621. DrawRect(fsArea[FS_AREA_BUTTON].xStart, fsArea[FS_AREA_BUTTON].yStart,
  622. 25, 25,
  623. pFsJpeg->gifsFuncBtn == FS_FUNC_MP3 ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  624.     #endif
  625. }
  626. else
  627. {
  628. #ifdef MP3_NOICON //caohui 2004-4-23 06:36
  629. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+48, fsArea[FS_AREA_BUTTON].yStart-205,
  630. 50, 17,
  631. BK_GROUNDY, BK_GROUNDCRCB);
  632.    #else
  633. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart, fsArea[FS_AREA_BUTTON].yStart,
  634. 25, 25,
  635. BK_GROUNDY, BK_GROUNDCRCB);
  636. #endif
  637. }
  638. #ifdef MP3_NOICON   //2004-4-17 01:05张宇P
  639. strcpy(linebuf, "MP3");
  640. FSGUI_ShowString(fsArea[FS_AREA_BUTTON].xStart + 50,
  641. fsArea[FS_AREA_BUTTON].yStart -204,
  642. linebuf, FS_FONTCOLOR_FILE_Y1, FS_FONTCOLOR_FILE_CrCb1);
  643. #else
  644. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2);
  645. #endif
  646. #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG//nono 20031018
  647. if (pFsJpeg->gifsJPEGCount)
  648. {
  649. #endif
  650. //draw JPEG icon
  651. if (pFsJpeg->gifsJPEGCount)
  652. {
  653.     #ifdef MP3_NOICON     //caohui 2004-4-23 06:36
  654. {
  655. DrawRect(fsArea[FS_AREA_BUTTON].xStart + 92, fsArea[FS_AREA_BUTTON].yStart-205, 50, 17,
  656. pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  657.     }
  658.     #else
  659.     {
  660. DrawRect(fsArea[FS_AREA_BUTTON].xStart + 27, fsArea[FS_AREA_BUTTON].yStart, 25, 25, pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  661. }
  662.     #endif
  663. }
  664. else
  665. {
  666.     #ifdef MP3_NOICON     //caohui 2004-4-23 06:36
  667. {
  668. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 92, fsArea[FS_AREA_BUTTON].yStart,
  669. 50, 15,
  670. BK_GROUNDY, BK_GROUNDCRCB);
  671. }
  672. #else
  673. {
  674. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 27, fsArea[FS_AREA_BUTTON].yStart, 25, 25, BK_GROUNDY, BK_GROUNDCRCB);
  675. }
  676. #endif
  677. }
  678.     #ifdef MP3_NOICON    //2004-4-17 01:07张宇P
  679. psprintf(linebuf, "JPEG");//, "M", s);
  680. FSGUI_ShowString(fsArea[FS_AREA_BUTTON].xStart + 92+4,
  681. fsArea[FS_AREA_BUTTON].yStart -204,
  682. linebuf, FS_FONTCOLOR_FILE_Y1, FS_FONTCOLOR_FILE_CrCb1);
  683. #else
  684. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 33, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_JPEGBUTTON - 2);
  685.     #endif
  686. #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG//nono 20031018
  687.    }//if (pFsJpeg->gifsJPEGCount)
  688. #endif
  689. #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
  690. #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG//nono 20031018
  691.    if (pFsJpeg->gifsGAMECount)
  692. #endif
  693.    {
  694. //draw GAME icon
  695. if (pFsJpeg->gifsGAMECount)
  696. {
  697. DrawRect(fsArea[FS_AREA_BUTTON].xStart + 54,fsArea[FS_AREA_BUTTON].yStart, 25, 25,
  698. pFsJpeg->gifsFuncBtn == FS_FUNC_GAME? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  699. }
  700. else
  701. {
  702. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 54, fsArea[FS_AREA_BUTTON].yStart,
  703. 25, 25,
  704. BK_GROUNDY, BK_GROUNDCRCB);
  705. }
  706. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_GAMEBUTTON - 2);
  707.    }//if (pFsJpeg->gifsGAMECount)
  708. #endif//#ifdef SUPPORT_NESGAME
  709. #ifdef SUPPORT_FILE_SYSTEM_MODE
  710. #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
  711. #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG
  712.    if (pFsJpeg->gifsOtherCount)
  713. #endif
  714.    {
  715. if (pFsJpeg->gifsOtherCount)
  716. {
  717. DrawRect(fsArea[FS_AREA_BUTTON].xStart + 81, fsArea[FS_AREA_BUTTON].yStart, 25, 25,
  718. pFsJpeg->gifsFuncBtn == FS_FUNC_OTHER? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  719. }
  720. else
  721. {
  722. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 81, fsArea[FS_AREA_BUTTON].yStart,
  723. 25, 25,
  724. BK_GROUNDY, BK_GROUNDCRCB);
  725. }
  726. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
  727.    }//if (pFsJpeg->gifsOtherCount)
  728. #else//#ifdef SUPPORT_NESGAME
  729. #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG
  730.    if (pFsJpeg->gifsOtherCount)
  731. #endif
  732.    {
  733. if (pFsJpeg->gifsOtherCount)
  734. {
  735. DrawRect(fsArea[FS_AREA_BUTTON].xStart + 54, fsArea[FS_AREA_BUTTON].yStart, 25, 25,
  736. pFsJpeg->gifsFuncBtn == FS_FUNC_OTHER? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  737. }
  738. else
  739. {
  740. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 54, fsArea[FS_AREA_BUTTON].yStart,
  741. 25, 25,
  742. BK_GROUNDY, BK_GROUNDCRCB);
  743. }
  744. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
  745.    }//if (pFsJpeg->gifsOtherCount)
  746. #endif//#ifdef SUPPORT_NESGAME
  747. #endif//#ifdef SUPPORT_FILE_SYSTEM_MODE
  748. #if defined(SUPPORT_MIDI)&&defined(SHOW_MIDI_ICON)//axel 2004/8/8
  749.     #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
  750. if (pFsJpeg->gifsMidiCount)
  751. {
  752. DrawRect(fsArea[FS_AREA_BUTTON].xStart + 108, fsArea[FS_AREA_BUTTON].yStart,
  753. 25, 25,
  754. pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  755. }
  756. else
  757. {
  758. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 108, fsArea[FS_AREA_BUTTON].yStart,
  759. 25, 25,
  760. BK_GROUNDY, BK_GROUNDCRCB);
  761. }
  762. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 114, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  763. #else
  764.         if (pFsJpeg->gifsMidiCount)
  765.         {
  766.             DrawRect(fsArea[FS_AREA_BUTTON].xStart + 81, fsArea[FS_AREA_BUTTON].yStart,
  767.                 25, 25,
  768.                 pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  769.         }
  770.         else
  771.         {
  772.             FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 108, fsArea[FS_AREA_BUTTON].yStart,
  773.                 25, 25,
  774.                 BK_GROUNDY, BK_GROUNDCRCB);
  775.         }
  776.         DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  777.     #endif
  778. #endif
  779. return;
  780. }
  781. #endif //#if !defined(FS_BMP_GUI)&& !defined(MP3_LARGE_GUI)
  782. #include "fsgui_icon_discx.inc"
  783. #if !defined (FS_BMP_GUI)
  784. void FSGUI_RotateDiscIcon(int iRotate)
  785. {
  786.     #ifdef PMP_UI//liweihua 2005-1-5
  787.     int x = fsArea[FS_AREA_DIRICON].xStart + 610;
  788.     #else
  789.     int x = fsArea[FS_AREA_DIRICON].xStart;
  790.     #endif
  791.     int y = Y1 - 17;
  792.     //wanghaoying 2004-8-3 11:40, different defination different position.
  793.     #ifdef MP3_LARGE_GUI
  794.     x = x + 20;
  795.     y = y - 19;
  796.     #endif
  797.     static  const   UINT8   cluty[2][4] = {
  798.         {BK_GROUNDY, BLACK_Y, YELLOW_Y, RED_Y},
  799.         {BK_GROUNDY, BLACK_Y, RED_Y, YELLOW_Y},
  800.     };
  801.     static  const   UINT16  clutc[2][4] = {
  802.         {BK_GROUNDCRCB, BLACK_CRCB, YELLOW_CRCB, RED_CRCB},
  803.         {BK_GROUNDCRCB, BLACK_CRCB, RED_CRCB, YELLOW_CRCB},
  804.     };
  805. #ifdef AUDIO_SHOW_SAVER
  806.     if (bDisableGUI) return;
  807. #endif
  808.     if (iRotate) iRotate=1;
  809.     FSGUI_DrawIcon(x, y, ICON_DiscX, cluty[iRotate], clutc[iRotate], 0);
  810. }
  811. #else //#if !defined (FS_BMP_GUI)
  812. /*
  813.  * Description:
  814.  *      Draw all rotate disc 2 icons
  815.  * INPUT:
  816.  * To change the iRotate factor in polling_mp3(),
  817.  * It decides to show different icons each time,so it looks like rotating the icon.
  818.  *Creater:
  819.  * feeling
  820.  *Date: 2004-06-08
  821.  * Update : zhaoyanhua 2004-6-28 14:51
  822.  *
  823.  */
  824. extern void FSGUI_DrawReverseBmp(UINT16 xStart, UINT16 yStart, BYTE iLayoutIndex, BYTE iMode);
  825. void FSGUI_RotateDiscIcon(int iRotate)
  826. {
  827.     BYTE iBmpIndex = 0;
  828.     switch(iRotate)
  829.     {
  830.         case 0:
  831.             iBmpIndex = LAY_ANIMATION1;
  832.             FSGUI_LayoutBmp(iBmpIndex);
  833.             break;
  834.         case 1:
  835.             iBmpIndex = LAY_ANIMATION2;
  836.             FSGUI_DrawReverseBmp(
  837.                                 fsArea[FS_AREA_PATHINFO].xStart - 33,
  838.                         fsArea[FS_AREA_PATHINFO].yStart,
  839.                         iBmpIndex,1);
  840.             break;
  841.         case 2:
  842.             iBmpIndex = LAY_ANIMATION1;
  843.             FSGUI_DrawReverseBmp(
  844.                                 fsArea[FS_AREA_PATHINFO].xStart - 33,
  845.                         fsArea[FS_AREA_PATHINFO].yStart,
  846.                         iBmpIndex,1);
  847.             break;
  848.         case 3:
  849.             iBmpIndex = LAY_ANIMATION2;
  850.             FSGUI_LayoutBmp(iBmpIndex);
  851.             break;
  852.     }
  853. }
  854. #endif //#if !defined (FS_BMP_GUI)
  855. void FSGUI_FlashFileIcon(int iFlash)
  856. {
  857.     if (pFsJpeg->fsnav_trk_now == (pFsJpeg->file_array[pFsJpeg->file_current] - pFsJpeg->first_mp3_entry))
  858.     {
  859.         if (iFlash)
  860.         {
  861.             int x = fsArea[FS_AREA_FILEICON].xStart;
  862.             int y = fsArea[FS_AREA_FILEICON].yStart + FS_FILELIST_YSTEP * pFsJpeg->file_current;
  863.             int icon = pFsJpeg->gifsFuncBtn - 1;
  864.          DrawFileIcon(x, y, icon);
  865.         }
  866.         else
  867.         {
  868.          #ifdef NEW_MP3_GUI
  869.             ClearRectArea( Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB, FS_AREA_FILEICON, -1);
  870.          #elif defined FS_BMP_GUI
  871.             //FSGUI_ClearArea(FS_AREA_FILEICON,PER_PAGE + 1);
  872.             #else
  873.             ClearArea(FS_AREA_FILEICON);
  874.             #endif
  875.         }
  876.     }
  877. }
  878. void ShowFileIcon(void)
  879. {
  880.     int i = 0;
  881.     if (refresh_file_page == 1)
  882.     {
  883.      #ifdef FS_BMP_GUI
  884.          FSGUI_ClearArea(FS_AREA_FILEICON,PER_PAGE+1);
  885.      #elif defined(NEW_MP3_GUI)
  886.             ClearRectArea(Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB,FS_AREA_FILEICON, -1 );
  887.         #else
  888.             ClearArea(FS_AREA_FILEICON);
  889.         #endif
  890.     }
  891.     for (i = 0; i < pFsJpeg->File_Count ; i++)
  892.     {
  893.         DrawFileIcon(fsArea[FS_AREA_FILEICON].xStart,
  894.             (fsArea[FS_AREA_FILEICON].yStart + FS_FILELIST_YSTEP * i),
  895.             pFsJpeg->gifsFuncBtn - 1);
  896.     }
  897. }
  898. void FSShowDirIcon(void)
  899. {
  900. int i = 0;
  901. #ifdef FS_BMP_GUI
  902.      if ( (refresh_dir_page == 1)||(refresh_dir_icon == 1))
  903.                 FSGUI_ClearArea(FS_AREA_DIRICON,PER_PAGE + 1);
  904. #else
  905. if ((!refresh_dir_page) && (!refresh_dir_icon))
  906. return;
  907.         #if defined(NEW_MP3_GUI)
  908.         ClearRectArea(Rect[DIR_RECT], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRICON,-1);
  909.     #else
  910.         ClearArea(FS_AREA_DIRICON);
  911.     #endif
  912. #endif
  913. for (i = 0; i < pFsJpeg->Dir_Count ; i++)
  914. {
  915. BYTE mode;
  916. if (pFsJpeg->dir_array[i] != pFsJpeg->fsnav_dir_now)
  917. mode = 0;
  918. else
  919. mode = 1;
  920. DrawFolderIcon(fsArea[FS_AREA_DIRICON].xStart, (FS_DIRLIST_YSTART + FS_FILELIST_YSTEP * i), mode);
  921. }
  922. refresh_dir_icon = 0;
  923. }
  924. #ifdef APEX_MP3_ICON
  925. void DrawMp3ApexIcon(int x, int y)
  926. {
  927.     int i, j;
  928. #ifdef AUDIO_SHOW_SAVER
  929.     if (bDisableGUI) return;
  930. #endif
  931.     for (i=0; i<24; i++) {
  932.         for (j=0; j<72; j++) {
  933.             //if ( fileIcon[type][i][j] == 0xff) continue;
  934.             FSGUI_DrawPixel(
  935.                 x+j, y+i,
  936.         RGB8_Y[ mp3fileIcon[i][j] ],
  937.                 RGB8_CrCb[ mp3fileIcon[i][j] ]
  938.             );
  939.         }
  940.     }
  941. }
  942. #endif//#ifdef APEX_MP3_ICON
  943. void FSShowFileItem(int iItem, const char *s)
  944. {
  945. #ifdef MP3_TXT_DISPLAY
  946.     char buf[100];
  947. #else
  948. char buf[20];
  949. #endif
  950. UINT16 first_seq;
  951. #ifdef AUDIO_SHOW_SAVER
  952.     if (bDisableGUI) return;
  953. #endif
  954. if ((iItem < 0) || (iItem >= PER_PAGE) || (iItem >= pFsJpeg->File_Count))
  955. return;
  956. #ifdef MP3_DIRECT_SELECT
  957. first_seq = pFsJpeg->first_mp3_seq + PER_PAGE * pFsJpeg->file_page_will;
  958. #else
  959. first_seq = PER_PAGE * pFsJpeg->file_page_will;
  960. #endif
  961. #ifdef MP3_DIRECT_SELECT
  962. if(pFsJpeg->count_file[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3] >= 1000)
  963. psprintf(buf, "%04d.%s", first_seq + iItem + 1, s);
  964. else if(pFsJpeg->count_file[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3] >= 100)
  965. #else
  966. if(pFsJpeg->file_specify_in_dir >= 1000)
  967. psprintf(buf, "%04d.%s", first_seq + iItem + 1, s);
  968. if(pFsJpeg->file_specify_in_dir >= 100)
  969. #endif
  970. psprintf(buf, "%03d.%s", first_seq + iItem + 1, s);
  971. else
  972. psprintf(buf, "%02d.%s", first_seq+iItem + 1, s);
  973. #ifdef FS_BMP_GUI
  974.     FSGUI_ShowString(fsArea[FS_AREA_FILEITEM].xStart + 46,
  975. (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem),
  976. buf, file_focus_y, file_focus_CrCb);
  977. #else
  978. FSGUI_ShowString(fsArea[FS_AREA_FILEITEM].xStart,
  979. (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem),
  980. buf, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
  981. #endif
  982. }
  983. void ShowDirItem(int iItem, const char *s)
  984. {
  985. char    buf[20];
  986. UINT16  first_seq;
  987. #ifdef AUDIO_SHOW_SAVER
  988. if (bDisableGUI) return;
  989. #endif
  990. if ( (iItem < 0) || (iItem >= PER_PAGE) || (iItem >= pFsJpeg->Dir_Count)) {
  991. return;
  992. }
  993. first_seq = PER_PAGE * pFsJpeg->dir_page_now;
  994. if ( strcmp(s, "")==0 ) {
  995. psprintf(buf, "%02d.\", first_seq+iItem+1);
  996. } else {
  997. psprintf(buf, "%02d.%s",first_seq+iItem+1, s);
  998. }
  999. #ifdef FS_BMP_GUI
  1000.     FSGUI_ShowString( fsArea[FS_AREA_DIRITEM].xStart + 46,
  1001. (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem ),
  1002. buf, file_focus_y, file_focus_CrCb);
  1003. #else
  1004. FSGUI_ShowString( fsArea[FS_AREA_DIRITEM].xStart,
  1005. (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem ),
  1006. buf, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
  1007. #endif
  1008. }
  1009. //
  1010. // DrawFileIcon()
  1011. // Draw icon for file types
  1012. // type = 0->mp3, = 1->jpeg  , 2->game
  1013. //
  1014. #include "fsgui_icon_filex.inc"
  1015. #ifdef NEW_MP3_GUI
  1016. void DrawFileIconX(int x, int y, int type, int mono)
  1017. {
  1018. #ifdef AUDIO_SHOW_SAVER
  1019.     if (bDisableGUI) return;
  1020. #endif
  1021.     FSGUI_DrawIcon(x, y, ICON_FileX[type], RGB8_Y, RGB8_CrCb, (mono? FSGUI_ICON_MONO : 0));
  1022. }
  1023. #else
  1024. void DrawFileIcon(int x, int y, int type)
  1025. {
  1026. #ifdef AUDIO_SHOW_SAVER
  1027.     if (bDisableGUI) return;
  1028. #endif
  1029. #ifdef FS_BMP_GUI //suqiaoli add 2004-6-10 10:25
  1030.     FSGUI_LayPosVariableBmp(x, y,LAY_MP3_ICON_S + type);
  1031. #else
  1032.     FSGUI_DrawIcon(x, y, ICON_FileX[type], RGB8_Y, RGB8_CrCb, 0);
  1033. #endif
  1034. }
  1035. #endif
  1036. //
  1037. // DrawFolderIcon()
  1038. // Draw icon for directory types
  1039. // type=0: unselected, = 1: opened
  1040. //
  1041. #include "fsgui_icon_folderx.inc"
  1042. void DrawFolderIcon(int x, int y, BYTE type)
  1043. {
  1044. #ifdef AUDIO_SHOW_SAVER
  1045.     if (bDisableGUI) return;
  1046. #endif
  1047. #ifdef FS_BMP_GUI //suqiaoli add 2004-6-10 10:26
  1048.     FSGUI_LayPosVariableBmp(x, y,LAY_FOLDER_ICON);
  1049. #else
  1050.     FSGUI_DrawIcon(x, y, ICON_FolderX[type], cluty_fsgui, clutc_fsgui, 0);
  1051. #endif
  1052. }
  1053. void DrawRectEdge(int x,int y, int xSize,int ySize,UINT16 color_Y,UINT16 color_CrCb)
  1054. {
  1055. #ifdef AUDIO_SHOW_SAVER
  1056.     if (bDisableGUI) return;
  1057. #endif
  1058. //wanghaoying notice 2004-8-4 17:24,
  1059. //maybe when Large-GUI DEMENSION_SIZE should be (DEMENSION_SIZE+1)
  1060. FSGUI_FillFrameBuf(x,y,xSize,DEMENSION_SIZE,color_Y,color_CrCb);
  1061. FSGUI_FillFrameBuf(x,y,DEMENSION_SIZE,ySize,color_Y,color_CrCb);
  1062. FSGUI_FillFrameBuf(x+xSize-DEMENSION_SIZE,y,DEMENSION_SIZE,ySize,color_Y,color_CrCb);
  1063. FSGUI_FillFrameBuf(x,y+ySize-DEMENSION_SIZE,xSize,DEMENSION_SIZE,color_Y,color_CrCb);
  1064. }
  1065. //
  1066. // List File item and clear refresh_file_page
  1067. //
  1068. void FileList(void)
  1069. {
  1070.     UINT16 i;
  1071.     if (pFsJpeg->gifsState == FS_STATE_JPEG)
  1072.         return;
  1073.     if (!refresh_file_page)
  1074.         return;
  1075. #ifdef FS_BMP_GUI
  1076.     FSGUI_ClearArea(FS_AREA_FILEITEM,PER_PAGE+1);
  1077. #elif defined(NEW_MP3_GUI)
  1078.         ClearRectArea(Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB, FS_AREA_FILEITEM, -1);
  1079.     #else
  1080.         ClearArea(FS_AREA_FILEITEM);
  1081.     #endif
  1082. #ifdef JPG_EFFECT
  1083.     #if !defined ( HELP_BMP_GUI)
  1084.      jpeg_effect_draw_help();
  1085. #endif
  1086. #endif
  1087.     for (i = 0; i < pFsJpeg->File_Count; i++)
  1088.     {
  1089.         DrawFileIcon(fsArea[FS_AREA_FILEICON].xStart,
  1090.             (fsArea[FS_AREA_FILEICON].yStart + FS_FILELIST_YSTEP * i), pFsJpeg->gifsFuncBtn - 1);
  1091.         FSShowFileItem(i, iso9660_file[pFsJpeg->file_array[i]].name);
  1092.     }
  1093.     refresh_file_page = 0;
  1094. }
  1095. //
  1096. // Calculat location of the first file specified style -> fsnav_trk_now
  1097. // and how many page needed to show these files -> File_Page_Count
  1098. // and first_mp3_entry, last_mp3_entry
  1099. // file_page_now and file_current clear to 0
  1100. // and calculate length of scroll bar
  1101. //
  1102. UINT16 CalcFileFirstPage(int iDirSelect)
  1103. {
  1104. int iFile;
  1105. pFsJpeg->first_mp3_seq = 0;
  1106. pFsJpeg->first_mp3_entry = pFsJpeg->Dir_entry[iDirSelect];
  1107. if(iDirSelect == pFsJpeg->fsnav_dir_cnt - 1)
  1108. pFsJpeg->last_mp3_entry = pFsJpeg->iso9660_file_cnt - 1;
  1109. else
  1110. pFsJpeg->last_mp3_entry = pFsJpeg->Dir_entry[iDirSelect + 1] - 1;
  1111. pFsJpeg->file_specify_in_dir = CountSpecifyFile(iDirSelect);
  1112. for(iFile = 0; iFile < pFsJpeg->first_mp3_entry; iFile++)
  1113. {
  1114. if (iso9660_file[iFile].type == pFsJpeg->gifsFuncBtn)
  1115. pFsJpeg->first_mp3_seq++;
  1116. }
  1117. iFile = pFsJpeg->first_mp3_entry;
  1118. while (iFile <= pFsJpeg->last_mp3_entry)
  1119. {
  1120. if (iso9660_file[iFile].type == pFsJpeg->gifsFuncBtn)
  1121. {
  1122. pFsJpeg->fsnav_trk_now = iFile - pFsJpeg->first_mp3_entry;
  1123. break;
  1124. }
  1125. iFile++;
  1126. }
  1127. pFsJpeg->File_Page_Count = (pFsJpeg->file_specify_in_dir + PER_PAGE - 1) / PER_PAGE;
  1128. #ifdef FS_BMP_GUI
  1129.     //this for file scroll bar
  1130.     if (pFsJpeg->File_Page_Count != 1)// > PER_PAGE files all
  1131.     {
  1132.         pFsJpeg->scroll_len = ( fsArea[FS_AREA_MOVEBAR].ySize * PER_PAGE) /pFsJpeg->file_specify_in_dir;
  1133.         pFsJpeg->scroll_step = pFsJpeg->scroll_len;
  1134.     }
  1135.     else // <= PER_PAGE files all
  1136.     {
  1137.         pFsJpeg->scroll_step = 0;
  1138.         pFsJpeg->scroll_len = 0;
  1139.     }
  1140.     //this is for dir scroll bar
  1141.     dir_count_page = ( pFsJpeg->count_dir[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3]+ PER_PAGE - 1) / PER_PAGE;
  1142.     UINT16 dir_sum = pFsJpeg->count_dir[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3];
  1143.     if (dir_count_page != 1) // > PER_PAGE dirs all
  1144.     {
  1145.         dir_scroll_len = ( fsArea[FS_AREA_DIR_MOVEBAR].ySize * PER_PAGE) /dir_sum;
  1146.         dir_scroll_step = dir_scroll_len;
  1147.     }
  1148.     else // <= PER_PAGE files all
  1149.     {
  1150.         dir_scroll_step = 0;
  1151.         dir_scroll_len  = 0;
  1152.     }
  1153. #else
  1154. if (pFsJpeg->File_Page_Count != 1)
  1155. pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize / pFsJpeg->File_Page_Count;
  1156. else if (pFsJpeg->file_specify_in_dir != 1)
  1157. pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize / 2;
  1158. else
  1159. pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize;
  1160. if (pFsJpeg->scroll_len < 4)
  1161. pFsJpeg->scroll_len = 4;
  1162. if ((fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_len) >= (pFsJpeg->file_specify_in_dir - 1))
  1163. {
  1164. pFsJpeg->scroll_step = (fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_len) / (pFsJpeg->file_specify_in_dir - 1);
  1165. pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_step * (pFsJpeg->file_specify_in_dir - 1);
  1166. }
  1167. else
  1168. {
  1169. pFsJpeg->scroll_step = 10 * (fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_len) / (pFsJpeg->file_specify_in_dir - 1);
  1170. pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_step * (pFsJpeg->file_specify_in_dir - 1) / 10;
  1171. }
  1172. #endif
  1173. pFsJpeg->file_page_will = 0;
  1174. pFsJpeg->file_will = 0;
  1175. refresh_file_page = 1;
  1176. return pFsJpeg->file_specify_in_dir;
  1177. }
  1178. //
  1179. // locate the directory
  1180. //
  1181. UINT16 AnchorDir(int iSeq)
  1182. {
  1183. int dir;
  1184. int j = 0;
  1185. for (dir = 0; dir < pFsJpeg->fsnav_dir_cnt; dir++)
  1186. {
  1187. if (iso9660_dir[dir].type & (0x01 << pFsJpeg->gifsFuncBtn))
  1188. {
  1189. if(j == iSeq)
  1190. break;
  1191. j++;
  1192. }
  1193. }
  1194. return dir;
  1195. }
  1196. UINT16 AnchorFile(int iSeq)
  1197. {
  1198. UINT16 file;
  1199. UINT16 j = 0;
  1200. for (file = 0; file <= (pFsJpeg->last_mp3_entry - pFsJpeg->first_mp3_entry); file++)
  1201. {
  1202. if (iso9660_file[file + pFsJpeg->first_mp3_entry].type == pFsJpeg->gifsFuncBtn)
  1203. {
  1204. if(j == iSeq)
  1205. break;
  1206. j++;
  1207. }
  1208. }
  1209. return (file);
  1210. }
  1211. UINT16 antiAnchorDir(int iDir)
  1212. {
  1213.     int seq = 0;
  1214.     int i;
  1215.     for(i = 0; i <= iDir; i++)
  1216.     {
  1217.         if (iso9660_dir[i].type & (0x01 << pFsJpeg->gifsFuncBtn))
  1218.             seq++;
  1219.     }
  1220.     return (seq-1);
  1221. }
  1222. UINT16 CountSpecifyFile(int iDir)
  1223. {
  1224.     int iCount = 0;
  1225.     int iFirst,iLast;
  1226.     int i;
  1227.     iFirst = pFsJpeg->Dir_entry[iDir];
  1228.     if (iDir == pFsJpeg->fsnav_dir_cnt - 1)
  1229.         iLast = pFsJpeg->iso9660_file_cnt - 1;
  1230.     else
  1231.         iLast = pFsJpeg->Dir_entry[iDir + 1] - 1;
  1232.     i = iFirst;
  1233.     while (i <= iLast)
  1234.     {
  1235.         if (iso9660_file[i].type == pFsJpeg->gifsFuncBtn)
  1236.             iCount++;
  1237.         i++;
  1238.     }
  1239.     return iCount;
  1240. }
  1241. //Jeff update, 20020715
  1242. void FSGUI_ProgSelect(UINT16 index)
  1243. {
  1244.     BYTE oldbSlide;
  1245.     pFsJpeg->fsnav_dir_will = AnchorDir(prog[index][0] - 1);    // calculate fsnav_dir_will, panxing,2002-1-29
  1246.     refresh_dir_icon = 1;
  1247.     FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0);
  1248.     pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
  1249.     oldbSlide = pFsJpeg->gbfsSlide;
  1250.     FSGUI_FileSelect( prog[index][1] );
  1251.     pFsJpeg->gbfsSlide = oldbSlide;
  1252. }
  1253. void FSGUI_FileSelect(int iSelect)
  1254. {
  1255.     if (iSelect > 0 && iSelect <= pFsJpeg->file_specify_in_dir)
  1256.     {
  1257. #ifdef  JPEG_SELECT_IN_REPEAT_MODE //wuxiaofeng 2004-03-10
  1258.         if(rep_mode==0)//hold pFsJpeg->gbfsSlide=1
  1259. #endif
  1260.         pFsJpeg->gbfsSlide = 0;
  1261.         iSelect = iSelect - 1;  // file_current begin from 0, panxing, 2002-1-22
  1262.         if ((pFsJpeg->file_page_will * PER_PAGE <= iSelect) && ((pFsJpeg->file_page_will * PER_PAGE + pFsJpeg->File_Count - 1) >= iSelect))
  1263.         {
  1264.             // selecting is in current file page, panxing, 2002-1-22
  1265.             pFsJpeg->file_will = iSelect - pFsJpeg->file_page_will * PER_PAGE;
  1266.             pFsJpeg->fsnav_trk_will = pFsJpeg->file_array[pFsJpeg->file_will] - pFsJpeg->first_mp3_entry;
  1267.         }
  1268.         else
  1269.         {
  1270.             // selecting isn't in current file page,so need change file page,panxing, 2002-1-22
  1271.             pFsJpeg->file_page_will = iSelect / PER_PAGE;
  1272.             PrepareForChangeFilePage(iSelect / PER_PAGE, iSelect, 2);
  1273.         }
  1274.         Will2Playing();
  1275.     }
  1276. }
  1277. //Maoyong 2004.03.10 Find pre selected file's dir for STOP state right search/select
  1278. void FindPreSelectFileDir(UINT16 *iSelect)
  1279. {
  1280. #ifdef MP3_DIRECT_SELECT
  1281.         int i, tmp;
  1282.         int iCount = 0;
  1283.         if ((*iSelect > 0) && (*iSelect <= pFsJpeg->count_file[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3]))
  1284.         {
  1285.             for(i = 0; i < pFsJpeg->fsnav_dir_cnt; i++)
  1286.             {
  1287.                 tmp = CountSpecifyFile(i);
  1288.                 if((iCount + tmp) >= *iSelect)
  1289.                     break;
  1290.                 iCount += tmp;
  1291.             }
  1292.             pFsJpeg->fsnav_dir_now = i;
  1293.             *iSelect = *iSelect - iCount;
  1294.             printf(" FIND SEL DIR: pFsJpeg->fsnav_dir_now = %dn", pFsJpeg->fsnav_dir_now) ;
  1295.         }
  1296. #else
  1297.     *iSelect = *iSelect;
  1298. #endif
  1299. }
  1300. #ifdef AUDIO_SHOW_SAVER
  1301. void FSGUI_Force2Menu(void)
  1302. {
  1303.     #ifdef MP3_LARGE_GUI
  1304.     config_memory(MEMORY_GRAPH_NTSC);
  1305.     #else
  1306.     config_memory(MEMORY_GRAPH_SMALL);
  1307.     #endif
  1308.     ClearOsdMsg(2);
  1309.     FSGUI_Menu();
  1310.     pFsJpeg->gbfsSlide = 0;
  1311.     pFsJpeg->gifsbPreview = 1; // Robert 20020715
  1312.     refresh_file_page  = 1; // insure refresh dir page, panxing, 2002-1-22
  1313.     refresh_dir_page  = 1;
  1314.     FSGUI_Refresh();
  1315.     AVD_ResetMediaStatus();
  1316.     reset_zoom_state();
  1317. }
  1318. void FSGUI_Disable()
  1319. {
  1320.     bDisableGUI = 1;
  1321. }
  1322. void FSGUI_Ensable()
  1323. {
  1324.     bDisableGUI = 0;
  1325. }
  1326. #endif
  1327. int FSGUI_NormalNext(void)
  1328. {
  1329. int done = 0;
  1330. int files = 0;
  1331. int CurAsWill = 0;
  1332. int bChangeHL;  //Jeff 20020418
  1333.     int iCurDir;
  1334. #ifdef  MP3_JPEG_COWORK
  1335.     old_time=get_stc_32_inline();//get the press time
  1336. #endif
  1337. #ifdef RECORD_PER_SECOND //avoid bug when playing mp3  gerry  2-12-3 19:46
  1338. resumeMSF = 0;
  1339. #endif
  1340. if ((pFsJpeg->file_will == pFsJpeg->file_current) && (pFsJpeg->file_page_now == pFsJpeg->file_page_will)) // Robert modify 021025
  1341. bChangeHL = 1;
  1342. else
  1343. bChangeHL = 0;
  1344. SetAVDState(0);
  1345. if ((pFsJpeg->file_page_now == pFsJpeg->file_page_will) && (pFsJpeg->file_current == pFsJpeg->file_will))
  1346. CurAsWill = 1;
  1347. /*  2004/06/21 yltseng mark, it's no use now
  1348. #ifdef SUPPORT_NESGAME
  1349. if ((pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG) || (pFsJpeg->gifsFuncBtn == FS_FUNC_GAME))
  1350. #else
  1351. if (pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG)
  1352. #endif
  1353. pFsJpeg->gifsbPreview = 1;
  1354. */
  1355. if (pFsJpeg->file_page_now == (pFsJpeg->File_Page_Count - 1))
  1356. files = pFsJpeg->file_specify_in_dir - pFsJpeg->file_page_now * PER_PAGE;
  1357. else
  1358. files = PER_PAGE;
  1359. (pFsJpeg->file_current)++;
  1360.     // 2004/04/13 yltseng, fix the method to find out whether we reach the final file or not
  1361. if (pFsJpeg->file_current >= files)
  1362. {
  1363. // need change file page,panxing,2002-4-15
  1364. refresh_file_page = 1;
  1365. pFsJpeg->file_page_now++;
  1366. pFsJpeg->file_current = 0;
  1367. if (pFsJpeg->file_page_now >= pFsJpeg->File_Page_Count)
  1368. {
  1369. //  need change directory
  1370. refresh_dir_icon = 1;
  1371. Restore2PlayingDir(); //panxing,2002-4-13
  1372. if(rep_mode != REPEAT_DIRECTORY)
  1373. {
  1374.     pFsJpeg->dir_current++;
  1375.     pFsJpeg->fsnav_dir_will++;  //Maoyong 2004.05.27
  1376. }
  1377. else
  1378. PrintOsdMsg(STR_OS_REP_DIR, REGION1, 1, 0);
  1379.             //pFsJpeg->fsnav_dir_will = pFsJpeg->dir_page_now * PER_PAGE + pFsJpeg->dir_current;
  1380.             //dir_in_button = pFsJpeg->dir_page_now * PER_PAGE + pFsJpeg->dir_current;
  1381.             //if( pFsJpeg->fsnav_dir_will >= pFsJpeg->Dir_Count )
  1382.             //if( dir_in_button >= pFsJpeg->Dir_Count )
  1383.             //Maoyong marked and changed 2004-7-6 20:01 More than 10 dirs will enter to stop after 10th dir!!!
  1384.             iCurDir = pFsJpeg->dir_page_now * PER_PAGE + pFsJpeg->dir_current;
  1385.             if( iCurDir >= pFsJpeg->count_dir[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3] )
  1386. {
  1387. // total disc complete
  1388. if (rep_mode != REPEAT_DISC)
  1389. {
  1390. //locate to last dir and last file
  1391. FSGUI_2Last();
  1392.                     
  1393.                     #ifdef SUPPORT_OTHER_FILES_SSCREEN
  1394. extern UINT32 save_srn_start_t;
  1395.                     save_srn_start_t = get_rtc_val();
  1396.                     #endif
  1397. // stop now
  1398. play_state = VCD_STATE_STOP;
  1399. done = 1;
  1400. }
  1401. else
  1402. {
  1403. // start again
  1404. pFsJpeg->fsnav_dir_will = 0;
  1405. FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0);
  1406. pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
  1407. PrintOsdMsg(STR_OS_REP_ALL, REGION1, 1, 0);
  1408. }
  1409. }
  1410. else
  1411. {
  1412. // change directory now
  1413. if (FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0))
  1414. {
  1415. if(rep_mode != REPEAT_DISC)
  1416. {
  1417.                         //locate to last dir and last file
  1418.     FSGUI_2Last();
  1419.                         // stop now
  1420.     play_state = VCD_STATE_STOP;
  1421. done = 1;
  1422. }
  1423. else
  1424. {
  1425. refresh_dir_icon = 1;
  1426. pFsJpeg->fsnav_dir_will = 0;
  1427. FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0);
  1428. PrintOsdMsg(STR_OS_REP_ALL, REGION1, 1, 0);
  1429. }
  1430. }
  1431. pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
  1432. }
  1433. }
  1434. else
  1435. {
  1436. // needn't change directory but need change file page
  1437. if(CurAsWill)
  1438. {
  1439. pFsJpeg->file_page_will = pFsJpeg->file_page_now;
  1440. PrepareForChangeFilePage(pFsJpeg->file_page_now, 0, 0);
  1441. Will2Playing();
  1442. }
  1443. else
  1444. pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
  1445. }
  1446. }
  1447. else
  1448. {
  1449. // needn't change file page
  1450. if (CurAsWill)
  1451. pFsJpeg->fsnav_trk_now = pFsJpeg->file_array[pFsJpeg->file_current] - pFsJpeg->first_mp3_entry;
  1452. else
  1453. pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
  1454. }
  1455. #if 0
  1456. printf("=============Info of mp3 navigation NEXT============n");
  1457. printf("file_current=%3d, file_page_now  =%3d, fsnav_trk_now =%3dn", file_current, pFsJpeg->file_page_now, pFsJpeg->fsnav_trk_now);
  1458. printf("file_will   =%3d, file_page_will =%3d, fsnav_trk_will=%3dn",file_will, pFsJpeg->file_page_will, pFsJpeg->fsnav_trk_will);
  1459. printf("File_Count  =%3d, File_Page_Count=%3d, file_specify_in_dir=%3dn", pFsJpeg->File_Count,pFsJpeg->File_Page_Count,file_specify_in_dir);
  1460. printf("dir_current =%3d, fsnav_dir_now  =%3dn", pFsJpeg->dir_current, pFsJpeg->fsnav_dir_now);
  1461. printf("dir_page_now=%3d, fsnav_dir_will =%3dn", pFsJpeg->dir_page_now, pFsJpeg->fsnav_dir_will);
  1462. printf("refresh_dir_icon=%d,refresh_file_page=%d,refresh_dir_page=%dn",refresh_dir_icon,
  1463. refresh_file_page,refresh_dir_page);
  1464. #endif
  1465. if (bChangeHL)
  1466. Playing2Will();
  1467. return done;
  1468. }
  1469. int FSGUI_NormalPrev(void)
  1470. {
  1471.     int done = 0;
  1472.     int CurAsWill = 0;
  1473.     #if 0//def MP3_FORWD_BACKWD_PLAY   //wsf  2004-7-26 12:59
  1474.     done = 0;
  1475.     return done;
  1476.     #endif
  1477. #ifdef  MP3_JPEG_COWORK
  1478.         old_time=get_stc_32_inline();//get the press time
  1479. #endif
  1480.     SetAVDState(0);
  1481. #ifdef RECORD_PER_SECOND        //avoid bug when playing mp3  gerry  2-12-3 19:46
  1482.     resumeMSF = 0;
  1483. #endif
  1484.     if ((pFsJpeg->file_page_now == pFsJpeg->file_page_will) && (pFsJpeg->file_current == pFsJpeg->file_will))
  1485.         CurAsWill = 1;
  1486. /*  2004/06/21 yltseng mark, it's no use now
  1487. #ifdef SUPPORT_NESGAME
  1488.     if ((pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG) || (pFsJpeg->gifsFuncBtn == FS_FUNC_GAME))
  1489. #else
  1490.     if (pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG)
  1491. #endif
  1492.         pFsJpeg->gifsbPreview = 1;
  1493. */
  1494.     if (pFsJpeg->file_current != 0)
  1495.     {
  1496.         // needn't change file page
  1497.         refresh_file_page = 0;
  1498.         (pFsJpeg->file_current)--;
  1499.         if(CurAsWill)
  1500.             pFsJpeg->fsnav_trk_now = pFsJpeg->file_array[pFsJpeg->file_current] - pFsJpeg->first_mp3_entry;
  1501.         else
  1502.             pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
  1503.     }
  1504.     else
  1505.     {
  1506.         // need change file page;
  1507.         refresh_file_page = 1;
  1508.         if (pFsJpeg->file_page_now != 0)
  1509.         {
  1510.             // change file page now
  1511.             pFsJpeg->file_page_now--;
  1512.             if(CurAsWill)
  1513.             {
  1514.                 pFsJpeg->file_page_will = pFsJpeg->file_page_now;
  1515.                 PrepareForChangeFilePage(pFsJpeg->file_page_now, 0, 1);
  1516.                 Will2Playing();
  1517.             }
  1518.             else
  1519.             {
  1520.                 pFsJpeg->file_current = PER_PAGE;
  1521.                 pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
  1522.             }
  1523.         }
  1524.         else
  1525.         {
  1526.             //  change directory
  1527.             refresh_dir_icon = 1;
  1528.             Restore2PlayingDir();   // panxing, 2002-4-13
  1529.             #ifdef MP3_FB_PLAY_AT_STARTDIR
  1530.             if(pFsJpeg->fsnav_dir_will != 0)    //linrc 2004-8-9 16:21
  1531.             #else
  1532.             if ((pFsJpeg->fsnav_dir_will != 0) || (rep_mode == REPEAT_DIRECTORY)) //panxing, 2002-3-13
  1533.             #endif
  1534.             {
  1535.                 if(rep_mode != REPEAT_DIRECTORY)
  1536.                     pFsJpeg->fsnav_dir_will--;
  1537.                 else
  1538.                     PrintOsdMsg(STR_OS_REP_DIR, REGION1, 1, 0);
  1539.                 if (FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 1))
  1540.                 {
  1541.                     if (rep_mode != REPEAT_DISC)
  1542.                         done = 1;
  1543.                     else
  1544.                     {
  1545.                         //locate to last dir and last file
  1546.                         FSGUI_2Last();
  1547.                     }
  1548.                 }
  1549.                 else
  1550.                 {
  1551.                     pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
  1552.                     // correct the list of prev directory's file, panxing, 2002-1-18
  1553.                     pFsJpeg->file_page_will = pFsJpeg->File_Page_Count - 1;
  1554.                     PrepareForChangeFilePage(pFsJpeg->File_Page_Count - 1, 0, 1);
  1555.                     Will2Playing();
  1556.                 }
  1557.             }
  1558.             else
  1559.             {
  1560.                 // total disc complete
  1561.                 #ifdef MP3_FB_PLAY_AT_STARTDIR  //when FB at dir start,it replay
  1562.                 if(1)                           //and cancel repeat mode,so I marke it
  1563.                 #else                           //linrc 2004-8-9 16:20
  1564.                 if (rep_mode != REPEAT_DISC)
  1565.                 #endif
  1566.                 {
  1567.                     #ifdef MP3_FB_PLAY_AT_STARTDIR
  1568.                     rep_mode = REPEAT_IDLE;
  1569.                     #endif
  1570.                     // stop now
  1571.                     if ((pFsJpeg->fsnav_dir_now == 0) && (adv_search_time < 0))
  1572.                     {
  1573.                         //terry, debug: bf 1st trk , repeat refresh and bf
  1574.                         //2002/4/29 03:56PM
  1575.                         adv_search_time = 0;
  1576.                         refresh_file_page = 0;
  1577.                     }
  1578.                     pFsJpeg->fsnav_dir_will  = 0;
  1579.                     pFsJpeg->dir_current     = 0;
  1580.                     pFsJpeg->fsnav_trk_now   = 0;
  1581.                     pFsJpeg->dir_page_now    = 0;
  1582.                     pFsJpeg->file_page_now   = 0;
  1583.                     old_file_page   = 0xffff;
  1584.                     old_dir_page    = 0xffff;
  1585.                     play_state      = VCD_STATE_STOP;
  1586.                     done            = 1;
  1587.                     FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_now), 0);//2004-3-10 18:38
  1588.                 }
  1589.                 else
  1590.                 {
  1591.                     //locate to last dir and last file
  1592.                     FSGUI_2Last();
  1593.                     PrintOsdMsg(STR_OS_REP_ALL, REGION1, 1, 0);
  1594.                 }
  1595.             }
  1596.         }
  1597.     }
  1598. /*
  1599.     printf("=============Info of mp3 navigation PREV============n");
  1600.     printf("file_current=%3d, file_page_now  =%3d, fsnav_trk_now =%3dn",file_current, pFsJpeg->file_page_now, pFsJpeg->fsnav_trk_now);
  1601.     printf("file_will   =%3d, file_page_will =%3d, fsnav_trk_will=%3dn", file_will, pFsJpeg->file_page_will, pFsJpeg->fsnav_trk_will);
  1602.     printf("File_Count  =%3d, File_Page_Count=%3d, file_specify_in_dir=%3dn", pFsJpeg->File_Count,pFsJpeg->File_Page_Count,file_specify_in_dir);
  1603.     printf("dir_current =%3d, fsnav_dir_now  =%3dn", pFsJpeg->dir_current, pFsJpeg->fsnav_dir_now);
  1604.     printf("dir_page_now=%3d, fsnav_dir_will =%3dn", pFsJpeg->dir_page_now, pFsJpeg->fsnav_dir_will);
  1605.     printf("refresh_dir_icon=%d,refresh_file_page=%d,refresh_dir_page=%dn",refresh_dir_icon,
  1606.     refresh_file_page,refresh_dir_page);
  1607. */
  1608.     return done;
  1609. }
  1610. void FSGUI_CookFileItem(BYTE iItem)
  1611. {
  1612. #ifdef HANYANG_DVD
  1613. #ifdef HANYANG_FS_LONGNAME
  1614. FSGUI_UpdateInfoArea("");
  1615. if( (pFsJpeg->gifsFuncBtn == FS_FUNC_MP3) && GetFileFullName(pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry) ){
  1616.         if( uScrollDispFilenameFlag ==1 ){
  1617.             uScrollDispFilenameFlag = SCROLL_SHOW_500MS_CNT;    //for first display
  1618.             FS_ScrollDispFileName();
  1619.         }
  1620.     }
  1621. #endif
  1622. return;
  1623. #endif
  1624. char buf[22] = {0};
  1625. if ((iItem >= PER_PAGE) || (iItem >= pFsJpeg->File_Count))
  1626. return;
  1627. #ifdef SUPPORT_ID3//CLEAD_UNICODE
  1628. FSGUI_FillFrameBuf(36,8,148+172,50, BK_GROUNDY, BK_GROUNDCRCB);//clead_unicode
  1629. #endif
  1630. if (pFsJpeg->gifsFuncBtn == FS_FUNC_MP3)
  1631. {
  1632. #ifndef SUPPORT_ID3
  1633.     // 2004/04/18 yltseng, If not mark it, when turn on SUPPORT_CHINESE_FONT, all CDROM & CDROM_WMA file don't show
  1634.     // extension file name even though we turn ISO9660_FILE_NOT_SHOW_EXTEND_NAME off.
  1635.     //#ifndef SUPPORT_CHINESE_FONT
  1636. if (GetCurrentFileType() == CDROM)
  1637. {
  1638. #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME     //gerry,2004-2-26 10:53
  1639. psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name); // panxing,2002-4-13
  1640. #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1641. psprintf(buf, "[%s]%s.MP3", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name); // panxing,2002-4-13
  1642. #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1643. }
  1644. else
  1645. #ifdef SUPPORT_WMA
  1646. if (GetCurrentFileType() == CDROM_WMA)
  1647. {
  1648. #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME     //gerry,2004-2-26 10:53
  1649. psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name); // panxing,2002-4-13
  1650. #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1651. psprintf(buf, "[%s]%s.WMA", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name); // panxing,2002-4-13
  1652. #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1653. }
  1654. else
  1655. #endif
  1656.     //#endif
  1657. {
  1658. psprintf(buf, "[%s ]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name); // panxing,2002-4-13
  1659. }
  1660. #endif
  1661. }
  1662. else if (pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG)
  1663. {
  1664. #ifdef SUPPORT_GIF
  1665. if (GetCurrentFileType() == CDROM_GIF)
  1666. {
  1667. #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME     //gerry,2004-2-26 10:53
  1668. psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1669. #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1670. psprintf(buf, "[%s]%s.GIF", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1671. #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1672. }
  1673. else
  1674. #endif
  1675. #ifdef SUPPORT_BMP
  1676. if (GetCurrentFileType() == CDROM_BMP)
  1677. {
  1678. #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME     //gerry,2004-2-26 10:53
  1679. psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1680. #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1681. psprintf(buf, "[%s]%s.BMP", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1682. #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1683. }
  1684. else
  1685. #endif
  1686.     #ifdef MINTON_DVD//wuxiaofeng changed here 02-27 for minton DVD.
  1687.         psprintf(buf, "[%s]%s.JPEG", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1688.     #else
  1689. #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME     //gerry,2004-2-26 10:53
  1690. psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1691. #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1692. psprintf(buf, "[%s]%s.JPG", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1693. #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1694.     #endif
  1695. }
  1696. #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
  1697. else if (pFsJpeg->gifsFuncBtn == FS_FUNC_GAME)
  1698. psprintf(buf, "%s [%dK]", iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].size / 1000);
  1699. #endif
  1700. #ifdef SUPPORT_FILE_SYSTEM_MODE // Robert 021001
  1701. else if (pFsJpeg->gifsFuncBtn == FS_FUNC_OTHER)
  1702.     {   // yltseng 20040412 show file extension
  1703.     #ifndef ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1704.         #ifdef TELL_FROM_MP4_EXT_NAME   //Maoyong
  1705.         if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_MP4 )
  1706.             psprintf(buf, "[%s]%s.DIV", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1707.         else if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_AVI )
  1708.             psprintf(buf, "[%s]%s.AVI", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1709.         #else
  1710.         if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_MP4 )
  1711.             psprintf(buf, "[%s]%s.MP4", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1712.         #endif  //#ifdef TELL_FROM_MP4_EXT_NAME
  1713.         else if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_MPG )
  1714.             psprintf(buf, "[%s]%s.MPG", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1715.         #ifdef SUPPORT_PLAY_SWD
  1716.         else if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_SWD )
  1717.             psprintf(buf, "[%s]%s.SWD", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1718.         #endif
  1719.         else
  1720.     #endif  //#ifndef ISO9660_FILE_NOT_SHOW_EXTEND_NAME
  1721. psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1722.     }
  1723. #endif
  1724. #ifdef SUPPORT_MIDI
  1725. else if (pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI)
  1726. psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
  1727. #endif
  1728. #ifdef SUPPORT_FS_LONGNAME  //Maoyong 2004.06.24
  1729.     if( GetFileFullName(pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry) ){
  1730.         if( uScrollDispFilenameFlag ==1 ){
  1731.             uScrollDispFilenameFlag = SCROLL_SHOW_500MS_CNT;    //for first display
  1732.             FS_ScrollDispFileName();
  1733.         }else{
  1734.             psprintf(linebuf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, uFullFilename);
  1735.             FSGUI_UpdateInfoArea(linebuf);
  1736.         }
  1737.     }else   //can't read succesfully, just use the old way for file name
  1738. FSGUI_UpdateInfoArea(buf);
  1739.     #else   //#ifdef SUPPORT_FS_LONGNAME
  1740.         FSGUI_UpdateInfoArea(buf);
  1741.     #endif  //#ifdef SUPPORT_FS_LONGNAME
  1742. #ifdef FSGUI_NO_BLINK_SCROLL
  1743. strcpy(tempbuf,buf);
  1744. #endif
  1745. }
  1746. int PrepareForChangeFilePage(UINT16 iPage, UINT16 iSpecialTrk, UINT16 iDirect)
  1747. {
  1748. int i, j = 0;
  1749. UINT16 iFileFirst;
  1750. iFileFirst = AnchorFile(iPage * PER_PAGE);
  1751. if(iPage == pFsJpeg->File_Page_Count - 1) // the last page
  1752. pFsJpeg->File_Count = pFsJpeg->file_specify_in_dir - (pFsJpeg->File_Page_Count - 1) * PER_PAGE;
  1753. else
  1754. pFsJpeg->File_Count = PER_PAGE;
  1755. i = iFileFirst + pFsJpeg->first_mp3_entry;
  1756. while (j < PER_PAGE )
  1757. {
  1758. if (iso9660_file[i].type == pFsJpeg->gifsFuncBtn)
  1759. {
  1760. pFsJpeg->file_array[j] = i;
  1761. j++;
  1762. }
  1763. i++;
  1764. if(i>pFsJpeg->iso9660_file_cnt) break;//terry,2004/2/25 06:42PM
  1765. }
  1766. if(iDirect == 0)
  1767. {
  1768. // next page operation
  1769. pFsJpeg->file_will = 0;
  1770. }
  1771. else if(iDirect == 1)
  1772. {
  1773. // prev page operation
  1774. pFsJpeg->file_will = pFsJpeg->File_Count - 1;
  1775. }
  1776. else if(iDirect == 2)
  1777. {
  1778. // direct select operation
  1779. pFsJpeg->file_will = iSpecialTrk % PER_PAGE;
  1780. }
  1781. pFsJpeg->fsnav_trk_will = pFsJpeg->file_array[pFsJpeg->file_will] - pFsJpeg->first_mp3_entry;
  1782. refresh_file_page = 1;
  1783. if (pFsJpeg->File_Count != PER_PAGE)
  1784. {
  1785. for(i = pFsJpeg->File_Count; i < PER_PAGE; i++)
  1786. pFsJpeg->file_array[i] = 0; // for check whether flash file icon,panxing,2002-4-13
  1787. }
  1788. return 0;
  1789. }
  1790. //
  1791. // Base on fsnav_dir_now to prepare for when change directory(indexing to page-0 file-0).
  1792. // iDirect = 0 means: select next directory
  1793. // iDirect = 1 means: select prev directory
  1794. //
  1795. int FSGUI_PreChangeDir(UINT16 *iDir,UINT16 iDirect)
  1796. {
  1797. int done = 0;
  1798. #ifdef POWER_RESUME
  1799. UINT32 fsnav_trk_now = 0 ;
  1800. fsnav_trk_now = ReadSameMP3Para ( 1 ) ;
  1801. #endif   // POWER_RESUME , added by caiyh , 14:12 , Nov 5th , 2004
  1802. done =FSGUI_PreFindDir(iDir,iDirect);
  1803. CalcFileFirstPage(*iDir);
  1804. CalcDirNow(iDir);
  1805. #ifdef POWER_RESUME
  1806. if ( IsTheSameMP3 ( ) )
  1807. PrepareForChangeFilePage( fsnav_trk_now / PER_PAGE , 
  1808. fsnav_trk_now , 2 ) ;
  1809. // show the page for resuming , added by caiyh , 14:12 , Nov 5th , 2004
  1810. else
  1811. #endif   // POWER_RESUME , added by caiyh , 14:12 , Nov 5th , 2004
  1812. PrepareForChangeFilePage(0,0,0);
  1813. Will2Playing();
  1814. //refresh_file_page  = 1;
  1815. return done;
  1816. }
  1817. int FSGUI_PreFindDir(UINT16 *iDir,UINT16 iDirect)
  1818. {
  1819. int done = 0;
  1820. UINT16 old_mp3_dir = 0;
  1821. old_mp3_dir = *iDir;
  1822. while(!(iso9660_dir[*iDir].type & (0x01 << pFsJpeg->gifsFuncBtn)))
  1823. {
  1824. if(iDirect == 0)
  1825. {
  1826. if(*iDir < pFsJpeg->fsnav_dir_cnt - 1)
  1827. (*iDir)++;
  1828. else
  1829. {
  1830. // old_mp3_dir is the last directory include file specified style, panxing, 2002-1-22
  1831. done = 1;
  1832. break;
  1833. }
  1834. }
  1835. else
  1836. {
  1837. if(*iDir>0)
  1838. (*iDir)--;
  1839. else
  1840. {
  1841. // old_mp3_dir is the first directory include file specified style, panxing, 2002-1-22
  1842. done = 1;
  1843. break;
  1844. }
  1845. }
  1846. }
  1847. if(done)
  1848. {
  1849. // restore fsnav_dir_now, panxing, 2002-1-22
  1850. if(iDirect == 0)
  1851. *iDir = (old_mp3_dir - 1);
  1852. else
  1853. *iDir = (old_mp3_dir + 1);
  1854. refresh_dir_icon = 0;
  1855. }
  1856. return done;
  1857. }
  1858. //
  1859. // List directory item and clear refresh_dir_page
  1860. //
  1861. void DirList()
  1862. {
  1863. UINT16 i;
  1864. UINT16 j;
  1865. if (!refresh_dir_page)
  1866. return;
  1867. #ifdef FS_BMP_GUI
  1868.     FSGUI_ClearArea(FS_AREA_DIRITEM,PER_PAGE+1);
  1869. #elif defined(NEW_MP3_GUI)
  1870.      ClearRectArea(Rect[DIR_RECT], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, -1);//zhaoyanhua add
  1871.     #else
  1872.         ClearArea(FS_AREA_DIRITEM);
  1873.     #endif
  1874. i = pFsJpeg->dir_page_now * PER_PAGE;
  1875. j = 0;
  1876. while (j < pFsJpeg->Dir_Count && i < pFsJpeg->fsnav_dir_cnt)
  1877. {
  1878. if (iso9660_dir[i].dir > 0 ) {
  1879. ShowDirItem(j, iso9660_dir[pFsJpeg->dir_array[j]].name);
  1880. j++;
  1881. }
  1882. i++;
  1883. }
  1884. refresh_dir_page = 0;
  1885. }
  1886. //
  1887. // Calculate dir_page_now,dir_current,Dir_Count according to fsnav_dir_now
  1888. // and refresh_dir_page is determine
  1889. // dir_page_now: range=(0 ~ x)
  1890. // dir_current:  range=(0 ~ x)
  1891. // Dir_Count:    range=(1 ~ x)
  1892. //
  1893. void CalcDirNow(UINT16 *iDir)
  1894. {
  1895. int i;
  1896. int j = 0;
  1897. int seq = 0;
  1898. int first = 0;
  1899. old_dir_page = pFsJpeg->dir_page_now;
  1900. seq = antiAnchorDir(*iDir);
  1901. pFsJpeg->dir_page_now = seq / PER_PAGE;
  1902. seq = 0;
  1903. for (i = 0; i < pFsJpeg->fsnav_dir_cnt; i++)
  1904. {
  1905. if (iso9660_dir[i].type & (0x01 << pFsJpeg->gifsFuncBtn))
  1906. {
  1907. if(first == pFsJpeg->dir_page_now * PER_PAGE)
  1908. {
  1909. // Now seq is the first directory in this dir page, panxing, 2002-1-29
  1910. break;
  1911. }
  1912. first++;
  1913. }
  1914. seq++;
  1915. }
  1916. pFsJpeg->Dir_Count = 0;
  1917. j = 0;
  1918. // printf("dir_page_now = %d, first = %d, seq = %dn", pFsJpeg->dir_page_now,first,seq);
  1919. for (i = seq; i < pFsJpeg->fsnav_dir_cnt; i++)
  1920. {
  1921. if (iso9660_dir[i].type & (0x01 << pFsJpeg->gifsFuncBtn))
  1922. {
  1923. pFsJpeg->dir_array[j] = i;
  1924. if(i == *iDir)
  1925. pFsJpeg->dir_current = j;
  1926. j++;
  1927. }
  1928. if(j == PER_PAGE)
  1929. break;
  1930. }
  1931. pFsJpeg->Dir_Count = j;
  1932. //printf("old_dir_page = %d, dir_page_now = %dn", old_dir_page, pFsJpeg->dir_page_now);
  1933. if(old_dir_page != pFsJpeg->dir_page_now)
  1934. {
  1935. refresh_dir_page = 1;
  1936. refresh_dir_icon = 1;
  1937. }
  1938. return;
  1939. }
  1940. void FS_ForceReturn2Menu(void)//used when NEW_STYLE_SETUP
  1941. {
  1942. #ifdef NEW_STYLE_SETUP  //to return from setup state. zhaoyanhua add 2003-8-7 8:58
  1943. pFsJpeg->gifsState = FS_STATE_LIST;
  1944. play_state = VCD_STATE_MP3_FILELIST;
  1945. adv_search_time = 0;
  1946. video_slow = 0;
  1947. #ifdef MP3_LARGE_GUI
  1948. config_memeory(MEMORY_GRAPH_NTSC);
  1949. #else
  1950. config_memory(MEMORY_GRAPH_SMALL);
  1951. #endif
  1952. setup_tv_format(tv_format);
  1953.     #endif//NEW_STYLE_SETUP
  1954.     FSGUI_Menu();
  1955. pFsJpeg->gbfsSlide = 0;
  1956. //zhaoyanhua masked for NEW_MP3_GUI for NEW_STYLE_SETUP. 3-7-25 20:17
  1957. #if !(defined (NEW_MP3_GUI) || defined (FS_BMP_GUI))
  1958. pFsJpeg->gifsbPreview = 1; // Robert 20020715
  1959. refresh_file_page  = 1; // insure refresh dir page, panxing, 2002-1-22
  1960. refresh_dir_page  = 1;
  1961. #endif
  1962. pFsJpeg->gifsState = FS_STATE_LIST;
  1963. #if defined (NEW_MP3_GUI) || defined (FS_BMP_GUI)
  1964. //zhaoyanhua add 3-7-25 20:17
  1965.     if ((JPEG_Preview_drawed == JPEG_PREVIEW_IN_DIR_AREA ) )
  1966.     {
  1967.      JPEG_Preview_drawed = DIR_LIST_IN_DIR_AREA;
  1968.         pFsJpeg->gifsbPreview = 1;
  1969.         flagRefresh = 1;//note now state is refresh.
  1970.         refresh_dir_page  = 0;//when return to JPEG preview ,not show DIR.
  1971.         FileList();//to avoid the bug: when MENU/RETURN, can not show correctly in FILE AREA zhaoyanhua add 2004-1-12 18:09
  1972. }
  1973.     else
  1974.     {
  1975.      refresh_file_page   = 1;
  1976.         refresh_dir_page = 1;
  1977.         FSGUI_Refresh();
  1978. }
  1979. #else
  1980. FSGUI_Refresh();
  1981. #endif
  1982. }
  1983. void FSGUI_Return2Menu(void)
  1984. {
  1985.     if ((pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG) && (pFsJpeg->gifsState == FS_STATE_JPEG))
  1986.     {
  1987.         //set to normal display ratio/offset, Jeff 20030722
  1988.         reset_zoom_state();//return menu
  1989.         startup_vpp();
  1990.         //Maoyong added 2004-8-12 18:04 for initialization when define ZOOM_DIRECT_STOP_SLIDE, normally do seq play again
  1991.         #ifdef ZOOM_DIRECT_STOP_SLIDE
  1992.         jpg_slide_time = JPEG_SLIDE_TIME;
  1993.         #endif
  1994. #if defined (NEW_MP3_GUI) || defined (FS_BMP_GUI)
  1995.         ClearOsdMsg(2);
  1996.         pFsJpeg->gbfsSlide  = 0;
  1997.         pFsJpeg->gifsState  = FS_STATE_LIST;
  1998. #else
  1999. #if !defined(JPEG_SLIDE_SHOW_USE_PROG)
  2000. ClearOsdMsg(2);//nono 3-12-24 22:48 for PROG ON, it will turn off PROG MENU.
  2001. #endif
  2002. #endif
  2003.         AVD_ResetMediaStatus();
  2004.        #if defined(FALSE_POWER)&&defined(STOP_LOADER)//zhuyanfeng20041008
  2005. pFsJpeg->gifsbPreview = 0;
  2006. ShowTitle();
  2007.         #else
  2008.         FS_ForceReturn2Menu();
  2009. #endif
  2010.     }
  2011.     pFsJpeg->ControlArea = CNT_AREA_FILE;
  2012. }
  2013. #if !defined (FS_BMP_GUI)
  2014. void FSGUI_UpdateInfoArea(BYTE* strInfo)
  2015. {
  2016. #ifdef AUDIO_SHOW_SAVER
  2017.     if (bDisableGUI) return;
  2018. #endif
  2019. #ifdef NEW_MP3_GUI
  2020. #ifdef MONO_FSGUI   //mono FS GUI, axel 2003-12-29 23:26
  2021.     DrawRectCorner(Rect[PATH_RECT], 6,1,  1, DIR_AREA_BKGROUND_CRCB );
  2022. #else
  2023.     DrawRectCorner(Rect[PATH_RECT], 6,1, 40, DIR_AREA_BKGROUND_CRCB );
  2024. #endif
  2025. #ifdef MP3_LARGE_GUI
  2026. FSGUI_ShowString(fsArea[FS_AREA_PATHINFO].xStart+40,
  2027.         fsArea[FS_AREA_PATHINFO].yStart + 2,
  2028.         strInfo, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
  2029. #else
  2030.     FSGUI_ShowString(fsArea[FS_AREA_PATHINFO].xStart+INFO_X_OFFSET,
  2031.         Y1-18,
  2032.         strInfo, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
  2033. #endif
  2034. #else //NEW_MP3_GUI
  2035. FSGUI_FillFrameBuf(fsArea[FS_AREA_PATHINFO].xStart+INFO_X_OFFSET,fsArea[FS_AREA_PATHINFO].yStart,
  2036. fsArea[FS_AREA_PATHINFO].xSize,fsArea[FS_AREA_PATHINFO].ySize,
  2037. BK_GROUNDY,BK_GROUNDCRCB);
  2038. FSGUI_ShowString(fsArea[FS_AREA_PATHINFO].xStart+INFO_X_OFFSET,
  2039. Y1-18,
  2040. strInfo, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
  2041. #endif //#ifdef NEW_MP3_GUI
  2042. }
  2043. #else //#if !defined (FS_BMP_GUI)
  2044. /*
  2045.  * Description:
  2046.  *      Update the Info area about current dir and file.
  2047.  * INPUT:
  2048.  * The string infomation about current dir and file.
  2049.  * And it is decided by func FSGUI_CookFileItem()
  2050.  *Creater:
  2051.  * feeling
  2052.  *Date: