⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ui_director2.i

📁 MP3 整个 SDK
💻 I
📖 第 1 页 / 共 3 页
字号:

 unsigned char  fselGetNextFile(char *filename);

 unsigned char  fselGetPrevFile(char *filename);

 unsigned char  fselGetNextGroup(char *groupname);

 unsigned char  fselGetPrevGroup(char *groupname);

 unsigned char  fselGetCurGroupL(char *grouplongname,  unsigned short  iLen);

 unsigned char  fselGetCurFNameL(char *longfilename,  unsigned char  iLen);

 unsigned char  fselSetLocation(file_location_t *location);

 unsigned char  fselGetLocation(file_location_t *location);

 unsigned char  fselEntCurrentDir(char *strDir);

 unsigned char  fselRetParentDir(char *strDir);

 unsigned char  fselDelFile(unsigned char type);


 unsigned char  fselSetMode(  unsigned char  mode);

 unsigned short  fselGetTotal(void);

 unsigned short  fselGetNo(void);

 unsigned char  fselGetErrID(void);




 unsigned char  fselGetNext(char *strFile );

 unsigned char  fselGetPrev(char *strFile );

 unsigned char  fselGetByNO( char *strFile, const  unsigned short  Num);

 unsigned char  fselNextDir(char *strDir);

 unsigned char  fselPrevDir(char *strDir);


int GenNewName(file_location_t *loation);

 unsigned char  playlistdel(char *filename);
 unsigned char  playlistclassNext(char *classname);
 unsigned char  playlistclassPrev(char *classname);

 unsigned char  playlistnext(char *filename);
 unsigned char  playlistprev(char *filename);


 unsigned char  playlistret();


 unsigned char  fselSetLocationC(file_location_t *location);

 unsigned char  fselGetLocationC(file_location_t *location);


 unsigned char  unitochar(char *str,int len,unsigned char encode); 


































typedef struct
{
 unsigned long  PenColor; 
 unsigned long  BackgdColor; 
}DC, *PDC;

typedef struct
{
char x; 
char y; 
char width; 
char height; 
}region_t;



non_banked char *PutS(const char *str,signed char strlen); 
non_banked  unsigned char  PutChar(int code); 
non_banked void PutSDImage(region_t *imageregion,long int sdimageaddr); 
non_banked void InvertRegion(region_t *invregion); 
non_banked void SetAsciiFont(unsigned char FontID); 
non_banked void SetTextPos(unsigned char x,unsigned char y); 
non_banked void SetPenColor( unsigned long  color);
non_banked void SetBackgdColor( unsigned long  color);
non_banked void SetTextOutMode(unsigned char mod); 
non_banked void SetContrast(char ContrastValue); 
non_banked void DispBufSelect(unsigned char rampage); 

non_banked void GetFontPoint(int code,void *picbuf); 
non_banked char *GetDisplayBufAddr(void); 
non_banked void GetTextPos(unsigned char *x,unsigned char *y); 
non_banked void GetDCStatus(PDC pdc); 
non_banked char GetOutPutErr(void); 
non_banked void RegionMove(region_t *sregion, region_t *tregion); 
non_banked void RegionCopy(region_t *sregion, region_t *tregion); 
non_banked void UpdateScreen(const region_t *region); 
non_banked void SetTranMode(char Mode); 
non_banked void SetWindow(region_t *winregion); 
non_banked void LightOnOff( unsigned char  OnOff); 
non_banked void BuffDataTrans(char *buff , int datacnt); 
non_banked void SetDrawMode( unsigned char  mode); 

non_banked  unsigned char  CharOutRect(int code, region_t *CRregion,  unsigned char  colcnt);
non_banked void FillRect (region_t * region);
non_banked void DrawRectFrame(region_t * region );
non_banked void TextOutRect(region_t * region, char *str);
non_banked void Draw3DRect (region_t * D3region,  unsigned char  type);
non_banked void StandbyScreen( unsigned char  bStandby); 
non_banked void ClearScreen(region_t *clrregion); 
non_banked void MsgBox(int MsgNo,char x,char y); 

non_banked void SetBrightness(char BrightnessValue); 

non_banked  unsigned char  sUI_Init(char mode); 
non_banked void sUI_Exit(void); 
non_banked void sUI_HardInit(void); 


extern long FontLibAddr;
extern long AsciiFontLibAddr;
extern char DisplayBuffer[];























































typedef struct
{
int title;
int headpic;
char menu_grade[3]; 
}menuhead_t;















typedef struct
{
int total; 
int active; 
const  unsigned short  *title; 
 unsigned char  grade[3];
 unsigned char  string_id;
}function_menu_t;






typedef struct
{

int min;
int max;
int value;
 unsigned char  string_id;
} progress_t;






typedef struct
{

int title;
int min;
int max;
int value;
int step; 
 unsigned char  string_id;
}slider_t;
















typedef struct
{

const  unsigned short  *strid;
int total;
int active;
int headid;

 unsigned char  string_id;
}pop_up_list_t;

int ui_menuhead (menuhead_t *menuhead, int string_id);

int ui_popup_list(pop_up_list_t *list, const void (*callback)(int value));





int ui_err_msg (int msgID, int typeID, int string_id);
int ui_show_msg (int msgID, int typeID, int string_id);



int ui_menu (function_menu_t *menu , const void (*callback)(int value));



int ui_menu2 (function_menu_t *menu , const void (*callback)(int value));

int ui_show_progress(const progress_t *progress, int string_id);
void ui_show_guage(int step, unsigned char  para);




int ui_filelist(file_location_t *location, int type, int string_id);
int ui_explore(file_location_t *location, int type, int string_id);







extern char file_name[12];
extern char dir_name[30];



int rm_dir_from_buf(int n);







extern  unsigned char  read_idm_data(char *name, int count);
extern  unsigned char  write_idm_data(char *name, int count);
extern void init_dir_buf();
extern  unsigned char  get_dir_name(char *file,  unsigned short  num);
extern void get_dir_name2(char *file, int num);
extern int init_sel_dir_buf(void);
extern  unsigned char  del_all_my_file(int type,  unsigned char  string_id);
extern void reinit_idm_buf(int top, int bottom, int total_dir, int string_id);
void show_active_list(int old_active, int active, int top);
 unsigned char  show_popup_list(int string_id);
int ui_explore_sub(file_location_t *location, int type, int string_id);
int init_active(int string_id);
int init_active_dironly(file_location_t *location);
void reset_cur_list_bg_color(int i, int tmp);
void get_dir_long_name(file_location_t *location, int string_id);
void redraw_window(void);
void Clearexplore(void);
void ui_show_data(char *buf,  unsigned char  x,  unsigned char  y);






















































































typedef struct
{
char magic[4]; 
 unsigned short  counts; 
char reserved[10];
}res_head_t;


typedef struct
{
long offset; 
 unsigned short  length; 
 unsigned char  type; 
char name[9]; 
}res_entry_t;






























extern SD_FILE *res_fp;
extern  unsigned char  ui_auto_update; 
extern  unsigned char  ui_auto_select; 
extern  unsigned char  ui_run_realtime; 
extern region_t res_region;
extern const char mychar[]; 
extern const char menu_pos[6];
extern const char music_ext[][4];
extern const char voice_ext[][4];
extern const char pic_ext[][4];
extern const char txt_ext[][4];
extern  unsigned char  charge_flag; 




SD_FILE *ResOpen(const char * filename);
void ResClose(const SD_FILE *fp_res);
int ResShowPic( unsigned short  id,  unsigned char  x,  unsigned char  y);



int main_ResShowPic( unsigned short  id,  unsigned char  x,  unsigned char  y);


int ResShowString( unsigned short  id,  unsigned char  x,  unsigned char  y); 
int ResShowMultiString( unsigned short  id,  unsigned char  string_id,  unsigned char  x,  unsigned char  y); 



int ResInvertShowPic( unsigned short  id,  unsigned char  x,  unsigned char  y);
void ap_message_init(const comval_t *comval);
non_banked char ap_get_message(void);


non_banked char ap_handle_hotkey(char key);
char ap_sleep(int half_sec); 

void ap_set_event( unsigned short  event);
 unsigned short  ap_get_event( unsigned short  event,  unsigned short  condition);
void ap_del_event( unsigned short  event);







char *itoa_1( unsigned char  i, char *buf); 
char *itoa_2( unsigned char  i, char *buf); 
char *itoa_3( unsigned short  i, char *buf); 
char *itoa_4( unsigned short  i, char *buf); 

int get_text_width(const char *string);
int get_large_text_width(const char *string);


void ui_show_a( unsigned short  id);
void ui_show_b( unsigned short  id);
void ui_show_c( unsigned short  id);
void ui_show_d(const char *string);
void ui_show_d2(const char *string); 
void ui_show_cd(const char *string,  unsigned char  part);
void ui_show_d_pic( unsigned short  id); 
void ui_show_e( unsigned short  id);
void ui_show_f(const char *string );
void ui_show_ef(const char *string,  unsigned char  part);
void ui_show_batt(int value, char batt_type, unsigned char  fmflag); 
void ui_show_g(const char *string);
void ui_show_h(const char *string);

int ui_delete(file_location_t *location,  unsigned char  type, unsigned char  string_id);
int ui_delete_all(file_location_t *location,  unsigned char  type, unsigned char  string_id);
int ui_deleteplaylist(file_location_t *location,  unsigned char  type, unsigned char  string_id);
int ui_directory(file_location_t *location,  unsigned char  type, unsigned char  string_id);
int ui_playlist(file_location_t *location,  unsigned char  type, unsigned char  string_id);
int ui_function_menu(function_menu_t *menu, const void (*callback)(int res_id));
int ui_slider(slider_t *slider, const void (*callback)(int res_id));

char ui_show_lock(char islock);
void ui_show_vol( unsigned char  volume);















typedef struct
{
 unsigned char  filetype; 
 unsigned char  dirno[8]; 
 unsigned short  fileno; 
 unsigned char  dirlayer; 
 unsigned char  fselExtNo; 
char name[12];
char longname[50]; 
}file_record;

extern  unsigned short  fselFileNo; 
extern char fselDiskLetter;
extern  unsigned char  fselDirNo[ 8 ]; 

extern  unsigned char  fselDirLayer;
extern  unsigned short  fselTotal; 
extern  unsigned char  fselError;
extern  unsigned char  fselType; 
extern  unsigned char  fselExtNo; 

extern  unsigned char  FS_Dir(char *StrName, const char *StrExtName, char type);
extern  unsigned short  GetFileTotal( char *strDir,  unsigned char  bCheckValidDir);
extern  unsigned short  GetFileTotalCur( unsigned char  bCheckValidDir);
extern  unsigned char  ToDirEntry(char *strDir, const  unsigned short  Num); 




const char file_pos[6] = {  ( 14 + 21 *5) ,  ( 14 + 21 *4) , ( 14 + 21 *3) , ( 14 + 21 *2) , ( 14 + 21 ) , ( 14 ) }; 
const  unsigned short  file_bck_pic[6]={  106 , 105 , 104 , 103 , 102 , 101  };
void GetLongNameAndSave(char *Namebuf,char *LongNamebuf, unsigned char  string_id);
void SaveOtherPara(void);
void TransOneRecord(file_record *target,file_record *source_record);
void ShowDirectory( unsigned char  top, unsigned char  bottom, unsigned char  Old_active, unsigned char  active, unsigned char  string_id, unsigned char  Disk);

extern  unsigned short  count_dir_num(void);
extern void Initdirbuf(void);
extern void Setdirbuf( unsigned short  n);
extern  unsigned short  Getdirbuf( unsigned short  n);

file_record temp_record;
 unsigned short  dir_total_num,file_total_num,list_total_num,list_active,cur_group; 

file_record OnePageRecord[ 6 ];
char dirbuf[125];

const char Ui_IgnoreExt[4] = {"*  "};






void GetLongNameAndSave(char *Namebuf,char *LongNamebuf, unsigned char  string_id)
{
 unsigned char  NameNum;
memcpy(LongNamebuf,Namebuf,11);
memcpy(temp_record.name,Namebuf,12);
NameNum=FS_GetName(LongNamebuf,24);
if(NameNum!=0)
{
unitochar(LongNamebuf,NameNum*2+2,string_id);
memcpy(temp_record.longname,LongNamebuf,50); 
}
else
memcpy(temp_record.longname,Namebuf,12); 
}


void SaveOtherPara(void)
{
memcpy(temp_record.dirno,fselDirNo,8); 
temp_record.fileno=fselFileNo; 
temp_record.fselExtNo=fselExtNo; 
temp_record.dirlayer=fselDirLayer; 
}


void TransOneRecord(file_record *target,file_record *source_record)
{
 unsigned char  status;
status = input8(0x05);
output8(0x05, 0xf6);

target->filetype=source_record->filetype; 
memcpy(target->dirno,source_record->dirno,8); 
target->fileno=source_record->fileno; 
target->fselExtNo=source_record->fselExtNo; 
target->dirlayer=source_record->dirlayer; 
memcpy(target->name,source_record->name,12);
memcpy(target->longname,source_record->longname,50);

output8(0x05, status);
}




void ShowDirectory( unsigned char  top, unsigned char  bottom, unsigned char  Old_active, unsigned char  active, unsigned char  string_id, unsigned char  Disk)
{
 unsigned char  i,tmp;

DC oldDC_sav;
GetDCStatus(&oldDC_sav);

SetTextOutMode(1);
SetPenColor( 0x0000ffff );
if(Old_active!=active)
{


tmp = Old_active% 6 ;
ResShowPic(file_bck_pic[tmp],  9 , file_pos[tmp]-4);

ResShowPic( 45 ,194,8);


tmp = active% 6 ;
TransOneRecord(&temp_record,&OnePageRecord[tmp]); 
if(temp_record.filetype== 1 )
ResShowPic( 121 ,13,file_pos[tmp]-1);


else if(temp_record.filetype== 0 )
{
ResShowPic( 91 ,10,file_pos[tmp]-4);
}

ResShowPic( 50 ,  32 -1, file_pos[tmp]-4);

ResShowPic( 46 ,194, file_pos[tmp]+5);

SetTextPos( 32 , file_pos[tmp]-2);
SetPenColor( 0x0000ffff );
PutS(temp_record.longname,-1);


tmp = Old_active% 6 ;
TransOneRecord(&temp_record,&OnePageRecord[tmp]); 
if(temp_record.filetype== 1 )
ResShowPic( 121 ,13,file_pos[tmp]-1);
else if(temp_record.filetype== 0 )
{
{
ResShowPic( 91 ,10,file_pos[tmp]-4);
}
}
SetPenColor( 0x0000ffff );
SetTextPos( 32 , file_pos[tmp]-2);
PutS(temp_record.longname,-1); 
}

else 
{

SetTextOutMode(1);
ResShowPic( 109 ,0,0); 
if(!Disk) 
ResShowMultiString(  300 ,string_id,  22 ,  148 ); 
else 
ResShowMultiString(  301 ,string_id,  22 ,  148 ); 

for(i=top;i<=bottom;i++)
{
if(i==active)
{
ResShowPic( 50 ,  32 -1, file_pos[i-top]-4);

ResShowPic( 46 ,194, file_pos[i-top]+5);
SetPenColor( 0x0000ffff );
}

else
SetPenColor( 0x0000ffff );

output8(0x4e,input8(0x4e) | 0x08);
TransOneRecord(&temp_record,&OnePageRecord[i-top]); 
if(temp_record.filetype== 1 )

ResShowPic( 121 ,13,file_pos[i-top]-1);

else if(temp_record.filetype== 0 )
{
{
ResShowPic( 91 ,10,file_pos[i-top]-4); 
} 
}
SetTextPos( 32 , file_pos[i-top]-2);
PutS(temp_record.longname,-1); 
}
}
SetPenColor(oldDC_sav.PenColor);
SetBackgdColor(oldDC_sav.BackgdColor);
}












void init_dir_buf(void)
{
 unsigned short  i, tmp, total;
char Backbuf[32];
 unsigned char  direxist;

Initdirbuf(); 
tmp = 1;

FS_Backup(Backbuf, 2 ,0);
dir_total_num=count_dir_num();
file_total_num=GetFileTotalCur( 0 );
list_total_num=dir_total_num+file_total_num+1;
fselTotal=file_total_num;

for(i = 1; i <= dir_total_num; i++)
{
while(1)
{
if(tmp == 1)
FS_Dir(file_name, Ui_IgnoreExt,  0x81 );
if(tmp > 1)
FS_Dir(file_name, Ui_IgnoreExt,  0x01 );
tmp++;
FS_Backup(Backbuf, 2 ,0);
total = GetFileTotal(file_name,  1 );
FS_CD(file_name);
if (ToDirEntry(file_name,1))
{
direxist=1;
}
else
{
direxist=0;
}
output8(0x4e,input8(0x4e)|0x8);
FS_CD("\\");

FS_Restore(Backbuf, 2 ,0);
output8(0x4e,input8(0x4e)|0x08); 
if((total != 0)||(direxist))
{
break;
}
}
Setdirbuf( tmp - 1 );
}
FS_Restore(Backbuf, 2 ,0);
}


 unsigned char  get_dir_name(char *file,  unsigned short  num)
{

 unsigned short  m, tmp,total_file;
if(num>dir_total_num)
return 0;
if(num == 0) 
{
if(fselDirLayer==0)
{
file[0] = 'R';
file[1] = 'O';
file[2] = 'O';
file[3] = 'T';
file[4] = 0;
}
else
{
file[0] = '\\';
file[1] = 0;
}
fselDirNo[fselDirLayer]=0;
return 1;

}
else
{
tmp=0;
tmp = Getdirbuf(num);

fselDirNo[fselDirLayer]=tmp;

if(tmp > 0)
{
FS_Dir(file, Ui_IgnoreExt,  0x81 );
for(m = 2; m <= tmp; m++)
FS_Dir(file, Ui_IgnoreExt,  0x01 );
}
return 1;
}
}


void DecodeOnePage( unsigned short  top, unsigned short  bottom, unsigned char  type,  unsigned char  string_id)
{
 unsigned short  i,NameNum,temp;
char Longnamebuf[50];
temp=fselTotal;
fselTotal=GetFileTotalCur( 0 );
for(i = top; i <= bottom; i++)
{
if(i>dir_total_num) 
{
fselGetByNO(file_name, (i - dir_total_num ));
temp_record.filetype=  1 ;
}
else 
{
get_dir_name(file_name, i );
temp_record.filetype=  0 ;
}
GetLongNameAndSave(file_name,Longnamebuf,string_id); 
SaveOtherPara(); 

TransOneRecord(OnePageRecord+i-top,&temp_record); 
}
fselTotal=temp;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -