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

📄 sub_function1.i

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


void FadeOut(  unsigned char  DisMod );
void DisInFBHead(char DisMod);
void DisInFFEnd(char DisMod);
int ui_licensinf(int string_id);
extern void make_dirname(void);
extern void srs_default_set(void); 
extern  unsigned char  SRSModeFlag;
extern int select_music_list( unsigned char  Direct); 

void DisInFBHead(char DisMod)
{
if (DisMod == 0)
{
temp_buffer[0] = '0';
temp_buffer[1] = '0';
temp_buffer[3] = '0';
temp_buffer[4] = '0';
temp_buffer[6] = '0';
temp_buffer[7] = '0';
ui_show_d(temp_buffer,0);
}
else
{
main_ResShowPic( 160 ,  (176-15) ,  (132-11) );
}
return;

}

void DisInFFEnd(char DisMod)
{
if(DisMod == 0)
{
wma_play_status_t status_buf;
musicpSendCommand( 0x83 , (int)(& status_buf));
itoa_2(status_buf.total_time.hour, &temp_buffer[0]);
strcat(temp_buffer,":");
itoa_2(status_buf.total_time.minute, &temp_buffer[3]);
strcat(temp_buffer,":");
itoa_2(status_buf.total_time.second, & temp_buffer[6]);
ui_show_d(temp_buffer,0);
}
else
{
main_ResShowPic( 159 ,  (176-15) ,  (132-11) );
}
return;
}


