fsGUI_pub.c
资源名称:8202s.rar [点击查看]
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:153k
源码类别:
DVD
开发平台:
C/C++
- /**************************************************************
- ** FILE
- ** fsGUI_new.c
- **
- ** DESCRIPTION
- ** To collect the public function in fsGUI1.c and fsGUI_new.c
- **
- **
- ** Creator: Freyman
- ** Date: 2004-4-19 19:07
- ****************************************************************/
- #include "global.h"
- #include "func.h"
- #include "memmap.h"
- #include "util.h"
- #include "graph.h"
- #include "memcfg.h"
- #include "framebuf.h"
- #include "macro.h"
- #include "stc.h"
- #include "cfont.h"
- #include "vfdfunc.h"
- #include "osd.h"
- #include "image.h"
- #include "nesinit.h"
- #include "fs96602.h"
- #include "fsNAV.h"
- #include "fsGUI.h"
- #include "fsGUI1.h"
- #include "user_if.h"
- #include "fsGUIX.h"
- #ifdef POWER_RESUME
- extern UINT32 ReadSameMP3Para ( UINT8 para ) ;
- extern UINT8 IsTheSameMP3 ( void ) ;
- #endif // POWER_RESUME , added by caiyh , 14:12 , Nov 5th , 2004
- #ifdef JPG_EFFECT
- #include "jpegeffect.h"
- #endif
- #ifdef FS_BMP_GUI
- #include "fsGUI_BmpUI.h"
- #endif
- ///////////////////////////////////////////////////////////////////
- //define main menu look-and-feel style
- //Notes : to avoid blinking (when white/black line displaying in n/n+1 line, with interlace mode)
- // SHADOW_WID , LIGHT_WID should >=2
- // X1, Y1, Y3 should be 2*n
- //wanghaoying 2004-8-5 11:32 move to fsGUI1.h
- #ifdef NEW_MP3_GUI
- //for draw corner.
- const BYTE CornerLT[6][6] = {
- {0,0,0,0,1,1},
- {0,0,1,1,2,2},
- {0,1,1,2,2,2},
- {0,1,2,2,2,2},
- {1,2,2,2,2,2},
- {1,2,2,2,2,2},
- };// Left_TOP 1/4 circle
- const BYTE CornerRT[6][6] = {
- {3,1,1,0,0,0},
- {2,3,1,1,0,0},
- {2,2,3,1,1,0},
- {2,2,2,1,1,1},
- {2,2,2,2,1,1},
- {2,2,2,2,1,1},
- };// Right_Left 1/4 circle
- const BYTE CornerLB[6][6] = {
- {1,2,2,2,2,2},
- {1,2,2,2,2,2},
- {0,1,2,2,2,2},
- {0,1,1,2,2,2},
- {0,0,1,1,2,2},
- {0,0,0,0,1,1},
- };// Right_Top 1/4 circle
- const BYTE CornerRB[6][6] = {
- {2,2,2,2,2,1},
- {2,2,2,2,2,1},
- {2,2,2,2,1,0},
- {2,2,2,1,1,0},
- {2,2,1,1,0,0},
- {1,1,0,0,0,0},
- }; // Right_Bottom 1/4 circle
- //for draw RECT. zhaoyanhua add 3-7-25 15:01
- #ifdef MP3_LARGE_GUI
- const BTNAREA Rect[] ={
- //path Rect
- {120, 50,
- 540, 28 },
- //background Rect
- { 0, 0,
- 720, 470},
- //avoid the bug :when VGA,there is a red line in background.
- //zhaoyanhua modify 2003-12-5 13:17
- //{ 0, 0,
- // 352, 288 },
- //Dir Rect
- { 50, 90,
- 295, 300},
- //File Rect
- {365, 90,
- 295, 300},
- //preview Rect .it is to clear the previous JPEG.
- { //30, 80,
- //130, 120
- 72, 100,
- 245, 280,
- },
- //JPEG size When at preview state.
- {
- //40, 100,//x must be 8*x, //y must be 2*x
- //120, 90
- 72, 100,
- 245, 280,
- }
- };
- #else
- const BTNAREA Rect[] ={
- //path Rect
- { 51, 40,
- 280, 17 },
- //background Rect
- { 0, 0,
- 352, 280},
- //Dir Rect
- { 24, 65,
- 150, 170},
- //File Rect
- { 178, 65,
- 150, 170},
- //preview Rect .it is to clear the previous JPEG.
- {
- 30, 66, //Jeff update, 20030818
- 130, 168
- },
- //JPEG size When at preview state.
- {
- //x must be 8*x, //y must be 2*x
- 40, 70, //Jeff update, 20030818
- 120, 160
- },
- #ifdef SUPPORT_MULTI_PARTITION//liweihua 2004-8-26
- //multiple HDD
- {
- 32, 65,
- 280, 170
- },
- #endif
- #ifdef FAT_FILE_MODE
- //Disk title rect
- {
- 24+5, 34+15,
- 150, 22
- },
- //Card title rect
- {
- 178+5, 34+15,
- 150, 22
- },
- //Warning rect
- {
- 24, 240,
- 304, 27
- },
- //Disk icon rect
- {
- 24, 65,
- 150, 170
- },
- //card icon rect
- {
- 178, 65,
- 150, 50//liweihua mod 2004-11-2
- },
- //disk item rect
- {
- 24+8, 65,
- 150-8, 170 //liweihua mod 2004-11-2
- },
- #endif
- #ifdef FILE_MODE_WRITE //sunzhh 20041225
- //SRCE title rect
- {
- 24+5, 34+15,
- 150, 22
- },
- //DEST title rect
- {
- 178+5, 34+15,
- 150, 22
- },
- //infomation rect
- { 24, 25,
- 304, 17 },
- #endif
- };
- #endif
- #define LT 1//CornerLT
- #define LB 2//CornerRT
- #define RT 3//CornerLB
- #define RB 4//CornerRB
- #endif//NEW_MP3_GUI
- #ifdef FS_BMP_GUI //suqiaoli 2004-6-11
- //wanghaoying 2004-8-5 11:32 moved the definations to fsGUI1.h
- const BTNAREA fsArea[] =
- {
- // background area
- { 0, 0, //x, y start
- 720, 480 }, //x-size, y-size
- // dir icon area
- { DIR_AREA_XSTART + 11, DIR_AREA_YSTART + 15,
- FS_DIRICON_XLEN, FS_FILELIST_YSTEP },
- // dir item area
- { DIR_AREA_XSTART + 5, DIR_AREA_YSTART + 12 ,
- FS_DIRITEM_XLEN, PER_PAGE * FS_FILELIST_YSTEP },
- // file icon area
- { FILE_AREA_XSTART + 11, FILE_AREA_YSTART +15 ,
- FS_FILEICON_XLEN, FS_FILELIST_YSTEP },
- // file item area
- { FILE_AREA_XSTART + 5, FILE_AREA_YSTART + 12 ,
- FS_FILEITEM_XLEN, PER_PAGE * FS_FILELIST_YSTEP },
- // file scroll bar area
- { FS_DIRSCROLLLEN_XSTART + LEN_DIRFILE , FS_DIESCROLLLEN_YSTART,
- FS_DIRSCROLLLEN_XSIZE, FS_DIRSCROLLLEN_YSIZE },
- // file move bar area
- { FS_DIRSCROLLLEN_XSTART + LEN_DIRFILE + 5, FS_DIESCROLLLEN_YSTART + 7 ,
- FS_DIRSCROLLLEN_XSIZE - 10, FS_DIRSCROLLLEN_YSIZE - 14 },
- // path info area
- { 132, 84,
- 300, 18 },
- // preview area
- { DIR_AREA_XSTART + 28, DIR_AREA_YSTART ,//120+16, //Jeff update, 20030818
- 210, 280},
- //button title area
- { 100, 45,
- 0, 0 },
- //button title background area
- {
- 100, 27,
- 100, 1 },
- //path background
- { 89, 76,
- 546, 1 },
- //button background
- { 73, 27,
- 646, 1 },
- // dir scroll bar area
- { FS_DIRSCROLLLEN_XSTART , FS_DIESCROLLLEN_YSTART,
- FS_DIRSCROLLLEN_XSIZE, FS_DIRSCROLLLEN_YSIZE },
- // dir move bar area
- { FS_DIRSCROLLLEN_XSTART + 5, FS_DIESCROLLLEN_YSTART + 7 ,
- FS_DIRSCROLLLEN_XSIZE - 10, FS_DIRSCROLLLEN_YSIZE - 14 },
- };
- #elif defined(MP3_LARGE_GUI)
- const BTNAREA fsArea[] = //20020731
- {
- // background area
- { 0, 0, //x, y start
- 720, 480 }, //x-size, y-size
- // dir icon area
- { FS_DIRLIST_XSTART - 60, FS_DIRLIST_YSTART,
- 32, PER_PAGE*FS_FILELIST_YSTEP },
- // dir item area
- { FS_DIRLIST_XSTART-20 , FS_DIRLIST_YSTART, //Jeff 20020518
- X1 - FS_DIRLIST_XSTART + 20, PER_PAGE * FS_FILELIST_YSTEP },
- // file icon area
- { FS_FILEICON_XSTART, FS_DIRLIST_YSTART,
- 32, 24 },
- // file item area
- { FS_FILEICON_XSTART + 36, FS_DIRLIST_YSTART,
- 240, PER_PAGE * FS_FILELIST_YSTEP },
- // scroll bar area
- { FILE_AREA_XSTART+FILE_AREA_XLEN- ARROW_SIZE-2-1, FS_DIRLIST_YSTART ,
- ARROW_SIZE, PER_PAGE * FS_FILELIST_YSTEP },
- // move bar area
- { FILE_AREA_XSTART+FILE_AREA_XLEN -ARROW_SIZE-2-1, FS_DIRLIST_YSTART +ARROW_SIZE,
- ARROW_SIZE, PER_PAGE * FS_FILELIST_YSTEP - ARROW_SIZE*2 },
- // path info area
- { 120, 50,
- 540, 28 },
- #ifdef JPG_EFFECT
- //preview help message area
- {
- 60, 10,
- 600, 28 },
- #else
- // preview area
- { 32, 236, // xStart = multiple of 8, yStart = multiple of 2
- 48, 36 }, // xSize : ySize = 4 : 3
- #endif
- // button area
- { 400, 400,
- 150, 48 },
- };
- #else
- const BTNAREA fsArea[] =
- {
- // background area
- { 0, 0, //x, y start
- 352, 288 }, //x-size, y-size
- // dir icon area
- { FS_DIRLIST_XSTART - 26, FS_DIRLIST_YSTART,
- 20, PER_PAGE*FS_FILELIST_YSTEP },
- //Maoyong 2004.06.23 HL too long will cause GUI bug when chang dir page use UP/DOWN.
- #if defined (SUPPORT_CHINESE_FONT) || defined (SUPPORT_JOLIET_FORMAT)
- // dir item area
- { FS_DIRLIST_XSTART - 5, FS_DIRLIST_YSTART,
- X1 - FS_DIRLIST_XSTART + 6, PER_PAGE * FS_FILELIST_YSTEP },
- #else
- { FS_DIRLIST_XSTART - 5, FS_DIRLIST_YSTART,
- X1 - FS_DIRLIST_XSTART, PER_PAGE * FS_FILELIST_YSTEP },
- #endif
- #if defined(FAT_FILE_MODE)||defined(FILE_MODE_WRITE)//liweihua add 2004-11-2//sunzhh 2005-1-13
- // file icon area
- { FS_FILEICON_XSTART, FS_DIRLIST_YSTART,
- 12+4, 12 },
- #else
- // file icon area
- { FS_FILEICON_XSTART, FS_DIRLIST_YSTART,
- 12, 12 },
- #endif//#ifdef FAT_FILE_MODE
- #ifdef NEW_MP3_GUI
- #if defined(FAT_FILE_MODE)||defined(FILE_MODE_WRITE)//liweihua add 2004-11-2//sunzhh 2005-1-13
- // file item area
- { FS_FILEICON_XSTART + 15 +2+4, FS_DIRLIST_YSTART,
- 120, PER_PAGE * FS_FILELIST_YSTEP },
- #else
- // file item area
- { FS_FILEICON_XSTART + 15 +2, FS_DIRLIST_YSTART,
- 120, PER_PAGE * FS_FILELIST_YSTEP },
- #endif//#ifdef FAT_FILE_MODE
- // scroll bar area
- { FILE_AREA_XSTART+FILE_AREA_XLEN- ARROW_SIZE-2-1, FS_DIRLIST_YSTART - 1,
- ARROW_SIZE+2, PER_PAGE * FS_FILELIST_YSTEP },
- // move bar area
- { FILE_AREA_XSTART+FILE_AREA_XLEN -ARROW_SIZE-1-1, FS_DIRLIST_YSTART +ARROW_SIZE,
- ARROW_SIZE, PER_PAGE * FS_FILELIST_YSTEP - 2 - ARROW_SIZE*2 },
- #else
- // file item area
- { FS_FILEICON_XSTART + 15, FS_DIRLIST_YSTART,
- 120, PER_PAGE * FS_FILELIST_YSTEP },
- // scroll bar area
- { 320, FS_DIRLIST_YSTART - 1,
- 8, PER_PAGE * FS_FILELIST_YSTEP },
- // move bar area
- { 321, FS_DIRLIST_YSTART,
- 6, PER_PAGE * FS_FILELIST_YSTEP - 2 },
- #endif
- // path info area
- #ifdef HANYANG_FS_LONGNAME
- { 14, Y1 - 18,
- 200, 18 },
- #else
- { 25, Y1 - 18,
- 300, 18 },
- #endif
- #ifdef NEW_MP3_GUI//nono 2004-4-29 23:28
- //preview help message area
- {
- 60, 20,
- 260, 16 },
- #else
- // preview area
- { 32, 236, // xStart = multiple of 8, yStart = multiple of 2
- 48, 36 }, // xSize : ySize = 4 : 3
- #endif
- #ifdef FILE_MODE_WRITE //sunzhh 20041225
- // button area
- { 90, 245,
- 82, 25 },
- #else
- // button area
- { 180, 245,
- 82, 25 },
- #endif
- #ifdef FAT_FILE_MODE//liweihua 2004-10-9 21:59
- // disk icon area
- { FS_DIRLIST_XSTART - 26-8, FS_DIRLIST_YSTART,
- 20, PER_PAGE*FS_FILELIST_YSTEP },
- // disk list area
- //Maoyong 2004.06.23 HL too long will cause GUI bug when chang dir page use UP/DOWN.
- #if defined (SUPPORT_CHINESE_FONT) || defined (SUPPORT_JOLIET_FORMAT)
- { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
- X1 - FS_DIRLIST_XSTART + 6, PER_PAGE * FS_FILELIST_YSTEP },
- #else
- { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
- X1 - FS_DIRLIST_XSTART, PER_PAGE * FS_FILELIST_YSTEP },
- #endif
- //warning message area
- {
- 24+5, 240+5,
- 304-5, 27-5
- },
- //dir slot area
- {
- FS_DIRSCROLLLEN_XSTART , FS_DIESCROLLLEN_YSTART,
- FS_DIRSCROLLLEN_XSIZE, FS_DIRSCROLLLEN_YSIZE
- },
- //dir movebar area
- {
- FS_DIRSCROLLLEN_XSTART + 5, FS_DIESCROLLLEN_YSTART + 7 ,
- FS_DIRSCROLLLEN_XSIZE - 10, FS_DIRSCROLLLEN_YSIZE - 14
- },
- #endif
- //#endif
- #ifdef FILE_MODE_WRITE//sunzhh 2004-12-25
- // disk icon area
- { FS_DIRLIST_XSTART - 26-8, FS_DIRLIST_YSTART,
- 20, PER_PAGE*FS_FILELIST_YSTEP },
- // disk list area
- //Maoyong 2004.06.23 HL too long will cause GUI bug when chang dir page use UP/DOWN.
- #if defined (SUPPORT_CHINESE_FONT) || defined (SUPPORT_JOLIET_FORMAT)
- { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
- X1 - FS_DIRLIST_XSTART + 6, PER_PAGE * FS_FILELIST_YSTEP },
- #else
- { FS_DIRLIST_XSTART - 5-8, FS_DIRLIST_YSTART,
- X1 - FS_DIRLIST_XSTART, PER_PAGE * FS_FILELIST_YSTEP },
- #endif
- //warning message area
- { 30, 26,
- 304, 17 },
- //dir slot area
- {
- FS_DIRSCROLLLEN_XSTART , FS_DIESCROLLLEN_YSTART,
- FS_DIRSCROLLLEN_XSIZE, FS_DIRSCROLLLEN_YSIZE
- },
- //dir movebar area
- {
- FS_DIRSCROLLLEN_XSTART + 5, FS_DIESCROLLLEN_YSTART + 7 ,
- FS_DIRSCROLLLEN_XSIZE - 10, FS_DIRSCROLLLEN_YSIZE - 14
- },
- #endif
- };
- #endif
- const UINT8 cluty_fsgui[2] =
- {
- YELLOW_Y,
- BLACK_Y,
- };
- const UINT16 clutc_fsgui[2] =
- {
- YELLOW_CRCB,
- BLACK_CRCB,
- };
- #ifdef APEX_MP3_ICON
- const BYTE mp3fileIcon[24][72] =
- {
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- {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, },
- };
- #endif//APEX_MP3_ICON
- ////////////////////////////module global functions for internal reference/////////////////////////
- //void DirList();
- //void FileList(void);
- void DrawFolderIcon(int x, int y, BYTE type);
- void ShowDirItem(int iItem, const char *s);
- //void FSShowDirIcon(void);
- //void ShowFileIcon(void);
- void DrawScroll(void);
- void ClearArea(UINT16 iIndex);
- void SelectHL();
- void ShowButtonHL(int x, int y,int len);
- void FSGUI_FlashFileIcon(int iFlash);
- #ifdef NEW_MP3_GUI
- void ShowHL(void);
- void DrawFileIconX(int x, int y, int type, int mono);
- #define DrawFileIcon(x,y,t) DrawFileIconX(x,y,t,0)
- #elif defined FS_BMP_GUI//zhaoyanhua add 2004-6-8 10:15
- void ShowHL(void);
- void DrawFileIcon(int x, int y, int type);
- UINT16 file_focus_y = FS_FONTCOLOR_FILE_Y;
- UINT16 file_focus_CrCb = FS_FONTCOLOR_FILE_CrCb;
- #else
- void ShowHL(int x, int y,int len,int high);
- void DrawFileIcon(int x, int y, int type);
- #endif
- UINT16 CountSpecifyFile(int iDir);
- //int PrepareForChangeFilePage(UINT16 iPage, UINT16 iSpecialTrk,UINT16 iDirect);
- //void CalcDirNow(UINT16 *iDir);
- ///////////for MP3_Lyrics_Drawed////////////////////
- #ifdef MP3_TXT_DISPLAY
- extern UINT16 MP3TotalNo;
- extern BYTE MP3_Lyrics_Drawed;
- extern void ShowLyricsWhileHL(void);
- #endif
- ///////////////////////////////////////////////////////////////////////
- #ifdef NEW_MP3_GUI
- void DrawArrow(int xStart, int yStart, BYTE updown);
- void DrawRectCorner(BTNAREA Rect, int CornerRad, BYTE updown, UINT8 step, UINT16 RegionColor_C);
- void ClearRectArea(BTNAREA Rect, UINT16 RectColorStep,UINT16 RegionColor_C,int iIndex,int iItem);
- void ShowPlayFrame(int x, int y,int len,int high);
- void ShowCurrentDirPlaying();
- void ShowCurrentFilePlaying();
- #elif defined (FS_BMP_GUI)//zhaoyanhua 2004-6-8 10:15
- //temp has the same function with NEW_MP3_GUI.
- //we will modify the functions later.
- void DrawRectCorner(BTNAREA Rect, int CornerRad, BYTE updown, UINT8 step, UINT16 RegionColor_C);
- void ShowPlayFrame(int x, int y,int len,int high);
- void ShowCurrentDirPlaying();
- void ShowCurrentFilePlaying();
- #endif
- ///////////////////////////////////////////////////////////////////////
- #ifdef APEX_MP3_ICON
- void DrawMp3ApexIcon(int x, int y);
- #endif//#ifdef APEX_MP3_ICON
- //======================================================================
- #ifdef FSGUI_NO_BLINK_SCROLL
- void MoveScroll(UINT16 , INT8);
- #else
- void MoveScroll(UINT16);
- #endif
- #ifdef HANYANG_LR_CHANGE_PAGE
- //When enter in DIR area, right to file area
- void FSGUI_Dir2FileArea(void);
- void FSGUI_File2DirArea(void);
- #endif
- //module global variables for internal reference
- /*
- UINT16 Hl_x;
- UINT16 Hl_y;
- UINT16 Hl_len;
- UINT16 Hl_high;
- UINT16 Hl_x_btn;
- UINT16 Hl_y_btn;
- UINT16 Hl_len_btn;
- UINT16 old_file_page; // index of current page
- UINT16 old_dir_page;
- UINT16 refresh_file_page;
- UINT16 refresh_dir_page;
- UINT16 refresh_dir_icon;
- */
- #ifdef AUDIO_SHOW_SAVER
- BYTE bDisableGUI = 0;
- #endif
- //David add 2004-01-05
- #ifdef FSGUI_NO_BLINK_SCROLL
- BYTE up_down_done=0;
- char tempbuf[22];
- #define SCROLLBAR_UP 1
- #define SCROLLBAR_REFRESH 0
- #define SCROLLBAR_DOWN -1
- #endif
- extern BYTE jpg_break_up_down; //Maoyong 2004.04.19
- //===================================================================
- //zhaoyanhua new add 3-7-25 15:16
- //for HL
- #if defined (NEW_MP3_GUI) || defined (FS_BMP_GUI)
- int fsnav_dir_HL =0; //save the current playing dir
- int fsnav_file_HL=0; //save the current playing file
- int HL_Width =0, HL_Heighth = HL_RECT_HEIGHTH;//HL width and heighth.
- int old_ControlArea=0; //record last ControlArea.
- int HL_show=0;//record HL .
- //
- // a flag to avoid blinkling when show JPEG.
- // when show the first JPEG , need draw the whole rectangle.
- // But the following JPEG will only clear the part of the rectangle.
- BYTE JPEG_Preview_drawed = DIR_LIST_IN_DIR_AREA;
- BYTE flagRefresh;
- #endif
- //===================================================================
- void DrawRect(int x, int y, int xSize, int ySize, UINT16 selected, UINT16 color_Y, UINT16 color_CrCb)
- {
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- FSGUI_FillFrameBuf(x, y, xSize, ySize, color_Y, color_CrCb);
- if (selected == 1)
- {
- // rect selected
- FSGUI_FillFrameBuf(x, y, xSize, DEMENSION_SIZE, BLACK_Y, BLACK_CRCB);
- FSGUI_FillFrameBuf(x, y, DEMENSION_SIZE, ySize, BLACK_Y, BLACK_CRCB);
- FSGUI_FillFrameBuf(x + xSize - DEMENSION_SIZE, y + DEMENSION_SIZE, DEMENSION_SIZE, ySize - DEMENSION_SIZE, WHITE_Y, WHITE_CRCB);
- FSGUI_FillFrameBuf(x + DEMENSION_SIZE, y + ySize - DEMENSION_SIZE, xSize - DEMENSION_SIZE, DEMENSION_SIZE ,WHITE_Y, WHITE_CRCB);
- }
- else
- {
- // rect release
- FSGUI_FillFrameBuf(x, y, xSize, DEMENSION_SIZE, WHITE_Y, WHITE_CRCB);
- FSGUI_FillFrameBuf(x, y, DEMENSION_SIZE, ySize, WHITE_Y, WHITE_CRCB);
- FSGUI_FillFrameBuf(x + xSize - DEMENSION_SIZE, y, DEMENSION_SIZE, ySize, BLACK_Y, BLACK_CRCB);
- FSGUI_FillFrameBuf(x, y + ySize - DEMENSION_SIZE, xSize ,DEMENSION_SIZE ,BLACK_Y, BLACK_CRCB);
- }
- }
- #if !defined(FS_BMP_GUI)&& !defined(MP3_LARGE_GUI)
- void DrawButton(void)
- {
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- #ifdef APEX_MP3_ICON
- DrawMp3ApexIcon(fsArea[FS_AREA_BUTTON].xStart -90, fsArea[FS_AREA_BUTTON].yStart );
- #endif
- //draw MP3 icon
- if (pFsJpeg->gifsMP3Count)
- {
- #ifdef MP3_NOICON //caohui 2004-4-23 06:36
- DrawRect(fsArea[FS_AREA_BUTTON].xStart+40, fsArea[FS_AREA_BUTTON].yStart-205,
- 50, 17,
- pFsJpeg->gifsFuncBtn == FS_FUNC_MP3 ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- #else
- DrawRect(fsArea[FS_AREA_BUTTON].xStart, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- pFsJpeg->gifsFuncBtn == FS_FUNC_MP3 ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- #endif
- }
- else
- {
- #ifdef MP3_NOICON //caohui 2004-4-23 06:36
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+48, fsArea[FS_AREA_BUTTON].yStart-205,
- 50, 17,
- BK_GROUNDY, BK_GROUNDCRCB);
- #else
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- BK_GROUNDY, BK_GROUNDCRCB);
- #endif
- }
- #ifdef MP3_NOICON //2004-4-17 01:05张宇P
- strcpy(linebuf, "MP3");
- FSGUI_ShowString(fsArea[FS_AREA_BUTTON].xStart + 50,
- fsArea[FS_AREA_BUTTON].yStart -204,
- linebuf, FS_FONTCOLOR_FILE_Y1, FS_FONTCOLOR_FILE_CrCb1);
- #else
- DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2);
- #endif
- #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG//nono 20031018
- if (pFsJpeg->gifsJPEGCount)
- {
- #endif
- //draw JPEG icon
- if (pFsJpeg->gifsJPEGCount)
- {
- #ifdef MP3_NOICON //caohui 2004-4-23 06:36
- {
- DrawRect(fsArea[FS_AREA_BUTTON].xStart + 92, fsArea[FS_AREA_BUTTON].yStart-205, 50, 17,
- pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- }
- #else
- {
- 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);
- }
- #endif
- }
- else
- {
- #ifdef MP3_NOICON //caohui 2004-4-23 06:36
- {
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 92, fsArea[FS_AREA_BUTTON].yStart,
- 50, 15,
- BK_GROUNDY, BK_GROUNDCRCB);
- }
- #else
- {
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 27, fsArea[FS_AREA_BUTTON].yStart, 25, 25, BK_GROUNDY, BK_GROUNDCRCB);
- }
- #endif
- }
- #ifdef MP3_NOICON //2004-4-17 01:07张宇P
- psprintf(linebuf, "JPEG");//, "M", s);
- FSGUI_ShowString(fsArea[FS_AREA_BUTTON].xStart + 92+4,
- fsArea[FS_AREA_BUTTON].yStart -204,
- linebuf, FS_FONTCOLOR_FILE_Y1, FS_FONTCOLOR_FILE_CrCb1);
- #else
- DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 33, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_JPEGBUTTON - 2);
- #endif
- #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG//nono 20031018
- }//if (pFsJpeg->gifsJPEGCount)
- #endif
- #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
- #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG//nono 20031018
- if (pFsJpeg->gifsGAMECount)
- #endif
- {
- //draw GAME icon
- if (pFsJpeg->gifsGAMECount)
- {
- DrawRect(fsArea[FS_AREA_BUTTON].xStart + 54,fsArea[FS_AREA_BUTTON].yStart, 25, 25,
- pFsJpeg->gifsFuncBtn == FS_FUNC_GAME? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- }
- else
- {
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 54, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- BK_GROUNDY, BK_GROUNDCRCB);
- }
- DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_GAMEBUTTON - 2);
- }//if (pFsJpeg->gifsGAMECount)
- #endif//#ifdef SUPPORT_NESGAME
- #ifdef SUPPORT_FILE_SYSTEM_MODE
- #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
- #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG
- if (pFsJpeg->gifsOtherCount)
- #endif
- {
- if (pFsJpeg->gifsOtherCount)
- {
- DrawRect(fsArea[FS_AREA_BUTTON].xStart + 81, fsArea[FS_AREA_BUTTON].yStart, 25, 25,
- pFsJpeg->gifsFuncBtn == FS_FUNC_OTHER? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- }
- else
- {
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 81, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- BK_GROUNDY, BK_GROUNDCRCB);
- }
- DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
- }//if (pFsJpeg->gifsOtherCount)
- #else//#ifdef SUPPORT_NESGAME
- #ifdef HJ_APEX_ONLY_SHOW_MP3_ICON_WHEN_NO_JPG
- if (pFsJpeg->gifsOtherCount)
- #endif
- {
- if (pFsJpeg->gifsOtherCount)
- {
- DrawRect(fsArea[FS_AREA_BUTTON].xStart + 54, fsArea[FS_AREA_BUTTON].yStart, 25, 25,
- pFsJpeg->gifsFuncBtn == FS_FUNC_OTHER? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- }
- else
- {
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 54, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- BK_GROUNDY, BK_GROUNDCRCB);
- }
- DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
- }//if (pFsJpeg->gifsOtherCount)
- #endif//#ifdef SUPPORT_NESGAME
- #endif//#ifdef SUPPORT_FILE_SYSTEM_MODE
- #if defined(SUPPORT_MIDI)&&defined(SHOW_MIDI_ICON)//axel 2004/8/8
- #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
- if (pFsJpeg->gifsMidiCount)
- {
- DrawRect(fsArea[FS_AREA_BUTTON].xStart + 108, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- }
- else
- {
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 108, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- BK_GROUNDY, BK_GROUNDCRCB);
- }
- DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 114, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
- #else
- if (pFsJpeg->gifsMidiCount)
- {
- DrawRect(fsArea[FS_AREA_BUTTON].xStart + 81, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
- }
- else
- {
- FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 108, fsArea[FS_AREA_BUTTON].yStart,
- 25, 25,
- BK_GROUNDY, BK_GROUNDCRCB);
- }
- DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
- #endif
- #endif
- return;
- }
- #endif //#if !defined(FS_BMP_GUI)&& !defined(MP3_LARGE_GUI)
- #include "fsgui_icon_discx.inc"
- #if !defined (FS_BMP_GUI)
- void FSGUI_RotateDiscIcon(int iRotate)
- {
- #ifdef PMP_UI//liweihua 2005-1-5
- int x = fsArea[FS_AREA_DIRICON].xStart + 610;
- #else
- int x = fsArea[FS_AREA_DIRICON].xStart;
- #endif
- int y = Y1 - 17;
- //wanghaoying 2004-8-3 11:40, different defination different position.
- #ifdef MP3_LARGE_GUI
- x = x + 20;
- y = y - 19;
- #endif
- static const UINT8 cluty[2][4] = {
- {BK_GROUNDY, BLACK_Y, YELLOW_Y, RED_Y},
- {BK_GROUNDY, BLACK_Y, RED_Y, YELLOW_Y},
- };
- static const UINT16 clutc[2][4] = {
- {BK_GROUNDCRCB, BLACK_CRCB, YELLOW_CRCB, RED_CRCB},
- {BK_GROUNDCRCB, BLACK_CRCB, RED_CRCB, YELLOW_CRCB},
- };
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- if (iRotate) iRotate=1;
- FSGUI_DrawIcon(x, y, ICON_DiscX, cluty[iRotate], clutc[iRotate], 0);
- }
- #else //#if !defined (FS_BMP_GUI)
- /*
- * Description:
- * Draw all rotate disc 2 icons
- * INPUT:
- * To change the iRotate factor in polling_mp3(),
- * It decides to show different icons each time,so it looks like rotating the icon.
- *Creater:
- * feeling
- *Date: 2004-06-08
- * Update : zhaoyanhua 2004-6-28 14:51
- *
- */
- extern void FSGUI_DrawReverseBmp(UINT16 xStart, UINT16 yStart, BYTE iLayoutIndex, BYTE iMode);
- void FSGUI_RotateDiscIcon(int iRotate)
- {
- BYTE iBmpIndex = 0;
- switch(iRotate)
- {
- case 0:
- iBmpIndex = LAY_ANIMATION1;
- FSGUI_LayoutBmp(iBmpIndex);
- break;
- case 1:
- iBmpIndex = LAY_ANIMATION2;
- FSGUI_DrawReverseBmp(
- fsArea[FS_AREA_PATHINFO].xStart - 33,
- fsArea[FS_AREA_PATHINFO].yStart,
- iBmpIndex,1);
- break;
- case 2:
- iBmpIndex = LAY_ANIMATION1;
- FSGUI_DrawReverseBmp(
- fsArea[FS_AREA_PATHINFO].xStart - 33,
- fsArea[FS_AREA_PATHINFO].yStart,
- iBmpIndex,1);
- break;
- case 3:
- iBmpIndex = LAY_ANIMATION2;
- FSGUI_LayoutBmp(iBmpIndex);
- break;
- }
- }
- #endif //#if !defined (FS_BMP_GUI)
- void FSGUI_FlashFileIcon(int iFlash)
- {
- if (pFsJpeg->fsnav_trk_now == (pFsJpeg->file_array[pFsJpeg->file_current] - pFsJpeg->first_mp3_entry))
- {
- if (iFlash)
- {
- int x = fsArea[FS_AREA_FILEICON].xStart;
- int y = fsArea[FS_AREA_FILEICON].yStart + FS_FILELIST_YSTEP * pFsJpeg->file_current;
- int icon = pFsJpeg->gifsFuncBtn - 1;
- DrawFileIcon(x, y, icon);
- }
- else
- {
- #ifdef NEW_MP3_GUI
- ClearRectArea( Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB, FS_AREA_FILEICON, -1);
- #elif defined FS_BMP_GUI
- //FSGUI_ClearArea(FS_AREA_FILEICON,PER_PAGE + 1);
- #else
- ClearArea(FS_AREA_FILEICON);
- #endif
- }
- }
- }
- void ShowFileIcon(void)
- {
- int i = 0;
- if (refresh_file_page == 1)
- {
- #ifdef FS_BMP_GUI
- FSGUI_ClearArea(FS_AREA_FILEICON,PER_PAGE+1);
- #elif defined(NEW_MP3_GUI)
- ClearRectArea(Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB,FS_AREA_FILEICON, -1 );
- #else
- ClearArea(FS_AREA_FILEICON);
- #endif
- }
- for (i = 0; i < pFsJpeg->File_Count ; i++)
- {
- DrawFileIcon(fsArea[FS_AREA_FILEICON].xStart,
- (fsArea[FS_AREA_FILEICON].yStart + FS_FILELIST_YSTEP * i),
- pFsJpeg->gifsFuncBtn - 1);
- }
- }
- void FSShowDirIcon(void)
- {
- int i = 0;
- #ifdef FS_BMP_GUI
- if ( (refresh_dir_page == 1)||(refresh_dir_icon == 1))
- FSGUI_ClearArea(FS_AREA_DIRICON,PER_PAGE + 1);
- #else
- if ((!refresh_dir_page) && (!refresh_dir_icon))
- return;
- #if defined(NEW_MP3_GUI)
- ClearRectArea(Rect[DIR_RECT], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRICON,-1);
- #else
- ClearArea(FS_AREA_DIRICON);
- #endif
- #endif
- for (i = 0; i < pFsJpeg->Dir_Count ; i++)
- {
- BYTE mode;
- if (pFsJpeg->dir_array[i] != pFsJpeg->fsnav_dir_now)
- mode = 0;
- else
- mode = 1;
- DrawFolderIcon(fsArea[FS_AREA_DIRICON].xStart, (FS_DIRLIST_YSTART + FS_FILELIST_YSTEP * i), mode);
- }
- refresh_dir_icon = 0;
- }
- #ifdef APEX_MP3_ICON
- void DrawMp3ApexIcon(int x, int y)
- {
- int i, j;
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- for (i=0; i<24; i++) {
- for (j=0; j<72; j++) {
- //if ( fileIcon[type][i][j] == 0xff) continue;
- FSGUI_DrawPixel(
- x+j, y+i,
- RGB8_Y[ mp3fileIcon[i][j] ],
- RGB8_CrCb[ mp3fileIcon[i][j] ]
- );
- }
- }
- }
- #endif//#ifdef APEX_MP3_ICON
- void FSShowFileItem(int iItem, const char *s)
- {
- #ifdef MP3_TXT_DISPLAY
- char buf[100];
- #else
- char buf[20];
- #endif
- UINT16 first_seq;
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- if ((iItem < 0) || (iItem >= PER_PAGE) || (iItem >= pFsJpeg->File_Count))
- return;
- #ifdef MP3_DIRECT_SELECT
- first_seq = pFsJpeg->first_mp3_seq + PER_PAGE * pFsJpeg->file_page_will;
- #else
- first_seq = PER_PAGE * pFsJpeg->file_page_will;
- #endif
- #ifdef MP3_DIRECT_SELECT
- if(pFsJpeg->count_file[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3] >= 1000)
- psprintf(buf, "%04d.%s", first_seq + iItem + 1, s);
- else if(pFsJpeg->count_file[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3] >= 100)
- #else
- if(pFsJpeg->file_specify_in_dir >= 1000)
- psprintf(buf, "%04d.%s", first_seq + iItem + 1, s);
- if(pFsJpeg->file_specify_in_dir >= 100)
- #endif
- psprintf(buf, "%03d.%s", first_seq + iItem + 1, s);
- else
- psprintf(buf, "%02d.%s", first_seq+iItem + 1, s);
- #ifdef FS_BMP_GUI
- FSGUI_ShowString(fsArea[FS_AREA_FILEITEM].xStart + 46,
- (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem),
- buf, file_focus_y, file_focus_CrCb);
- #else
- FSGUI_ShowString(fsArea[FS_AREA_FILEITEM].xStart,
- (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem),
- buf, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
- #endif
- }
- void ShowDirItem(int iItem, const char *s)
- {
- char buf[20];
- UINT16 first_seq;
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- if ( (iItem < 0) || (iItem >= PER_PAGE) || (iItem >= pFsJpeg->Dir_Count)) {
- return;
- }
- first_seq = PER_PAGE * pFsJpeg->dir_page_now;
- if ( strcmp(s, "")==0 ) {
- psprintf(buf, "%02d.\", first_seq+iItem+1);
- } else {
- psprintf(buf, "%02d.%s",first_seq+iItem+1, s);
- }
- #ifdef FS_BMP_GUI
- FSGUI_ShowString( fsArea[FS_AREA_DIRITEM].xStart + 46,
- (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem ),
- buf, file_focus_y, file_focus_CrCb);
- #else
- FSGUI_ShowString( fsArea[FS_AREA_DIRITEM].xStart,
- (FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem ),
- buf, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
- #endif
- }
- //
- // DrawFileIcon()
- // Draw icon for file types
- // type = 0->mp3, = 1->jpeg , 2->game
- //
- #include "fsgui_icon_filex.inc"
- #ifdef NEW_MP3_GUI
- void DrawFileIconX(int x, int y, int type, int mono)
- {
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- FSGUI_DrawIcon(x, y, ICON_FileX[type], RGB8_Y, RGB8_CrCb, (mono? FSGUI_ICON_MONO : 0));
- }
- #else
- void DrawFileIcon(int x, int y, int type)
- {
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- #ifdef FS_BMP_GUI //suqiaoli add 2004-6-10 10:25
- FSGUI_LayPosVariableBmp(x, y,LAY_MP3_ICON_S + type);
- #else
- FSGUI_DrawIcon(x, y, ICON_FileX[type], RGB8_Y, RGB8_CrCb, 0);
- #endif
- }
- #endif
- //
- // DrawFolderIcon()
- // Draw icon for directory types
- // type=0: unselected, = 1: opened
- //
- #include "fsgui_icon_folderx.inc"
- void DrawFolderIcon(int x, int y, BYTE type)
- {
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- #ifdef FS_BMP_GUI //suqiaoli add 2004-6-10 10:26
- FSGUI_LayPosVariableBmp(x, y,LAY_FOLDER_ICON);
- #else
- FSGUI_DrawIcon(x, y, ICON_FolderX[type], cluty_fsgui, clutc_fsgui, 0);
- #endif
- }
- void DrawRectEdge(int x,int y, int xSize,int ySize,UINT16 color_Y,UINT16 color_CrCb)
- {
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- //wanghaoying notice 2004-8-4 17:24,
- //maybe when Large-GUI DEMENSION_SIZE should be (DEMENSION_SIZE+1)
- FSGUI_FillFrameBuf(x,y,xSize,DEMENSION_SIZE,color_Y,color_CrCb);
- FSGUI_FillFrameBuf(x,y,DEMENSION_SIZE,ySize,color_Y,color_CrCb);
- FSGUI_FillFrameBuf(x+xSize-DEMENSION_SIZE,y,DEMENSION_SIZE,ySize,color_Y,color_CrCb);
- FSGUI_FillFrameBuf(x,y+ySize-DEMENSION_SIZE,xSize,DEMENSION_SIZE,color_Y,color_CrCb);
- }
- //
- // List File item and clear refresh_file_page
- //
- void FileList(void)
- {
- UINT16 i;
- if (pFsJpeg->gifsState == FS_STATE_JPEG)
- return;
- if (!refresh_file_page)
- return;
- #ifdef FS_BMP_GUI
- FSGUI_ClearArea(FS_AREA_FILEITEM,PER_PAGE+1);
- #elif defined(NEW_MP3_GUI)
- ClearRectArea(Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB, FS_AREA_FILEITEM, -1);
- #else
- ClearArea(FS_AREA_FILEITEM);
- #endif
- #ifdef JPG_EFFECT
- #if !defined ( HELP_BMP_GUI)
- jpeg_effect_draw_help();
- #endif
- #endif
- for (i = 0; i < pFsJpeg->File_Count; i++)
- {
- DrawFileIcon(fsArea[FS_AREA_FILEICON].xStart,
- (fsArea[FS_AREA_FILEICON].yStart + FS_FILELIST_YSTEP * i), pFsJpeg->gifsFuncBtn - 1);
- FSShowFileItem(i, iso9660_file[pFsJpeg->file_array[i]].name);
- }
- refresh_file_page = 0;
- }
- //
- // Calculat location of the first file specified style -> fsnav_trk_now
- // and how many page needed to show these files -> File_Page_Count
- // and first_mp3_entry, last_mp3_entry
- // file_page_now and file_current clear to 0
- // and calculate length of scroll bar
- //
- UINT16 CalcFileFirstPage(int iDirSelect)
- {
- int iFile;
- pFsJpeg->first_mp3_seq = 0;
- pFsJpeg->first_mp3_entry = pFsJpeg->Dir_entry[iDirSelect];
- if(iDirSelect == pFsJpeg->fsnav_dir_cnt - 1)
- pFsJpeg->last_mp3_entry = pFsJpeg->iso9660_file_cnt - 1;
- else
- pFsJpeg->last_mp3_entry = pFsJpeg->Dir_entry[iDirSelect + 1] - 1;
- pFsJpeg->file_specify_in_dir = CountSpecifyFile(iDirSelect);
- for(iFile = 0; iFile < pFsJpeg->first_mp3_entry; iFile++)
- {
- if (iso9660_file[iFile].type == pFsJpeg->gifsFuncBtn)
- pFsJpeg->first_mp3_seq++;
- }
- iFile = pFsJpeg->first_mp3_entry;
- while (iFile <= pFsJpeg->last_mp3_entry)
- {
- if (iso9660_file[iFile].type == pFsJpeg->gifsFuncBtn)
- {
- pFsJpeg->fsnav_trk_now = iFile - pFsJpeg->first_mp3_entry;
- break;
- }
- iFile++;
- }
- pFsJpeg->File_Page_Count = (pFsJpeg->file_specify_in_dir + PER_PAGE - 1) / PER_PAGE;
- #ifdef FS_BMP_GUI
- //this for file scroll bar
- if (pFsJpeg->File_Page_Count != 1)// > PER_PAGE files all
- {
- pFsJpeg->scroll_len = ( fsArea[FS_AREA_MOVEBAR].ySize * PER_PAGE) /pFsJpeg->file_specify_in_dir;
- pFsJpeg->scroll_step = pFsJpeg->scroll_len;
- }
- else // <= PER_PAGE files all
- {
- pFsJpeg->scroll_step = 0;
- pFsJpeg->scroll_len = 0;
- }
- //this is for dir scroll bar
- dir_count_page = ( pFsJpeg->count_dir[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3]+ PER_PAGE - 1) / PER_PAGE;
- UINT16 dir_sum = pFsJpeg->count_dir[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3];
- if (dir_count_page != 1) // > PER_PAGE dirs all
- {
- dir_scroll_len = ( fsArea[FS_AREA_DIR_MOVEBAR].ySize * PER_PAGE) /dir_sum;
- dir_scroll_step = dir_scroll_len;
- }
- else // <= PER_PAGE files all
- {
- dir_scroll_step = 0;
- dir_scroll_len = 0;
- }
- #else
- if (pFsJpeg->File_Page_Count != 1)
- pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize / pFsJpeg->File_Page_Count;
- else if (pFsJpeg->file_specify_in_dir != 1)
- pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize / 2;
- else
- pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize;
- if (pFsJpeg->scroll_len < 4)
- pFsJpeg->scroll_len = 4;
- if ((fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_len) >= (pFsJpeg->file_specify_in_dir - 1))
- {
- pFsJpeg->scroll_step = (fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_len) / (pFsJpeg->file_specify_in_dir - 1);
- pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_step * (pFsJpeg->file_specify_in_dir - 1);
- }
- else
- {
- pFsJpeg->scroll_step = 10 * (fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_len) / (pFsJpeg->file_specify_in_dir - 1);
- pFsJpeg->scroll_len = fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_step * (pFsJpeg->file_specify_in_dir - 1) / 10;
- }
- #endif
- pFsJpeg->file_page_will = 0;
- pFsJpeg->file_will = 0;
- refresh_file_page = 1;
- return pFsJpeg->file_specify_in_dir;
- }
- //
- // locate the directory
- //
- UINT16 AnchorDir(int iSeq)
- {
- int dir;
- int j = 0;
- for (dir = 0; dir < pFsJpeg->fsnav_dir_cnt; dir++)
- {
- if (iso9660_dir[dir].type & (0x01 << pFsJpeg->gifsFuncBtn))
- {
- if(j == iSeq)
- break;
- j++;
- }
- }
- return dir;
- }
- UINT16 AnchorFile(int iSeq)
- {
- UINT16 file;
- UINT16 j = 0;
- for (file = 0; file <= (pFsJpeg->last_mp3_entry - pFsJpeg->first_mp3_entry); file++)
- {
- if (iso9660_file[file + pFsJpeg->first_mp3_entry].type == pFsJpeg->gifsFuncBtn)
- {
- if(j == iSeq)
- break;
- j++;
- }
- }
- return (file);
- }
- UINT16 antiAnchorDir(int iDir)
- {
- int seq = 0;
- int i;
- for(i = 0; i <= iDir; i++)
- {
- if (iso9660_dir[i].type & (0x01 << pFsJpeg->gifsFuncBtn))
- seq++;
- }
- return (seq-1);
- }
- UINT16 CountSpecifyFile(int iDir)
- {
- int iCount = 0;
- int iFirst,iLast;
- int i;
- iFirst = pFsJpeg->Dir_entry[iDir];
- if (iDir == pFsJpeg->fsnav_dir_cnt - 1)
- iLast = pFsJpeg->iso9660_file_cnt - 1;
- else
- iLast = pFsJpeg->Dir_entry[iDir + 1] - 1;
- i = iFirst;
- while (i <= iLast)
- {
- if (iso9660_file[i].type == pFsJpeg->gifsFuncBtn)
- iCount++;
- i++;
- }
- return iCount;
- }
- //Jeff update, 20020715
- void FSGUI_ProgSelect(UINT16 index)
- {
- BYTE oldbSlide;
- pFsJpeg->fsnav_dir_will = AnchorDir(prog[index][0] - 1); // calculate fsnav_dir_will, panxing,2002-1-29
- refresh_dir_icon = 1;
- FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0);
- pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
- oldbSlide = pFsJpeg->gbfsSlide;
- FSGUI_FileSelect( prog[index][1] );
- pFsJpeg->gbfsSlide = oldbSlide;
- }
- void FSGUI_FileSelect(int iSelect)
- {
- if (iSelect > 0 && iSelect <= pFsJpeg->file_specify_in_dir)
- {
- #ifdef JPEG_SELECT_IN_REPEAT_MODE //wuxiaofeng 2004-03-10
- if(rep_mode==0)//hold pFsJpeg->gbfsSlide=1
- #endif
- pFsJpeg->gbfsSlide = 0;
- iSelect = iSelect - 1; // file_current begin from 0, panxing, 2002-1-22
- if ((pFsJpeg->file_page_will * PER_PAGE <= iSelect) && ((pFsJpeg->file_page_will * PER_PAGE + pFsJpeg->File_Count - 1) >= iSelect))
- {
- // selecting is in current file page, panxing, 2002-1-22
- pFsJpeg->file_will = iSelect - pFsJpeg->file_page_will * PER_PAGE;
- pFsJpeg->fsnav_trk_will = pFsJpeg->file_array[pFsJpeg->file_will] - pFsJpeg->first_mp3_entry;
- }
- else
- {
- // selecting isn't in current file page,so need change file page,panxing, 2002-1-22
- pFsJpeg->file_page_will = iSelect / PER_PAGE;
- PrepareForChangeFilePage(iSelect / PER_PAGE, iSelect, 2);
- }
- Will2Playing();
- }
- }
- //Maoyong 2004.03.10 Find pre selected file's dir for STOP state right search/select
- void FindPreSelectFileDir(UINT16 *iSelect)
- {
- #ifdef MP3_DIRECT_SELECT
- int i, tmp;
- int iCount = 0;
- if ((*iSelect > 0) && (*iSelect <= pFsJpeg->count_file[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3]))
- {
- for(i = 0; i < pFsJpeg->fsnav_dir_cnt; i++)
- {
- tmp = CountSpecifyFile(i);
- if((iCount + tmp) >= *iSelect)
- break;
- iCount += tmp;
- }
- pFsJpeg->fsnav_dir_now = i;
- *iSelect = *iSelect - iCount;
- printf(" FIND SEL DIR: pFsJpeg->fsnav_dir_now = %dn", pFsJpeg->fsnav_dir_now) ;
- }
- #else
- *iSelect = *iSelect;
- #endif
- }
- #ifdef AUDIO_SHOW_SAVER
- void FSGUI_Force2Menu(void)
- {
- #ifdef MP3_LARGE_GUI
- config_memory(MEMORY_GRAPH_NTSC);
- #else
- config_memory(MEMORY_GRAPH_SMALL);
- #endif
- ClearOsdMsg(2);
- FSGUI_Menu();
- pFsJpeg->gbfsSlide = 0;
- pFsJpeg->gifsbPreview = 1; // Robert 20020715
- refresh_file_page = 1; // insure refresh dir page, panxing, 2002-1-22
- refresh_dir_page = 1;
- FSGUI_Refresh();
- AVD_ResetMediaStatus();
- reset_zoom_state();
- }
- void FSGUI_Disable()
- {
- bDisableGUI = 1;
- }
- void FSGUI_Ensable()
- {
- bDisableGUI = 0;
- }
- #endif
- int FSGUI_NormalNext(void)
- {
- int done = 0;
- int files = 0;
- int CurAsWill = 0;
- int bChangeHL; //Jeff 20020418
- int iCurDir;
- #ifdef MP3_JPEG_COWORK
- old_time=get_stc_32_inline();//get the press time
- #endif
- #ifdef RECORD_PER_SECOND //avoid bug when playing mp3 gerry 2-12-3 19:46
- resumeMSF = 0;
- #endif
- if ((pFsJpeg->file_will == pFsJpeg->file_current) && (pFsJpeg->file_page_now == pFsJpeg->file_page_will)) // Robert modify 021025
- bChangeHL = 1;
- else
- bChangeHL = 0;
- SetAVDState(0);
- if ((pFsJpeg->file_page_now == pFsJpeg->file_page_will) && (pFsJpeg->file_current == pFsJpeg->file_will))
- CurAsWill = 1;
- /* 2004/06/21 yltseng mark, it's no use now
- #ifdef SUPPORT_NESGAME
- if ((pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG) || (pFsJpeg->gifsFuncBtn == FS_FUNC_GAME))
- #else
- if (pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG)
- #endif
- pFsJpeg->gifsbPreview = 1;
- */
- if (pFsJpeg->file_page_now == (pFsJpeg->File_Page_Count - 1))
- files = pFsJpeg->file_specify_in_dir - pFsJpeg->file_page_now * PER_PAGE;
- else
- files = PER_PAGE;
- (pFsJpeg->file_current)++;
- // 2004/04/13 yltseng, fix the method to find out whether we reach the final file or not
- if (pFsJpeg->file_current >= files)
- {
- // need change file page,panxing,2002-4-15
- refresh_file_page = 1;
- pFsJpeg->file_page_now++;
- pFsJpeg->file_current = 0;
- if (pFsJpeg->file_page_now >= pFsJpeg->File_Page_Count)
- {
- // need change directory
- refresh_dir_icon = 1;
- Restore2PlayingDir(); //panxing,2002-4-13
- if(rep_mode != REPEAT_DIRECTORY)
- {
- pFsJpeg->dir_current++;
- pFsJpeg->fsnav_dir_will++; //Maoyong 2004.05.27
- }
- else
- PrintOsdMsg(STR_OS_REP_DIR, REGION1, 1, 0);
- //pFsJpeg->fsnav_dir_will = pFsJpeg->dir_page_now * PER_PAGE + pFsJpeg->dir_current;
- //dir_in_button = pFsJpeg->dir_page_now * PER_PAGE + pFsJpeg->dir_current;
- //if( pFsJpeg->fsnav_dir_will >= pFsJpeg->Dir_Count )
- //if( dir_in_button >= pFsJpeg->Dir_Count )
- //Maoyong marked and changed 2004-7-6 20:01 More than 10 dirs will enter to stop after 10th dir!!!
- iCurDir = pFsJpeg->dir_page_now * PER_PAGE + pFsJpeg->dir_current;
- if( iCurDir >= pFsJpeg->count_dir[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3] )
- {
- // total disc complete
- if (rep_mode != REPEAT_DISC)
- {
- //locate to last dir and last file
- FSGUI_2Last();
- #ifdef SUPPORT_OTHER_FILES_SSCREEN
- extern UINT32 save_srn_start_t;
- save_srn_start_t = get_rtc_val();
- #endif
- // stop now
- play_state = VCD_STATE_STOP;
- done = 1;
- }
- else
- {
- // start again
- pFsJpeg->fsnav_dir_will = 0;
- FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0);
- pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
- PrintOsdMsg(STR_OS_REP_ALL, REGION1, 1, 0);
- }
- }
- else
- {
- // change directory now
- if (FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0))
- {
- if(rep_mode != REPEAT_DISC)
- {
- //locate to last dir and last file
- FSGUI_2Last();
- // stop now
- play_state = VCD_STATE_STOP;
- done = 1;
- }
- else
- {
- refresh_dir_icon = 1;
- pFsJpeg->fsnav_dir_will = 0;
- FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 0);
- PrintOsdMsg(STR_OS_REP_ALL, REGION1, 1, 0);
- }
- }
- pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
- }
- }
- else
- {
- // needn't change directory but need change file page
- if(CurAsWill)
- {
- pFsJpeg->file_page_will = pFsJpeg->file_page_now;
- PrepareForChangeFilePage(pFsJpeg->file_page_now, 0, 0);
- Will2Playing();
- }
- else
- pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
- }
- }
- else
- {
- // needn't change file page
- if (CurAsWill)
- pFsJpeg->fsnav_trk_now = pFsJpeg->file_array[pFsJpeg->file_current] - pFsJpeg->first_mp3_entry;
- else
- pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
- }
- #if 0
- printf("=============Info of mp3 navigation NEXT============n");
- printf("file_current=%3d, file_page_now =%3d, fsnav_trk_now =%3dn", file_current, pFsJpeg->file_page_now, pFsJpeg->fsnav_trk_now);
- printf("file_will =%3d, file_page_will =%3d, fsnav_trk_will=%3dn",file_will, pFsJpeg->file_page_will, pFsJpeg->fsnav_trk_will);
- printf("File_Count =%3d, File_Page_Count=%3d, file_specify_in_dir=%3dn", pFsJpeg->File_Count,pFsJpeg->File_Page_Count,file_specify_in_dir);
- printf("dir_current =%3d, fsnav_dir_now =%3dn", pFsJpeg->dir_current, pFsJpeg->fsnav_dir_now);
- printf("dir_page_now=%3d, fsnav_dir_will =%3dn", pFsJpeg->dir_page_now, pFsJpeg->fsnav_dir_will);
- printf("refresh_dir_icon=%d,refresh_file_page=%d,refresh_dir_page=%dn",refresh_dir_icon,
- refresh_file_page,refresh_dir_page);
- #endif
- if (bChangeHL)
- Playing2Will();
- return done;
- }
- int FSGUI_NormalPrev(void)
- {
- int done = 0;
- int CurAsWill = 0;
- #if 0//def MP3_FORWD_BACKWD_PLAY //wsf 2004-7-26 12:59
- done = 0;
- return done;
- #endif
- #ifdef MP3_JPEG_COWORK
- old_time=get_stc_32_inline();//get the press time
- #endif
- SetAVDState(0);
- #ifdef RECORD_PER_SECOND //avoid bug when playing mp3 gerry 2-12-3 19:46
- resumeMSF = 0;
- #endif
- if ((pFsJpeg->file_page_now == pFsJpeg->file_page_will) && (pFsJpeg->file_current == pFsJpeg->file_will))
- CurAsWill = 1;
- /* 2004/06/21 yltseng mark, it's no use now
- #ifdef SUPPORT_NESGAME
- if ((pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG) || (pFsJpeg->gifsFuncBtn == FS_FUNC_GAME))
- #else
- if (pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG)
- #endif
- pFsJpeg->gifsbPreview = 1;
- */
- if (pFsJpeg->file_current != 0)
- {
- // needn't change file page
- refresh_file_page = 0;
- (pFsJpeg->file_current)--;
- if(CurAsWill)
- pFsJpeg->fsnav_trk_now = pFsJpeg->file_array[pFsJpeg->file_current] - pFsJpeg->first_mp3_entry;
- else
- pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
- }
- else
- {
- // need change file page;
- refresh_file_page = 1;
- if (pFsJpeg->file_page_now != 0)
- {
- // change file page now
- pFsJpeg->file_page_now--;
- if(CurAsWill)
- {
- pFsJpeg->file_page_will = pFsJpeg->file_page_now;
- PrepareForChangeFilePage(pFsJpeg->file_page_now, 0, 1);
- Will2Playing();
- }
- else
- {
- pFsJpeg->file_current = PER_PAGE;
- pFsJpeg->fsnav_trk_now = AnchorFile(pFsJpeg->file_page_now * PER_PAGE + pFsJpeg->file_current);
- }
- }
- else
- {
- // change directory
- refresh_dir_icon = 1;
- Restore2PlayingDir(); // panxing, 2002-4-13
- #ifdef MP3_FB_PLAY_AT_STARTDIR
- if(pFsJpeg->fsnav_dir_will != 0) //linrc 2004-8-9 16:21
- #else
- if ((pFsJpeg->fsnav_dir_will != 0) || (rep_mode == REPEAT_DIRECTORY)) //panxing, 2002-3-13
- #endif
- {
- if(rep_mode != REPEAT_DIRECTORY)
- pFsJpeg->fsnav_dir_will--;
- else
- PrintOsdMsg(STR_OS_REP_DIR, REGION1, 1, 0);
- if (FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_will), 1))
- {
- if (rep_mode != REPEAT_DISC)
- done = 1;
- else
- {
- //locate to last dir and last file
- FSGUI_2Last();
- }
- }
- else
- {
- pFsJpeg->fsnav_dir_now = pFsJpeg->fsnav_dir_will;
- // correct the list of prev directory's file, panxing, 2002-1-18
- pFsJpeg->file_page_will = pFsJpeg->File_Page_Count - 1;
- PrepareForChangeFilePage(pFsJpeg->File_Page_Count - 1, 0, 1);
- Will2Playing();
- }
- }
- else
- {
- // total disc complete
- #ifdef MP3_FB_PLAY_AT_STARTDIR //when FB at dir start,it replay
- if(1) //and cancel repeat mode,so I marke it
- #else //linrc 2004-8-9 16:20
- if (rep_mode != REPEAT_DISC)
- #endif
- {
- #ifdef MP3_FB_PLAY_AT_STARTDIR
- rep_mode = REPEAT_IDLE;
- #endif
- // stop now
- if ((pFsJpeg->fsnav_dir_now == 0) && (adv_search_time < 0))
- {
- //terry, debug: bf 1st trk , repeat refresh and bf
- //2002/4/29 03:56PM
- adv_search_time = 0;
- refresh_file_page = 0;
- }
- pFsJpeg->fsnav_dir_will = 0;
- pFsJpeg->dir_current = 0;
- pFsJpeg->fsnav_trk_now = 0;
- pFsJpeg->dir_page_now = 0;
- pFsJpeg->file_page_now = 0;
- old_file_page = 0xffff;
- old_dir_page = 0xffff;
- play_state = VCD_STATE_STOP;
- done = 1;
- FSGUI_PreChangeDir(&(pFsJpeg->fsnav_dir_now), 0);//2004-3-10 18:38
- }
- else
- {
- //locate to last dir and last file
- FSGUI_2Last();
- PrintOsdMsg(STR_OS_REP_ALL, REGION1, 1, 0);
- }
- }
- }
- }
- /*
- printf("=============Info of mp3 navigation PREV============n");
- printf("file_current=%3d, file_page_now =%3d, fsnav_trk_now =%3dn",file_current, pFsJpeg->file_page_now, pFsJpeg->fsnav_trk_now);
- printf("file_will =%3d, file_page_will =%3d, fsnav_trk_will=%3dn", file_will, pFsJpeg->file_page_will, pFsJpeg->fsnav_trk_will);
- printf("File_Count =%3d, File_Page_Count=%3d, file_specify_in_dir=%3dn", pFsJpeg->File_Count,pFsJpeg->File_Page_Count,file_specify_in_dir);
- printf("dir_current =%3d, fsnav_dir_now =%3dn", pFsJpeg->dir_current, pFsJpeg->fsnav_dir_now);
- printf("dir_page_now=%3d, fsnav_dir_will =%3dn", pFsJpeg->dir_page_now, pFsJpeg->fsnav_dir_will);
- printf("refresh_dir_icon=%d,refresh_file_page=%d,refresh_dir_page=%dn",refresh_dir_icon,
- refresh_file_page,refresh_dir_page);
- */
- return done;
- }
- void FSGUI_CookFileItem(BYTE iItem)
- {
- #ifdef HANYANG_DVD
- #ifdef HANYANG_FS_LONGNAME
- FSGUI_UpdateInfoArea("");
- if( (pFsJpeg->gifsFuncBtn == FS_FUNC_MP3) && GetFileFullName(pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry) ){
- if( uScrollDispFilenameFlag ==1 ){
- uScrollDispFilenameFlag = SCROLL_SHOW_500MS_CNT; //for first display
- FS_ScrollDispFileName();
- }
- }
- #endif
- return;
- #endif
- char buf[22] = {0};
- if ((iItem >= PER_PAGE) || (iItem >= pFsJpeg->File_Count))
- return;
- #ifdef SUPPORT_ID3//CLEAD_UNICODE
- FSGUI_FillFrameBuf(36,8,148+172,50, BK_GROUNDY, BK_GROUNDCRCB);//clead_unicode
- #endif
- if (pFsJpeg->gifsFuncBtn == FS_FUNC_MP3)
- {
- #ifndef SUPPORT_ID3
- // 2004/04/18 yltseng, If not mark it, when turn on SUPPORT_CHINESE_FONT, all CDROM & CDROM_WMA file don't show
- // extension file name even though we turn ISO9660_FILE_NOT_SHOW_EXTEND_NAME off.
- //#ifndef SUPPORT_CHINESE_FONT
- if (GetCurrentFileType() == CDROM)
- {
- #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME //gerry,2004-2-26 10:53
- 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
- #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- 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
- #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- }
- else
- #ifdef SUPPORT_WMA
- if (GetCurrentFileType() == CDROM_WMA)
- {
- #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME //gerry,2004-2-26 10:53
- 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
- #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- 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
- #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- }
- else
- #endif
- //#endif
- {
- 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
- }
- #endif
- }
- else if (pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG)
- {
- #ifdef SUPPORT_GIF
- if (GetCurrentFileType() == CDROM_GIF)
- {
- #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME //gerry,2004-2-26 10:53
- psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- psprintf(buf, "[%s]%s.GIF", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- }
- else
- #endif
- #ifdef SUPPORT_BMP
- if (GetCurrentFileType() == CDROM_BMP)
- {
- #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME //gerry,2004-2-26 10:53
- psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- psprintf(buf, "[%s]%s.BMP", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- }
- else
- #endif
- #ifdef MINTON_DVD//wuxiaofeng changed here 02-27 for minton DVD.
- psprintf(buf, "[%s]%s.JPEG", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #else
- #ifdef ISO9660_FILE_NOT_SHOW_EXTEND_NAME //gerry,2004-2-26 10:53
- psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #else//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- psprintf(buf, "[%s]%s.JPG", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #endif//ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- #endif
- }
- #if defined(SUPPORT_NESGAME)||defined(SUPPORT_SPG_GAME)
- else if (pFsJpeg->gifsFuncBtn == FS_FUNC_GAME)
- 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);
- #endif
- #ifdef SUPPORT_FILE_SYSTEM_MODE // Robert 021001
- else if (pFsJpeg->gifsFuncBtn == FS_FUNC_OTHER)
- { // yltseng 20040412 show file extension
- #ifndef ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- #ifdef TELL_FROM_MP4_EXT_NAME //Maoyong
- if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_MP4 )
- psprintf(buf, "[%s]%s.DIV", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- else if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_AVI )
- psprintf(buf, "[%s]%s.AVI", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #else
- if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_MP4 )
- psprintf(buf, "[%s]%s.MP4", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #endif //#ifdef TELL_FROM_MP4_EXT_NAME
- else if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_MPG )
- psprintf(buf, "[%s]%s.MPG", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #ifdef SUPPORT_PLAY_SWD
- else if( iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].file_type == CDROM_SWD )
- psprintf(buf, "[%s]%s.SWD", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #endif
- else
- #endif //#ifndef ISO9660_FILE_NOT_SHOW_EXTEND_NAME
- psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- }
- #endif
- #ifdef SUPPORT_MIDI
- else if (pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI)
- psprintf(buf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, iso9660_file[pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry].name);
- #endif
- #ifdef SUPPORT_FS_LONGNAME //Maoyong 2004.06.24
- if( GetFileFullName(pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry) ){
- if( uScrollDispFilenameFlag ==1 ){
- uScrollDispFilenameFlag = SCROLL_SHOW_500MS_CNT; //for first display
- FS_ScrollDispFileName();
- }else{
- psprintf(linebuf, "[%s]%s", iso9660_dir[pFsJpeg->fsnav_dir_now].name, uFullFilename);
- FSGUI_UpdateInfoArea(linebuf);
- }
- }else //can't read succesfully, just use the old way for file name
- FSGUI_UpdateInfoArea(buf);
- #else //#ifdef SUPPORT_FS_LONGNAME
- FSGUI_UpdateInfoArea(buf);
- #endif //#ifdef SUPPORT_FS_LONGNAME
- #ifdef FSGUI_NO_BLINK_SCROLL
- strcpy(tempbuf,buf);
- #endif
- }
- int PrepareForChangeFilePage(UINT16 iPage, UINT16 iSpecialTrk, UINT16 iDirect)
- {
- int i, j = 0;
- UINT16 iFileFirst;
- iFileFirst = AnchorFile(iPage * PER_PAGE);
- if(iPage == pFsJpeg->File_Page_Count - 1) // the last page
- pFsJpeg->File_Count = pFsJpeg->file_specify_in_dir - (pFsJpeg->File_Page_Count - 1) * PER_PAGE;
- else
- pFsJpeg->File_Count = PER_PAGE;
- i = iFileFirst + pFsJpeg->first_mp3_entry;
- while (j < PER_PAGE )
- {
- if (iso9660_file[i].type == pFsJpeg->gifsFuncBtn)
- {
- pFsJpeg->file_array[j] = i;
- j++;
- }
- i++;
- if(i>pFsJpeg->iso9660_file_cnt) break;//terry,2004/2/25 06:42PM
- }
- if(iDirect == 0)
- {
- // next page operation
- pFsJpeg->file_will = 0;
- }
- else if(iDirect == 1)
- {
- // prev page operation
- pFsJpeg->file_will = pFsJpeg->File_Count - 1;
- }
- else if(iDirect == 2)
- {
- // direct select operation
- pFsJpeg->file_will = iSpecialTrk % PER_PAGE;
- }
- pFsJpeg->fsnav_trk_will = pFsJpeg->file_array[pFsJpeg->file_will] - pFsJpeg->first_mp3_entry;
- refresh_file_page = 1;
- if (pFsJpeg->File_Count != PER_PAGE)
- {
- for(i = pFsJpeg->File_Count; i < PER_PAGE; i++)
- pFsJpeg->file_array[i] = 0; // for check whether flash file icon,panxing,2002-4-13
- }
- return 0;
- }
- //
- // Base on fsnav_dir_now to prepare for when change directory(indexing to page-0 file-0).
- // iDirect = 0 means: select next directory
- // iDirect = 1 means: select prev directory
- //
- int FSGUI_PreChangeDir(UINT16 *iDir,UINT16 iDirect)
- {
- int done = 0;
- #ifdef POWER_RESUME
- UINT32 fsnav_trk_now = 0 ;
- fsnav_trk_now = ReadSameMP3Para ( 1 ) ;
- #endif // POWER_RESUME , added by caiyh , 14:12 , Nov 5th , 2004
- done =FSGUI_PreFindDir(iDir,iDirect);
- CalcFileFirstPage(*iDir);
- CalcDirNow(iDir);
- #ifdef POWER_RESUME
- if ( IsTheSameMP3 ( ) )
- PrepareForChangeFilePage( fsnav_trk_now / PER_PAGE ,
- fsnav_trk_now , 2 ) ;
- // show the page for resuming , added by caiyh , 14:12 , Nov 5th , 2004
- else
- #endif // POWER_RESUME , added by caiyh , 14:12 , Nov 5th , 2004
- PrepareForChangeFilePage(0,0,0);
- Will2Playing();
- //refresh_file_page = 1;
- return done;
- }
- int FSGUI_PreFindDir(UINT16 *iDir,UINT16 iDirect)
- {
- int done = 0;
- UINT16 old_mp3_dir = 0;
- old_mp3_dir = *iDir;
- while(!(iso9660_dir[*iDir].type & (0x01 << pFsJpeg->gifsFuncBtn)))
- {
- if(iDirect == 0)
- {
- if(*iDir < pFsJpeg->fsnav_dir_cnt - 1)
- (*iDir)++;
- else
- {
- // old_mp3_dir is the last directory include file specified style, panxing, 2002-1-22
- done = 1;
- break;
- }
- }
- else
- {
- if(*iDir>0)
- (*iDir)--;
- else
- {
- // old_mp3_dir is the first directory include file specified style, panxing, 2002-1-22
- done = 1;
- break;
- }
- }
- }
- if(done)
- {
- // restore fsnav_dir_now, panxing, 2002-1-22
- if(iDirect == 0)
- *iDir = (old_mp3_dir - 1);
- else
- *iDir = (old_mp3_dir + 1);
- refresh_dir_icon = 0;
- }
- return done;
- }
- //
- // List directory item and clear refresh_dir_page
- //
- void DirList()
- {
- UINT16 i;
- UINT16 j;
- if (!refresh_dir_page)
- return;
- #ifdef FS_BMP_GUI
- FSGUI_ClearArea(FS_AREA_DIRITEM,PER_PAGE+1);
- #elif defined(NEW_MP3_GUI)
- ClearRectArea(Rect[DIR_RECT], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, -1);//zhaoyanhua add
- #else
- ClearArea(FS_AREA_DIRITEM);
- #endif
- i = pFsJpeg->dir_page_now * PER_PAGE;
- j = 0;
- while (j < pFsJpeg->Dir_Count && i < pFsJpeg->fsnav_dir_cnt)
- {
- if (iso9660_dir[i].dir > 0 ) {
- ShowDirItem(j, iso9660_dir[pFsJpeg->dir_array[j]].name);
- j++;
- }
- i++;
- }
- refresh_dir_page = 0;
- }
- //
- // Calculate dir_page_now,dir_current,Dir_Count according to fsnav_dir_now
- // and refresh_dir_page is determine
- // dir_page_now: range=(0 ~ x)
- // dir_current: range=(0 ~ x)
- // Dir_Count: range=(1 ~ x)
- //
- void CalcDirNow(UINT16 *iDir)
- {
- int i;
- int j = 0;
- int seq = 0;
- int first = 0;
- old_dir_page = pFsJpeg->dir_page_now;
- seq = antiAnchorDir(*iDir);
- pFsJpeg->dir_page_now = seq / PER_PAGE;
- seq = 0;
- for (i = 0; i < pFsJpeg->fsnav_dir_cnt; i++)
- {
- if (iso9660_dir[i].type & (0x01 << pFsJpeg->gifsFuncBtn))
- {
- if(first == pFsJpeg->dir_page_now * PER_PAGE)
- {
- // Now seq is the first directory in this dir page, panxing, 2002-1-29
- break;
- }
- first++;
- }
- seq++;
- }
- pFsJpeg->Dir_Count = 0;
- j = 0;
- // printf("dir_page_now = %d, first = %d, seq = %dn", pFsJpeg->dir_page_now,first,seq);
- for (i = seq; i < pFsJpeg->fsnav_dir_cnt; i++)
- {
- if (iso9660_dir[i].type & (0x01 << pFsJpeg->gifsFuncBtn))
- {
- pFsJpeg->dir_array[j] = i;
- if(i == *iDir)
- pFsJpeg->dir_current = j;
- j++;
- }
- if(j == PER_PAGE)
- break;
- }
- pFsJpeg->Dir_Count = j;
- //printf("old_dir_page = %d, dir_page_now = %dn", old_dir_page, pFsJpeg->dir_page_now);
- if(old_dir_page != pFsJpeg->dir_page_now)
- {
- refresh_dir_page = 1;
- refresh_dir_icon = 1;
- }
- return;
- }
- void FS_ForceReturn2Menu(void)//used when NEW_STYLE_SETUP
- {
- #ifdef NEW_STYLE_SETUP //to return from setup state. zhaoyanhua add 2003-8-7 8:58
- pFsJpeg->gifsState = FS_STATE_LIST;
- play_state = VCD_STATE_MP3_FILELIST;
- adv_search_time = 0;
- video_slow = 0;
- #ifdef MP3_LARGE_GUI
- config_memeory(MEMORY_GRAPH_NTSC);
- #else
- config_memory(MEMORY_GRAPH_SMALL);
- #endif
- setup_tv_format(tv_format);
- #endif//NEW_STYLE_SETUP
- FSGUI_Menu();
- pFsJpeg->gbfsSlide = 0;
- //zhaoyanhua masked for NEW_MP3_GUI for NEW_STYLE_SETUP. 3-7-25 20:17
- #if !(defined (NEW_MP3_GUI) || defined (FS_BMP_GUI))
- pFsJpeg->gifsbPreview = 1; // Robert 20020715
- refresh_file_page = 1; // insure refresh dir page, panxing, 2002-1-22
- refresh_dir_page = 1;
- #endif
- pFsJpeg->gifsState = FS_STATE_LIST;
- #if defined (NEW_MP3_GUI) || defined (FS_BMP_GUI)
- //zhaoyanhua add 3-7-25 20:17
- if ((JPEG_Preview_drawed == JPEG_PREVIEW_IN_DIR_AREA ) )
- {
- JPEG_Preview_drawed = DIR_LIST_IN_DIR_AREA;
- pFsJpeg->gifsbPreview = 1;
- flagRefresh = 1;//note now state is refresh.
- refresh_dir_page = 0;//when return to JPEG preview ,not show DIR.
- FileList();//to avoid the bug: when MENU/RETURN, can not show correctly in FILE AREA zhaoyanhua add 2004-1-12 18:09
- }
- else
- {
- refresh_file_page = 1;
- refresh_dir_page = 1;
- FSGUI_Refresh();
- }
- #else
- FSGUI_Refresh();
- #endif
- }
- void FSGUI_Return2Menu(void)
- {
- if ((pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG) && (pFsJpeg->gifsState == FS_STATE_JPEG))
- {
- //set to normal display ratio/offset, Jeff 20030722
- reset_zoom_state();//return menu
- startup_vpp();
- //Maoyong added 2004-8-12 18:04 for initialization when define ZOOM_DIRECT_STOP_SLIDE, normally do seq play again
- #ifdef ZOOM_DIRECT_STOP_SLIDE
- jpg_slide_time = JPEG_SLIDE_TIME;
- #endif
- #if defined (NEW_MP3_GUI) || defined (FS_BMP_GUI)
- ClearOsdMsg(2);
- pFsJpeg->gbfsSlide = 0;
- pFsJpeg->gifsState = FS_STATE_LIST;
- #else
- #if !defined(JPEG_SLIDE_SHOW_USE_PROG)
- ClearOsdMsg(2);//nono 3-12-24 22:48 for PROG ON, it will turn off PROG MENU.
- #endif
- #endif
- AVD_ResetMediaStatus();
- #if defined(FALSE_POWER)&&defined(STOP_LOADER)//zhuyanfeng20041008
- pFsJpeg->gifsbPreview = 0;
- ShowTitle();
- #else
- FS_ForceReturn2Menu();
- #endif
- }
- pFsJpeg->ControlArea = CNT_AREA_FILE;
- }
- #if !defined (FS_BMP_GUI)
- void FSGUI_UpdateInfoArea(BYTE* strInfo)
- {
- #ifdef AUDIO_SHOW_SAVER
- if (bDisableGUI) return;
- #endif
- #ifdef NEW_MP3_GUI
- #ifdef MONO_FSGUI //mono FS GUI, axel 2003-12-29 23:26
- DrawRectCorner(Rect[PATH_RECT], 6,1, 1, DIR_AREA_BKGROUND_CRCB );
- #else
- DrawRectCorner(Rect[PATH_RECT], 6,1, 40, DIR_AREA_BKGROUND_CRCB );
- #endif
- #ifdef MP3_LARGE_GUI
- FSGUI_ShowString(fsArea[FS_AREA_PATHINFO].xStart+40,
- fsArea[FS_AREA_PATHINFO].yStart + 2,
- strInfo, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
- #else
- FSGUI_ShowString(fsArea[FS_AREA_PATHINFO].xStart+INFO_X_OFFSET,
- Y1-18,
- strInfo, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
- #endif
- #else //NEW_MP3_GUI
- FSGUI_FillFrameBuf(fsArea[FS_AREA_PATHINFO].xStart+INFO_X_OFFSET,fsArea[FS_AREA_PATHINFO].yStart,
- fsArea[FS_AREA_PATHINFO].xSize,fsArea[FS_AREA_PATHINFO].ySize,
- BK_GROUNDY,BK_GROUNDCRCB);
- FSGUI_ShowString(fsArea[FS_AREA_PATHINFO].xStart+INFO_X_OFFSET,
- Y1-18,
- strInfo, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
- #endif //#ifdef NEW_MP3_GUI
- }
- #else //#if !defined (FS_BMP_GUI)
- /*
- * Description:
- * Update the Info area about current dir and file.
- * INPUT:
- * The string infomation about current dir and file.
- * And it is decided by func FSGUI_CookFileItem()
- *Creater:
- * feeling
- *Date: