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

📄 ui_stop.i

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

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);





extern comval_t g_comval; 
extern  unsigned char  ActiveDriveOK;
extern  unsigned char  g_menu_active; 
int ui_stop_loop(void);
extern void make_dirname(void);








int time_cmp(const AmvFileBreakPntInfor *time1, const time_t *time2)
{
if(time1->TimeHou == time2->hour)
{
if(time1->TimeMin == time2->minute)
{
if(time1->TimeSec == time2->second)
{
return 0;
}
else
{
return ((int)(time1->TimeSec) - time2->second);
}
}
else
{
return ((int)(time1->TimeMin) - time2->minute);
}
}
else
{
return ((int)(time1->TimeHou) - time2->hour);
}
}

int ui_stop(void)
{
ap_message_init( 0 );
g_menu_active= 1 ;
do
{
if (UpdateFileSelector() == 0)
{
return 0;
}


g_musicamount =  fselGetTotal (); 
if(g_musicamount==0)
{

while( ap_get_message() !=  0  );
return ui_show_msg ( 402 ,  402 , g_langid);

}

g_musicsequence =  fselGetNo ();
 fselSetMode ( 4 );
fselGetLocation(& g_amv_vars.location); 
make_dirname(); 
g_currentMusicType = CheckMusicType(g_amv_vars.location.filename);

g_result =  fselGetNextFile (g_amv_vars.location.filename); 
fselGetLocation(& g_amv_vars.location); 
GetInformation(); 
memcpy(g_TagInfoBuf1, g_TagInfoBuf, 20);

g_TagInfoBuf1[20]=0;
g_result =  fselGetPrevFile (g_amv_vars.location.filename); 
fselGetLocation(& g_amv_vars.location); 
GetInformation(); 

PlayStatus = StopSta;
need_draw =  1 ;
 fselSetMode (g_amv_vars.repeat_mode);
g_result = ui_stop_loop();

}while( (g_result ==  0 )
|| (g_result ==  100 +2 )
|| (g_result ==  100 +3 ) );
if (g_result ==  100 +1 )
{
return  0 ;
}
return g_result;
}


int ui_stop_loop()
{
char key;
int result;

if(time_cmp(&g_amv_vars.amvfilebreakpoint,
&Totaltime) > 0)
{
ClearTimePara();
}

while (1)
{
if (need_draw)
{
RefreshMainScreen();
need_draw =  0 ;
}

key = ap_get_message();

switch (key)
{
case  0x01  |  0x80 :
return  2 ;
break;

case  0x01  |  0x20 :
ui_run_realtime =  1 ;

{


VMRead(& g_comval,  0x0200 , sizeof(g_comval));
g_comval.LightTime = 0;
SetContrast(g_comval.DisplayContrast);
ap_message_init(&g_comval);
SetBackgdColor( 0x00000000 );
g_result = ui_play();
SetBackgdColor( 0x0000fcc0 );
VMRead(& g_comval,  0x0200 , sizeof(g_comval));
ap_message_init(&g_comval);
} 



if(g_comval.langid == 0) 
{
if(!DRV_Install("UI_S0724.DRV",1)) while(1) {;}
}
else if(g_comval.langid == 2) 
{
if(!DRV_Install("UI_T0724.DRV",1)) while(1) {;}
}
else if(g_comval.langid ==  1 ) 
{
if(!DRV_Install("UI_L0724.DRV",1)) while(1) {;} 
}

else 
{
if(!DRV_Install("UI_S0724.DRV",1)) while(1) {;}
}

StandbyScreen( 1 );
SetBackgdColor( 0x00000000 );
SetContrast(g_comval.DisplayContrast); 


ap_message_init( 0 );
ui_run_realtime =  0 ;
if(g_result==0) 
{ 
need_draw= 1 ; 
return g_result;
}

else if(g_result== 100 +3 ) 
{

output8(0x27,input8(0x27)&0xfe); 
ui_show_msg ( 401 ,  401 , g_langid); 
while( ap_get_message() !=  0  ); 
ap_sleep(4);
need_draw =  1 ; 
return g_result; 

}

else return g_result;

case  0x10 : 
g_menu_active= 1 ; 
break; 
case  0x10  |  0x20 : 
if(g_menu_active)
{
g_result = ui_stop_menu();

if (g_result ==  54 )
{
return  0 ;
}
if (g_result ==  52 )
{
need_draw =  1 ;
break;
}
return g_result;
}
else
g_menu_active= 1 ;
break;





case  0x05  |  0x20 :
while(ap_get_message() != 0);
break;

case  0x05 :
case  0x05  |  0x40 :
if (g_changevolume&0x01)
{
g_changevolume|=0x3f;

}
memcpy(g_TagInfoBuf1, g_TagInfoBuf, 20);

g_TagInfoBuf1[20]=0;
g_result = ChangeMusic( 4 , Stop_key);
GetInformation(); 
need_draw =  1 ;

while(ap_get_message() != 0);
break;

case  0x06  |  0x20 :
while(ap_get_message() != 0);
break;

case  0x06 :
case  0x06  |  0x40 :

g_result = ChangeMusic( 3 , Stop_key);
GetInformation(); 
g_result = ChangeMusic( 3 , Stop_key);
GetInformation(); 
memcpy(g_TagInfoBuf1, g_TagInfoBuf, 20);

g_TagInfoBuf1[20]=0;
g_result = ChangeMusic( 4 , Stop_key);
GetInformation(); 
need_draw =  1 ;
while(ap_get_message() != 0);
break;

case  0x03 :
case  0x03  |  0x40 :



case  0x04 :
case  0x04  |  0x40 :
result = show_volume( 0 );
if(result != 0) return result;
need_draw =  1 ;
break;



case  28 :
case  27 :
ui_show_batt(GetBattery(), g_BatteryType,0);

break;
case  55 :
if (g_amv_vars.location.disk == 'H')
{
g_amv_vars.location.disk = 'C';
ui_err_msg( 401 , 401 ,g_langid);
return  0 ;
}
break;
default:
key = ap_handle_hotkey(key);
if (key ==  50 )
{
need_draw =  1 ;
}
else if (key != 0)
{
return key;
}
break;
} 
} 
}


⌨️ 快捷键说明

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