int DealMusicFileEnd( char DisMod)
{
wma_play_status_t status_buf;

int key;

need_draw =  1 ;

if (PlayStatus == FBPlaySta)
{
DisInFBHead( DisMod );
while ( ap_get_message() != ( 0x05  |  0x20 ) );
SelectCurMusic();

}
else if (PlayStatus == FFPlaySta)
{
DisInFFEnd( DisMod );
while ( ap_get_message() != ( 0x06  |  0x20 ) );
g_result = ToNextMusic(Play_play);
if(DisMod == 0)
{
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
}
if(g_result ==  100 +2 ) return g_result;
}

else
{
g_result = ToNextMusic(Play_play);
if(DisMod == 0)
{
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
}
if(g_result ==  100 +2 ) return g_result;
}
return  0 ;
}




 unsigned char  ChangeMusic(  unsigned char  Direct, Music_sel_mod_t mod )
{
 unsigned char  result;


output8( 0x4e , input8( 0x4e ) | 0x08);


RePlayStatus = NormalPlay;
ClearTimePara();
g_TagInfoBuf[0] = 0x0;
BankSwitch((unsigned long) fselInit  >> 16);
if(fsel_mode_change_flag) 
{ 
fsel_mode_change_flag =  0 ; 
 fselInit ( 0 , g_music_vars.repeat_mode, g_music_vars.fselmod ,g_music_vars.location.disk);
}
if(g_music_vars.file_list_type==0xff)
{ 
if (mod == Play_key)
{
switch (g_music_vars.repeat_mode)
{
case  1 :
 fselSetMode (  4  );
break;


default:
 fselSetMode (g_music_vars.repeat_mode);
break;
}
}
else if (mod == Stop_key)
{
 fselSetMode ( 4 );
}
else
{
 fselSetMode (g_music_vars.repeat_mode);
}

switch (Direct)
{
case  0 :
break;

case  1 :
break;

case  2 :
result =  1 ;
break;

case  3 :
if(mod==list_key) 
{ 
result =  1 ; 
if(!fselSetLocation(& g_music_vars.location)) 
{
DisplayErrMsg( 535 ); 
fselGetLocation(& g_music_vars.location); 
return  0 ;
} 
break; 
}
ifSelBuffToltalTimeFlag =  0 ;
result =  fselGetNextFile (g_music_vars.location.filename);
break;

case  4 :
ifSelBuffToltalTimeFlag =  0 ;
result =  fselGetPrevFile (g_music_vars.location.filename);
break;

default:
return  0 ;
}

if (!result)
{
fselSetLocation(& g_music_vars.location);
return result;
}

bList_Flag =  0 ;

g_musicamount =  fselGetTotal ();
g_musicsequence =  fselGetNo ();
 fselSetMode (g_music_vars.repeat_mode);


fselGetLocation(& g_music_vars.location);
} 

else 
{
switch (Direct)
{
case  2 :
result =  1 ;
break;

case  3 : 
if(mod==list_key) 
{ 
break; 
}
if((mod==Play_key) &&(g_music_vars.file_list_num ==g_file_list_total-1)) 
return  0 ;
ifSelBuffToltalTimeFlag =  0 ;
result = select_music_list( 3 ); 
break;

case  4 : 
if((mod==Play_key) &&(g_music_vars.file_list_num ==0)) 
return  0 ;

ifSelBuffToltalTimeFlag =  0 ;
result = select_music_list( 4 ); 
break;

default:
break; 
} 
if(result== 100 +6 ) 
{
return  0 ;
} 
if(!fselSetLocation(& g_music_vars.location)) 
{
DisplayErrMsg( 535 ); 
fselGetLocation(& g_music_vars.location); 
return  0 ;
} 
else
{ 
g_musicamount = g_file_list_total;
g_musicsequence = g_music_vars.file_list_num+1; 
}
} 

make_dirname(); 
g_currentMusicType = CheckMusicType(g_music_vars.location.filename);


output8( 0x4e , input8( 0x4e ) | 0x08);
return  1 ;
}


 unsigned char  musicpSendCommand_bank(  unsigned char  cmd, int param )
{
 unsigned char  result =  0 ;

output8( 0x4e , input8( 0x4e ) | 0x08);
switch (cmd)
{
case  0x04 :

if (!g_PAOpenFlag)
{

musicpSendCommand( 0x0d ,  1 );
}
if (g_FCexitflag)
{
openPA(0);
}
else
{
openPA(g_music_vars.volume);
}

if (param == Nor_Break_open)
{

musicpSendCommand( 0x0d ,  1 );
}
break;

default:
break;
}
switch (g_currentMusicType)
{
case Music_MP3: 
BankSwitch((unsigned long)mp3pSendCommand >> 16);
result = mp3pSendCommand(cmd, param);
switch(cmd)
{
case  0x03 :
mp3pSendCommand( 0x40 , g_music_vars.volume);
mp3pSendCommand( 0x46 , g_music_vars.play_rate);
mp3pSendCommand( 0x43 , g_music_vars.eq_type);
if(g_music_vars.eq_type>8) 
{ 
if(SRSModeFlag)
{ 
mp3pSendCommand( 0x42 , (int)&(g_music_vars.SRSMod));
}
else 
{ 
srs_default_set();
}
}
break;

default:
break;
}
break;

case Music_WMA: 
case Music_ASF: 
case Music_WMV: 
BankSwitch((unsigned long)wmapSendCommand >> 16);
result = wmapSendCommand(cmd, param);

switch(cmd)
{
case  0x03 :
wmapSendCommand( 0x40 , g_music_vars.volume);
wmapSendCommand( 0x46 , g_music_vars.play_rate);
wmapSendCommand( 0x43 , g_music_vars.eq_type);
if(g_music_vars.eq_type>8) 
{ 
if(SRSModeFlag)
{ 
wmapSendCommand( 0x42 , (int)&(g_music_vars.SRSMod));
}
else 
{ 
srs_default_set();
}
}
break;

default:
break;
}
break;

case Music_APE:
BankSwitch((unsigned long)apepSendCommand >> 16);
result = apepSendCommand(cmd, param);
switch(cmd)
{
case  0x03 :
apepSendCommand( 0x40 , g_music_vars.volume);
apepSendCommand( 0x46 , g_music_vars.play_rate);
if(g_music_vars.eq_type > 0x10)
apepSendCommand( 0x43 , 0);
else
apepSendCommand( 0x43 , g_music_vars.eq_type);
break;

default:
break;
}
break;

case Music_OGG:
BankSwitch((unsigned long)oggpSendCommand >> 16);
result = oggpSendCommand(cmd, param);
switch(cmd)
{
case  0x03 :
oggpSendCommand( 0x40 , g_music_vars.volume);
oggpSendCommand( 0x46 , g_music_vars.play_rate);
if(g_music_vars.eq_type > 0x10)
oggpSendCommand( 0x43 , 0);
else
oggpSendCommand( 0x43 , g_music_vars.eq_type);
break;

default:
break;
}
break;


default:
return  0 ;
}



switch ( cmd )
{
case  0x41 :
if (result == 0)
{
break;
}

switch ( param )
{
case SetAPoint:
g_2HZ_CNT = 0;
g_ABMinTimeCNT =  400/20 ;

RePlayStatus = WaitSetBPointForAB;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
break;

case SetBPoint:
g_ABPointTimeSize = g_2HZ_CNT;
g_ReplayTimeCNT = 0;
RePlayStatus = ABLoopPlay;
UpDisplayFlag = UpDisplayFlag |  0x0800 ;
need_draw =  1 ;
break;

default:
break;
}
break;

case  0x04 :
if (result)
{
PlayStatus = PlaySta;
}
break;

case  0x06 :
PlayStatus = StopSta;
CaltimeFlag =  0 ;
WaitForCaltimeCNT = 0;
break;

case  0x13 :
CaltimeFlag =  1 ;
WaitForCaltimeCNT = 0;

break;

default:
break;
}
return result;
}


void SelectCurMusic(void)
{
musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x02 ,  0 );
ChangeMusic( 2 , Play_play); 
GetInformation(); 
musicpSendCommand(  0x01 , (int)& g_Openparam );
musicpSendCommand( 0x03 ,  0 );
musicpSendCommand( 0x13 ,  0 );
musicpSendCommand( 0x04 ,  0 );

}




int ui_delete_Music( int type )
{
g_music_vars.location.ID3buffer = g_TagInfoBuf;


if (g_music_vars.location.disk == 'H')
{
DRV_ActiveUD(1,  0x01 ); 
}
else if (g_music_vars.location.disk == 'C')
{
DRV_ActiveUD(0,  0x01 ); 
}

if(type== 1 )
{
 fselSetMode ( 4 );
g_result=ui_delete_all(& g_music_vars.location,  1 ,g_comval.langid);
 fselSetMode (g_music_vars.repeat_mode);
}
else 
g_result = ui_delete(& g_music_vars.location, type, g_comval.langid);

if (g_result ==  54 )
{
DisplayErrMsg( 394 );
g_music_vars.location.disk = 'C';
return  52 ;
}

if (g_result != 0)
{
return g_result;
}

if (!ChangeMusic( 3 , Stop_key))
{
if (UpdateFileSelector() == 0)
{
return 0;
}


}

fselGetLocation(& g_music_vars.location);

return 0; 
}

int NoCardCaseInStopMenu(int active)
{
int result;
switch (active)
{
case 0: 
if (g_music_vars.location.disk == 'H')
{
g_music_vars.location.disk = 'C';
 fselInit ( 0 ,  0 ,  0 ,g_music_vars.location.disk);
g_music_vars.fselmod =  0 ;
}

if (g_music_vars.fselmod ==  1 ||g_music_vars.fselmod == 2 )
{
fselPlayListExit();
 fselInit ( 0 ,  0 ,  0 ,g_music_vars.location.disk);
 fselGetNextFile (g_music_vars.location.filename);
fselGetLocation(&g_music_vars.location);
g_music_vars.fselmod =  0 ;
}

result = ui_directory(& g_music_vars.location,  0 , g_comval.langid);
 fselSetMode ( 0 );
if (result == 0)
{

g_music_vars.play_listmod = mlistnor;
g_music_vars.file_list_type = 0xff; 
}
break;

case 1: 
if(g_music_vars.fselmod ==  1 ||g_music_vars.fselmod == 2 )
{
fselPlayListExit();
 fselInit ( 0 ,  4 ,  0 ,g_music_vars.location.disk);
 fselGetNextFile (g_music_vars.location.filename);
g_music_vars.fselmod =  0 ;
g_music_vars.play_listmod = mlistnor;
fselGetLocation(&g_music_vars.location);
} 
result = ui_delete_Music( 0 ); 
g_music_vars.file_list_type = 0xff; 
break;

case 2: 
 fselSetMode ( 4 );
g_music_vars.fselmod =  0 ;
result = ui_delete_Music( 1 );
g_music_vars.file_list_type = 0xff; 
 fselSetMode (g_music_vars.repeat_mode);
break;

default:

result =  52 ;
break;
}
return result;
}
void Deal_Error_Playing(void)
{
wma_inf_t drminfbuff; 
if (musicpSendCommand( 0x10 , (int)&drminfbuff))
{

if (drminfbuff.drmmode == INF_DRMNOLICENSE)
{
DisplayErrMsg( 599 );
}
}

else if ( (g_music_vars.location.disk != 'C') 
&& (DRV_DetectUD(1) != 0x20) )
{
DisplayErrMsg( 394 );
}
else
{
DisplayErrMsg( 538 );
}
musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x02 ,  0 ); 
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
} 

⌨️ 快捷键说明

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