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

📄 sub_playstatuskey.i

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








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
}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 short  magic; 
} music_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[6];
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;










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_SRS_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 Scroll( char * scrollstr,  unsigned char  mode ,char language);

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 char return_to_play;
void ui_show_vol( unsigned char  volume);
void OutPutVolume(int vol);
void ErrReport(Play_status_t status);
extern  unsigned char  DisplayTimeRollback(void);



int DealKeyForPlayStatus(char key)
{

int g_result_bak;
music_play_status_t status_buf;
switch (key)
{
case  29 :
break;

case  0x06  |  0x80 : 

ui_run_realtime= 1 ;

{

if (RePlayStatus == NormalPlay)
{
PlayStatus = FFPlaySta;
musicpSendCommand( 0x07 , 4);
}
}
break;

case  0x05  |  0x80 : 
ui_run_realtime= 1 ;

{

if (RePlayStatus == NormalPlay)
{
PlayStatus = FBPlaySta;
musicpSendCommand( 0x07 , -4);
}

}
break;

case  0x12 :
if (RePlayStatus == NormalPlay)
{
g_result = ui_EQ_menu();

if (g_result ==  9  )
{
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
return play_key_next( 0x11  |  0x20 );
}
else
{
if (g_result != 0)
{
return g_result;
}
}

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

case  0x02 :
if (RePlayStatus == NormalPlay)
{
g_result = ui_loop_menu();

if (g_result ==  9  )
{
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
return play_key_next( 0x11  |  0x20 );
}
else
{
if (g_result != 0)
{
return g_result;
}
}

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

case  0x05  |  0x20 :
ui_run_realtime= 0 ;
g_result = play_key_prev(key);
while(ap_get_message()!= 0 ); 
return g_result;


case  0x06  |  0x20 :
ui_run_realtime= 0 ;
case  0x11  |  0x20 : 
g_result = play_key_next(key);
while(ap_get_message()!= 0 ); 
return g_result;

case  0x10  |  0x20 : 
if (RePlayStatus == NormalPlay)
{
 unsigned char  Reg4eBak=input8(0x4e);
output8(0x4e,0x22); 
g_result = ui_play_menu(); 
output8(0x4e,Reg4eBak); 
if (g_result ==  9  )
{

 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
UpDisplayFlag = UpDisplayFlag & 0xdfff ;
return play_key_next( 0x11  |  0x20 );
}
else
{

g_result_bak=g_result;
musicpSendCommand( 0x83 , (int)(& status_buf));
if (status_buf.status ==  0x06 )
{

g_result=DealMusicFileEnd(0); 
if ( g_result !=  0  )
{
if(g_result_bak) 
return g_result_bak; 
else
return g_result; 
} 
}
g_result=g_result_bak;

if (g_result != 0)
{
return g_result;
}
}
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;

}
else
{
musicpSendCommand( 0x41 , ClrABPoint); 
RePlayStatus = NormalPlay;

UpDisplayFlag = UpDisplayFlag |  0x2000 ;
g_FCexitflag =  0 ;
}
return_to_play=1;
need_draw =  1 ;
break;

case  0x10  |  0x80 :


if (!g_lyricflag)
{
return  10 ; 
}
if (RePlayStatus != NormalPlay)
{
return  10 ;
}
g_result = ui_lyric();
return_to_play=1;

VMRead(& g_comval,  0x0200 , sizeof(g_comval));
ap_message_init(& g_comval);
if( g_result == 0 ) 
{
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
}

return g_result;


break;

case  0x01  |  0x20 :
return DealPlayKey();

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

if (g_result ==  9  )
{
g_result = play_key_next( 0x11  |  0x20 );
if (g_result ==  100 +2 )
{
return 0;
}
if (g_result != 0)
{
return g_result;
}
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
}
else
{
if (g_result != 0)
{
return g_result;
}
}


break;
case  27 :
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 ; } ;
need_draw =  1 ;
return_to_play=1;
}
else if (key != 0)
{
return key;
}
break;
}
return  0 ;

}



int play_key_next( int key )
{
wma_play_status_t status_buf;

if ((PlayStatus == FFPlaySta) || (PlayStatus == FBPlaySta))
{
musicpSendCommand( 0x07 , 0);
PlayStatus = PlaySta;
}
else
{
switch (RePlayStatus)
{
case NormalPlay:
if (key == ( 0x11  |  0x20 )) 
{
musicpSendCommand( 0x41 , SetAPoint); 
}
else 
{
FadeOut( 1 );
g_result = ToNextMusic(Play_key);
if(g_result != 0)
{
return g_result;
}
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
UpDisplayFlag=UpDisplayFlag &  0xfffe  ; 
}
break;

case WaitSetAPointForAB:
musicpSendCommand( 0x41 , SetAPoint); 
break;

case WaitSetBPointForAB:
if(g_ABMinTimeCNT == 0) 
{
 ;

if ( musicpSendCommand( 0x41 , SetBPoint) ); 
{
g_AVSetFlag =  0 ;
}
 ;
}
break;

case ABLoopPlay:
if (g_music_vars.location.disk == 'C')
{

musicpSendCommand( 0x83 , (int)(& status_buf));
if (status_buf.status ==  0x07 )
{
musicpSendCommand( 0x13 ,  0 );
musicpSendCommand( 0x04 ,  0 );
}
g_FCexitflag =  0 ;
g_result = ui_follow_compare();
g_music_vars.MusicOpenMod = Nor_Break_open;
g_ReplayTimeCNT = 0;
if (g_result != 0)
{
return g_result;
}
}
else
{

musicpSendCommand( 0x41 , ClrABPoint); 
RePlayStatus = WaitSetAPointForAB;
}


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

if(RePlayStatus!=NormalPlay) 
UpDisplayFlag = UpDisplayFlag & 0xdfff ;

break;

default:
break;
}
}
need_draw =  1 ;
return  0 ;
}


int play_key_prev( int key )
{
wma_play_status_t status_buf;

if (RePlayStatus != NormalPlay)
{
musicpSendCommand( 0x41 , ClrABPoint); 

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

switch (PlayStatus)
{
case FBPlaySta:
case FFPlaySta:
musicpSendCommand( 0x07 , 0);
PlayStatus = PlaySta;
break;

case PlaySta:
FadeOut( 1 );
g_result = PrevMusicInPlay();
if (g_result != 0) return g_result;
break;

default:
break;
}
return  0 ;
}

int ToNextMusic( Music_sel_mod_t mod )
{
wma_play_status_t status_buf;
output8(0x27,input8(0x27)&0xbf); 
musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x02 ,  0 );
output8(0x27,input8(0x27)|0x40); 
g_result = ChangeMusic( 3 , mod);
if(!g_result)
{
return  100 +2 ;
}
 fselSetMode (  4  );
 fselGetNextFile (g_music_vars.location.filename);
fselGetLocation(& g_music_vars.location);
GetInformation();
memcpy(g_TagInfoBuf1,g_TagInfoBuf,20);

 fselGetPrevFile (g_music_vars.location.filename);
fselGetLocation(& g_music_vars.location);
 fselSetMode (g_music_vars.repeat_mode);
GetInformation(); 
musicpSendCommand(  0x01 , (int)& g_Openparam );
g_result = musicpSendCommand( 0x03 ,  0 );
if(g_result)
{

musicpSendCommand( 0x13 ,  0 );
if (g_PowerOffFlag == 0x55)
{
if (!DisplayTimeRollback())
{
musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x02 ,  0 );
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
return  100 +2 ;
}
}
}


else
{
musicpSendCommand( 0x83 , (int)(& status_buf));
ErrReport(PlayStatus);
PlayStatus=StopSta;
return  100 +2 ;
}



musicpSendCommand( 0x59 , 5); 


musicpSendCommand( 0x04 ,  0 );

return  0 ;
}


int PrevMusicInPlay(void)
{
wma_play_status_t status_buf;

musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x02 ,  0 );
g_result = ChangeMusic( 4 , Play_key);
if(!g_result)
{
return  100 +2 ;
}
 fselSetMode (  4  );
 fselGetNextFile (g_music_vars.location.filename);
fselGetLocation(& g_music_vars.location);
GetInformation();
memcpy(g_TagInfoBuf1,g_TagInfoBuf,20);

 fselGetPrevFile (g_music_vars.location.filename);
fselGetLocation(& g_music_vars.location);
 fselSetMode (g_music_vars.repeat_mode);
GetInformation(); 
g_music_vars.MusicOpenMod = Nor_open;
musicpSendCommand(  0x01 , (int)& g_Openparam );
g_result = musicpSendCommand(  0x03 ,  0  );
if (g_result)
{

musicpSendCommand( 0x13 ,  0 ); 
if (g_PowerOffFlag == 0x55)
{
if (!DisplayTimeRollback())
{
musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x02 ,  0 );
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
need_draw =  1 ;
return  100 +2 ;
}
}



}

else
{
musicpSendCommand( 0x83 , (int)(& status_buf));

ErrReport(PlayStatus);
PlayStatus=StopSta;
return  100 +2 ;

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


musicpSendCommand( 0x59 , 5); 
musicpSendCommand( 0x04 ,  0 );

return  0 ;
}


int DealPlayKey( void )
{
if (g_FCexitflag)
{

musicpSendCommand( 0x40 , 0);
OutPutVolume(0);
musicpSendCommand( 0x0d ,  3 );
}
if (RePlayStatus != NormalPlay)
{

musicpSendCommand( 0x41 , ClrABPoint);
RePlayStatus = NormalPlay;
main_ResShowPic( 29 ,0,0);


}
if (!g_FCexitflag)
{
FadeOut( 1 );
}
g_FCexitflag =  0 ;
musicpSendCommand( 0x06 ,  0 );
musicpSendCommand( 0x44 ,  0 );
musicpSendCommand( 0x02 ,  0 );

g_music_vars.MusicOpenMod = Nor_Break_open;

ifSelBuffToltalTimeFlag =  1 ;

PlayStatus=PauseSta; 
return  100 +2 ;
}


void ErrReport(Play_status_t status)
{
wma_inf_t drminfbuff;
if (musicpSendCommand( 0x10 , (int)&drminfbuff))
{
if (drminfbuff.drmmode == INF_DRMNOLICENSE)
{
DisplayErrMsg( 433 );
goto ErrReport_exit;



}
}
if ( (g_music_vars.location.disk == 'H')
&& (DRV_DetectUD(1) != 0x20) )
{
DisplayErrMsg( 401 );
}
else
{
DisplayErrMsg( 398 );
}


ErrReport_exit:
if ((status != StopSta)&&(status != PauseSta))
{
musicpSendCommand( 0x06 ,  0 );
}
musicpSendCommand( 0x02 ,  0 );
 { ui_auto_update= 0 ; UpDisplayFlag=UpDisplayFlag | 0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0001 | 0x0040 ; } ;
return;
}
void Deal_Error_Playing(void)
{
wma_inf_t drminfbuff; 
if (musicpSendCommand( 0x10 , (int)&drminfbuff))
{

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

else if ( (g_music_vars.location.disk == 'H')
&& (DRV_DetectUD(1) != 0x20) )
{
DisplayErrMsg( 401 );
}
else
{
DisplayErrMsg( 398 );
}
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 + -