📄 ui_stop_menu.i
字号:
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 LcmWidth;
unsigned char LcmHeigh;
unsigned char RScale;
unsigned char GScale;
unsigned char BScale;
unsigned char RGBOrder;
} ColorLcmInfor;
typedef struct {
long AmvFileFLashDot;
unsigned char TimeSec;
unsigned char TimeMin;
unsigned char TimeHou;
unsigned char Reserve;
} AmvFileBreakPntInfor;
extern unsigned char AmvViewOrder;
unsigned char AmvDecSetCMD( unsigned char cmd,int param);
char AmvDecStart(ColorLcmInfor *PicInfor, unsigned int fp,AmvFileBreakPntInfor *BreakInfor);
signed char AmvDecModPolling(void);
non_banked void AmvViewInit( unsigned int fp);
non_banked void AmvViewInit( unsigned int fp);
non_banked void AMVPicSetParament(ColorLcmInfor *infor);
non_banked void AmvViewExit(void);
non_banked void DscDecoderMsg(void);
non_banked void ReadOnePageFromDisk(void);
typedef enum
{
StopSta,
PauseSta,
PlaySta,
FFPlaySta,
FBPlaySta,
NextPlaySta,
PrevPlaySta,
HotkeyPlaysta
}Play_status_t;
typedef enum
{
LoopNor,
LoopOne,
LoopOneDir,
LoopDir,
LoopAll,
Random,
Intro,
MaxRepeatMod
}Repeat_Mode_t;
typedef enum
{
Music_NON,
Music_MP3,
Music_WMA,
Music_ASF,
Music_WMV,
Music_MTV
}Music_type_t;
typedef enum
{
Stop_key,
Play_play,
Play_key
}Music_sel_mod_t;
typedef struct
{
unsigned short magic;
char volume;
Repeat_Mode_t repeat_mode;
eq_t eq_type;
file_location_t location;
AmvFileBreakPntInfor amvfilebreakpoint;
}amv_vars_t;
extern amv_vars_t g_amv_vars;
extern comval_t g_comval;
extern Play_status_t PlayStatus;
extern int g_result;
extern function_menu_t menu;
extern slider_t slider;
extern unsigned char g_currentMusicType;
extern unsigned char g_musicamount;
extern unsigned char g_musicsequence;
extern unsigned char BufferFullFlag;
extern unsigned char BufferStart;
extern unsigned short g_2HZ_CNT;
extern unsigned char g_2HZFlag;
extern char g_TagInfoBuf[66];
extern char g_TagInfoBuf1[];
extern region_t mainscreensize;
extern unsigned char need_draw;
extern unsigned char g_volume;
extern unsigned char g_introCntMode;
extern unsigned char g_OldSecTempBackup;
extern unsigned char g_introCNT;
extern char temp_buffer[9];
extern const region_t region_msg;
extern unsigned char g_PAOpenFlag;
extern unsigned char g_langid ;
extern unsigned char g_BatteryType;
extern time_t Totaltime;
extern unsigned int fp;
extern int Total_time;
extern int Current_time;
extern unsigned char g_changevolume;
void read_var( void );
void openDAC(void);
int ui_stop( void );
int ui_play( void );
int ui_stop_menu( void );
int ui_loop_menu( void );
extern int InitFileSelector(void);
extern UpdateFileSelector(void);
int RealDisplay( void );
void ShowNowTime( unsigned char para);
void RefreshMainScreen( void );
void Scroll( char *, unsigned char , char );
void Show_Bitrate( void );
void DisplayErrMsg(int ErrMsg);
void Show_MusicType(void);
Music_type_t CheckMusicType( char * filename );
int ToNextMusic( Music_sel_mod_t mod );
int GetInformation( void );
int GetInformation1( void );
unsigned char ChangeMusic( unsigned char Direct, Music_sel_mod_t mod );
void SelectCurMusic(void);
unsigned char musicpSendCommand( unsigned char , int);
unsigned char DealErrCase( void );
int DealMusicFileEnd( char DisMod );
int PrevMusicInPlay(void);
void ClearTimePara(void);
void openPA(char volume);
int show_volume( unsigned char set_hardware);
void vol_callback(int value);
void ui_show_t(const char *string, unsigned char part);
const unsigned short dir_string_card[6] =
{
281 , 282 , 283 , 284 , 286 , 285
};
const unsigned short repeat_string[7] =
{
309 , 310 , 311 , 312 , 313 , 314 , 315
};
const unsigned short dir_string[5] =
{
281 , 283 , 284 , 286 , 285
};
void CheckIfCardOK(void);
unsigned char g_CardInFlag;
extern void make_dirname(void);
extern unsigned char g_menu_active;
extern unsigned char g_DiskStateFlag;
int ui_delete_amv( int type )
{
DRV_ActiveUD(0, 0x01 );
g_result=ui_delete(& g_amv_vars.location, type, g_langid);
if (g_result == 54 )
{
g_amv_vars.location.disk = 'C';
return 52 ;
}
if (g_result != 0)
{
return g_result;
}
ChangeMusic( 3 , 1);
fselGetLocation(& g_amv_vars.location);
return 0;
}
int ui_loop_menu( void )
{
pop_up_list_t list;
list.strid = ( unsigned short *)repeat_string;
list.total = MaxRepeatMod;
list.active = g_amv_vars.repeat_mode;
list.string_id = g_langid;
list.headid= 286 ;
g_result = ui_popup_list(&list, 0 );
if (g_result != 52 )
{
g_amv_vars.repeat_mode = list.active;
}
return g_result;
}
int ui_stop_menu( void )
{
pop_up_list_t list;
int result;
static char StopMenuactive=0;
CheckIfCardOK();
list.headid = 490 ;
if (g_CardInFlag)
{
list.total = sizeof(dir_string_card) / 2;
list.strid = dir_string_card;
}
else
{
list.total = sizeof(dir_string) / 2;
list.strid = dir_string;
if (StopMenuactive >= list.total)
{
StopMenuactive--;
}
}
list.string_id = g_langid;
list.active = StopMenuactive;
result = ui_popup_list(&list, 0 );
StopMenuactive = list.active;
if (g_CardInFlag)
{
if (DRV_DetectUD(1) != 0x20)
{
g_CardInFlag=0;
ui_err_msg( 401 , 401 ,g_langid);
g_amv_vars.location.disk = 'C';
return 54 ;
}
}
if (result != 0)
{
return result;
}
BankSwitch((unsigned long) fselInit >> 16);
fselGetLocation(& g_amv_vars.location);
if(!g_CardInFlag)
{
switch (list.active)
{
case 0:
if (g_amv_vars.location.disk == 'H')
{
g_amv_vars.location.disk = 'C';
fselInit ( 5 , 0 , 0 ,g_amv_vars.location.disk);
fselGetLocation(&g_amv_vars.location);
}
result=ui_directory(&g_amv_vars.location, 5 , g_langid);
fselSetMode ( 0 );
BankSwitch((unsigned long)AmvDecStart>>16);
g_menu_active= 0 ;
break;
case 1:
result = ui_delete_amv( 0 );
break;
case 2:
fselSetMode ( 4 );
result = ui_delete_all(&g_amv_vars.location, 3 , g_comval.langid);
fselSetMode (g_amv_vars.repeat_mode);
break;
case 3:
result = ui_loop_menu();
if(result==0)result= 52 ;
break;
default:
result = 52 ;
break;
}
}
else
{
switch (list.active)
{
case 0:
if (g_amv_vars.location.disk == 'H')
{
g_amv_vars.location.disk = 'C';
fselInit ( 5 , 0 , 0 ,g_amv_vars.location.disk);
fselGetLocation(&g_amv_vars.location);
}
result=ui_directory(&g_amv_vars.location, 5 , g_langid);
fselSetMode ( 0 );
BankSwitch((unsigned long)AmvDecStart>>16);
g_menu_active= 0 ;
break;
case 1:
if (g_amv_vars.location.disk == 'C')
{
g_amv_vars.location.disk = 'H';
result= fselInit ( 5 , 0 , 0 ,g_amv_vars.location.disk);
if(!result)
{
g_amv_vars.location.disk = 'C';
g_DiskStateFlag=g_DiskStateFlag& 0xf7 ;
ui_show_msg ( 404 , 404 , g_langid);
break;
}
g_DiskStateFlag=g_DiskStateFlag| 0x08 ;
fselGetLocation(&g_amv_vars.location);
}
result = ui_directory(&g_amv_vars.location, 5 , g_langid);
fselSetMode ( 0 );
BankSwitch((unsigned long)AmvDecStart>>16);
g_menu_active= 0 ;
if (result == 54 )
{
ui_err_msg( 401 , 401 ,g_langid);
g_amv_vars.location.disk = 'C';
result = 54 ;
}
break;
case 2:
result = ui_delete_amv( 0 );
break;
case 3:
fselSetMode ( 4 );
result = ui_delete_all(&g_amv_vars.location, 3 , g_comval.langid);
fselSetMode (g_amv_vars.repeat_mode);
break;
case 4:
result = ui_loop_menu();
if(result==0)result= 52 ;
break;
default:
result = 52 ;
break;
}
}
if (result == 52 )
{
result = 0;
}
if (result != 0)
{
return result;
}
ClearTimePara();
return 0;
}
void CheckIfCardOK(void)
{
char i;
i = DRV_DetectUD(1);
if (i == 0x20)
{
g_CardInFlag = 1;
}
else
{
g_CardInFlag = 0;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -