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

📄 ui_follow.i

📁 炬力方案176*132软件源码,适用于AK1025
💻 I
📖 第 1 页 / 共 4 页
字号:
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  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,char mode);
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);
 unsigned char  Count_Byte(char *str,char language); 

void Scroll(char *scrollstr, char language);
void ScrollInit( char * scrollstr, char language); 
void ScrollString( char * scrollstr,  unsigned char  mode ,char language,region_t *scroll); 

































typedef enum
{
MusicEditSelSta_NoSel,
MusicEditSelSta_WaitStart,
MusicEditSelSta_WaitEnd,
MusicEditSelSta_SelFinish
}EMU_MusicEditSelStatus;

typedef enum
{
MusicEditSta_NoFun,
MusicEditSta_SelSeg,
MusicEditSta_DelSeg
}EMU_MusicEditStatus;


typedef struct
{
long StartSec;
long EndSec;
file_location_t *location; 
time_t *StartTime;
time_t *EndTime;
}STRU_SelMusicSegment; 

typedef struct
{

char Disk; 
long ClusterNo; 
char FileName[12]; 

long StartSec;
long EndSec;

time_t StartTime; 
time_t EndTime;

 unsigned char  bSelected;
}STRU_MusicSegment; 

typedef struct
{
int EditCommand; 
int EditCmdPara; 
int SelSegmemtCount; 
int CurSelSegmemtNO; 
STRU_MusicSegment CurMusicEditSeg; 
STRU_MusicSegment SelMusicEditSeg[ 12 ];
int CheckSum; 
}STRU_MusicEditIniFile; 


 unsigned char  SaveSelSegment(STRU_SelMusicSegment *SelSeg);
 unsigned char  SetDealCommamd(STRU_SelMusicSegment *CurSeg,int Cmd,int CmdPara);
 unsigned char  DeleteAllSelSegment();
 unsigned char  CreateMEIniFile();


 unsigned char  ReadMusicEditIniFile(STRU_MusicEditIniFile *pIniFile);
 unsigned char  WriteMusicEditIniFile(STRU_MusicEditIniFile *pIniFile);

 unsigned char  DeleteSelSegment(STRU_MusicEditIniFile *pIniFile,int SelIndex);
 unsigned char  DeleteSelSegmentBySegNo(STRU_MusicEditIniFile *pIniFile,int SegNo);
 unsigned char  ExchangeSelSegment(int SegNo1,int SegNo2,STRU_MusicEditIniFile *pIniFile);


 unsigned char  DeleteMusicSegment(STRU_MusicSegment *MusicFile);
 unsigned char  InsertMusicSegment(STRU_MusicSegment *dMusicFile,STRU_MusicSegment *sMusicFile, unsigned char  mode);
void CreateNewMusicFileName(char *sFileName);

















typedef enum
{
MP3Play, 
WMAPlay, 
ACT, 
AG4, 
AG8 
}

MusicMode_t;

typedef enum
{
NormalPlay, 
WaitSetAPointForAB, 
WaitSetBPointForAB, 
ABLoopPlay, 
FollowRec,
FollowAB,
ComparePlay,
CompareAB
}Replay_status_t;

typedef enum
{
StopSta, 
PauseSta, 
PlaySta, 
FFPlaySta, 
FBPlaySta 
}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_OGG,
Music_APE
}Music_type_t;

typedef enum
{
Stop_key,
Play_play,
Play_key,
list_key
}Music_sel_mod_t;

typedef enum
{ 
mplaylist,
martists,
malbum,
mgenre,
mcomposers,
mlistnor
}play_listmod_t;




typedef struct
{
 unsigned char  Wow;
 unsigned char  Bass;
 unsigned char  Srs;
}SRSMod_t; 


typedef struct
{
signed char volume; 
Repeat_Mode_t repeat_mode; 
eq_t eq_type; 
signed char play_rate; 
 unsigned char  replaytimes; 
 unsigned char  replaygap; 
Open_mod_t MusicOpenMod; 
file_location_t location; 
breakPT_t BreakPTSave; 
time_t BreakPTDisTime; 
play_listmod_t play_listmod;
 unsigned char  fselmod; 
 unsigned char  PLmod; 
SRSMod_t SRSMod;
unsigned int file_list_total_flash; 
unsigned int file_list_total_card; 
unsigned int file_list_num; 
char file_list_type; 
 unsigned short  magic; 
} music_vars_t;
typedef struct
{
 unsigned short  magic; 
file_location_t location; 
}browser_vars_t;

typedef struct
{ 
 unsigned char  Bitrate_sav[3]; 
 unsigned char  TotalTime_sav[3]; 
} TimeRateData_sav_t;


typedef struct
{
 unsigned short  HeadIcon;
 unsigned short  HeadStr;
char *string;
}dialog_t;




extern music_vars_t g_music_vars;
extern Replay_status_t RePlayStatus;
extern Play_status_t PlayStatus;
extern  unsigned short  UpDisplayFlag;
extern int g_result; 


extern pop_up_list_t list;
extern slider_t slider;
extern  unsigned char  g_currentMusicType;
extern  unsigned short  g_musicamount;
extern  unsigned short  g_musicsequence;
extern  unsigned char  g_replaytimes;
extern  unsigned char  g_replaypause;
extern  unsigned char  g_ScrollFlag;
extern  unsigned char  g_lyricflag;
extern  unsigned short  g_2HZ_CNT;
extern  unsigned char  g_2HZFlag;
extern  unsigned short  g_ABPointTimeSize;
extern char g_TagInfoBuf[];
extern char g_TagInfoBuf1[];
extern region_t scrollscreensize;

extern  unsigned char  g_ifAVflag;
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 comval_t g_comval;

extern  unsigned char  g_ReplayTimeCNT;
extern char temp_buffer[9];
extern TimeRateData_sav_t TimeRateData_sav;

extern char g_FadeInStatusFlag;
extern  unsigned char  g_FadeInStepFlag;
extern  unsigned char  g_AVSetFlag;
extern  unsigned char  g_PAOpenFlag;
extern  unsigned char  g_ABMinTimeCNT;
extern Open_param_t g_Openparam;
extern  unsigned char  g_CardInFlag;
extern  unsigned char  g_DiskStateFlag;
extern  unsigned char  g_PowerOffFlag;
extern  unsigned char  MotivePosion0;
extern  unsigned char  MotivePosion1; 
extern  unsigned char  ifSelBuffToltalTimeFlag;
extern  unsigned char  CaltimeFlag;
extern char WaitForCaltimeCNT; 
extern char savenum;
extern  unsigned char  g_from_browser;
extern unsigned int g_file_list_total;
extern int g_autoswitch_counter;

extern void Reset_USERPL();
extern  unsigned char  Add_UserPL(file_location_t *location);
extern  unsigned char  user_pl_del( unsigned short  offset);
extern  unsigned char  WrHead_PL(char ClearFlag);

extern  unsigned short  FirstOffset; 
extern  unsigned short  LastOffset; 
extern  unsigned short  PlaylistCount; 
extern  unsigned char  need_WPL;
extern  unsigned char  bList_Flag;
extern int ui_userplaylist(file_location_t *location,char type);









void PASS_KEY(int DATA);



non_banked void Music_timeint( void );
non_banked void Music_2HZint( void );
void volume_callback( int );
void speed_callback( int );
void eq_callback( int );

int ui_SRS_menu( void );
void srs_callback( int srs );
void bass_user_callback(int bass_user);
void srs_user_callback(int srs_user);
void wow_user_callback(int wow_user);
void send_user_srs();

void loop_callback( int );



int ui_stop( void );
int ui_play( void );
int ui_lyric( void );
int ui_play_menu( void );
int ui_stop_menu( void );
int ui_EQ_menu( void );
int ui_SRSUSER_menu(void);
int ui_loop_menu( void );
int ui_follow_compare( void );
int ui_followAB( void ); 
int ui_followRec( void ); 
int ui_compareAB( void ); 
int ui_comparePlay( void ); 



int RealDisplay( void );
void ShowNowTime( unsigned char  mod); 
void RefreshMainScreen( void );


void Show_Bitrate( void ); 
void DisplayErrMsg(int ErrMsg);
void Show_MusicType(void);



Music_type_t CheckMusicType( char * filename );
int play_key_next( int key );
int play_key_prev( int key );
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  musicpSendCommand_bank(  unsigned char  cmd, int param );

 unsigned char  DealErrCase( void );
int ChangeVolume( void );
int DealMusicFileEnd( char DisMod );
int DealPlayKey( void );
void CheckVolumeLimit( void ); 
void CheckPlayrateLimit( void ); 
void CheckReplaygapLimit( void ); 
void CheckReplaytimesLimit( void ); 
void BackupCurrentTime(void); 
void FadeInOutFun(void);
void FadeOut(  unsigned char  DisMod );
int PrevMusicInPlay(void);
void ClearTimePara(void);
void DealForABGap(music_play_status_t *status);
void ClosePA(void);
void openPA( unsigned char  volume);
void DisplayErrInfor(int id);
int InitFileSelector(void);
int StartFileSelector(void);
int UpdateFileSelector(void);

void ErrReport(Play_status_t status); 

void FlashMotived( unsigned char  value); 





























extern char return_to_play; 
extern  unsigned char  Replaytimes_CNT; 
extern  unsigned char  ReturnNotInit; 
extern  unsigned short  ABPointTimeSize;
extern  unsigned char  g_FCexitflag;

void DealForExitRec( void ); 
void Show_time_FC( void );
void OpenMusic( void );

extern char g_volcounter;
extern  unsigned char  g_rSetPlayStatus;



int ui_followRec( void )
{
int key;
long DiskSpace;
 unsigned int  TempFileHandle;
 unsigned char  LowBatt_CNT = 0;
int result;

if (++Replaytimes_CNT > g_music_vars.replaytimes)
{
FS_FRemove( "$$TEMP$$WAV" ); 
OpenMusic();
RePlayStatus = ABLoopPlay;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
return  0 ;
}


FS_FRemove( "$$TEMP$$WAV" ); 
DiskSpace = FS_GetSpace(1);



if( DiskSpace <= 200 )
{
DisplayErrMsg( 511 );
OpenMusic();
RePlayStatus = ABLoopPlay;

 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
return  0 ;
}

TempFileHandle = FS_FCreate( "$$TEMP$$WAV" );
if( TempFileHandle ==  0  )
{
switch ( FS_GetInfo() )
{
case  6 : 
DisplayErrMsg( 511 );
break;
case  7 : 
DisplayErrMsg( 537 );
break;

default:
break;
}
OpenMusic();
RePlayStatus = ABLoopPlay;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
return  0 ;
}
{
char *i;
i = (char *)0x1000;
FS_FWrite(i, 1, TempFileHandle);
}
FS_FClose( TempFileHandle );
FS_FRemove( "$$TEMP$$WAV" );



g_result = GetBattery();
if(g_result <=  5 )
{
DisplayErrMsg(  536  );
OpenMusic();

RePlayStatus = NormalPlay;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
return  0 ;
}


ui_run_realtime =  1 ;

BankSwitch((unsigned long)wavrSendCommand >> 16);
wavrSendCommand( 0x01 ,  0 );
if( !wavrSendCommand( 0x03 , (int) "$$TEMP$$WAV" ) )
{
DisplayErrMsg(  511  );
OpenMusic();
RePlayStatus = ABLoopPlay;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
return  0 ;
}


while (ap_get_message() != 0);

wavrSendCommand( 0x08 ,  0 );
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
g_2HZ_CNT = 0;


while (1)
{
result = wavrProceed();


if( result == 1 )
{
if( DiskSpace-- <= 200 )
{
DealForExitRec();
DisplayErrMsg( 511 );
RePlayStatus = FollowAB;

return_to_play=1; 
return  0 ;
}
}
else if ( result == -1 )
{
DealForExitRec();
DisplayErrMsg( 508 );
OpenMusic();
RePlayStatus = NormalPlay;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
return  0 ;
}



if (need_draw)
{
Show_time_FC(); 
RefreshMainScreen();
need_draw =  0 ;
}

key = ap_get_message();

switch (key)
{
case  29 :
break;

case  0x01  |  0x20 : 
DealForExitRec();
RePlayStatus = NormalPlay;


g_FCexitflag =  1 ;
OpenMusic();



 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
return  100 +3 ; 

case  0x11  |  0x20 :
case  0x06  |  0x20 : 
DealForExitRec();
RePlayStatus = CompareAB;


return  0 ;

case  0x10  |  0x20 : 
DealForExitRec();
OpenMusic();
RePlayStatus = NormalPlay;
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
return  0 ;

case  0x05  |  0x20 : 
DealForExitRec();
OpenMusic();
RePlayStatus = ABLoopPlay;

 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
return  0 ;

case  28 :
g_result = GetBattery();
if ( g_result <=  5  )
{
if ( ++LowBatt_CNT >  5  )
{
DealForExitRec();
DisplayErrMsg( 536 );
OpenMusic();

RePlayStatus = NormalPlay;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
return  0 ;
}
}
else
{
LowBatt_CNT = 0;
}

UpDisplayFlag = UpDisplayFlag |  0x0200 ;
Show_time_FC();

ui_show_batt( GetBattery(), g_comval.BatteryType,0);
break;

default:
key = ap_handle_hotkey(key);
if (key ==  50 )
{
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
return_to_play=1;
need_draw =  1 ;
}
else if (key != 0)
{
DealForExitRec();
RePlayStatus = NormalPlay;

g_FCexitflag =  1 ;
OpenMusic();


 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
return key;
}
break;
} 
if (g_2HZ_CNT > ABPointTimeSize) 
{
DealForExitRec();
RePlayStatus = FollowAB;

return  0 ;
}
} 
} 




int ui_followAB( void )
{
int key;

wma_play_status_t status_buf;

if (!ReturnNotInit)
{
OpenMusic();
}
ReturnNotInit =  0 ;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;

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

key = ap_get_message();

switch (key)
{
case  29 :
break;

case  0x01  |  0x20 :
{ 
g_volcounter = 0;
g_rSetPlayStatus =  1 ;
}
g_result = DealPlayKey();
if (g_result != 0)
{
return g_result;
}
return  100 +2 ;

case  0x11  |  0x20 :
case  0x06  |  0x20 :
ReturnNotInit =  1 ; 
RePlayStatus = CompareAB;
return  0 ;

case  0x10  |  0x20 :
RePlayStatus = NormalPlay;
return  0 ;

case  0x05  |  0x20 :
RePlayStatus = ABLoopPlay;
return  0 ;

case  0x03 :
case  0x04 :
ChangeVolume();

need_draw =  1 ;
break;

case  28 :
UpDisplayFlag = UpDisplayFlag |  0x0200  ;
Show_time_FC(); 
ShowNowTime( 1 );
ui_show_batt( GetBattery(), g_comval.BatteryType,0);
break;

default:
key = ap_handle_hotkey(key);
if (key ==  50 )
{
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
return_to_play=1;
need_draw =  1 ;
}
else if(key != 0)
{
return key;
}
break;
}

musicpSendCommand( 0x83 , (int)& status_buf);
if (status_buf.signal ==  0x02 )
{
Show_time_FC(); 
RefreshMainScreen();
need_draw =  0 ;

musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x02 ,  0 );
RePlayStatus = FollowRec;
return  0 ;
}
}
}

⌨️ 快捷键说明

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