📄 voice_display.c
字号:
/************************
* mp3_display.c
************************/
#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "display.h"
#include "file_brower.h"
#include "voice_main.h"
//#include "lrc_parse.h"
#include "voice_display.h"
#include "voice_utile.h"
#include "res.h"
#include "res_show.h"
#include "ap_common.h"
#include "ui_main.h"
#include "prefer.h"
#include "global_user.h"
#define PROGRESS_Y 24
#define PROGRESS_X 4
#define FILE_NAME_X 2
#define FILE_NAME_Y 95
static UINT32 last_time = 0;
INT16U code loop_id[3] ={MLOOP1,MLOOP2,MLOOP5};
extern void song_timeon(SONGTIME type);
void vShowMusicType()
{
//ui_show_a(MMUSIC);
ui_show_a(MMP3);
}
void vShowBitrate()
{
ui_show_a(RWAV32K);
my_sprintf(_buf, "%03d", curr_music.u16BitRate);
bResShowPic(KBPS, 75 , 10);
bResShowPic(MBIT0+_buf[0] - 0x30, POS_BITRATE , POSY_BITRATE);
bResShowPic(MBIT0+_buf[1] - 0x30, POS_BITRATE+5, POSY_BITRATE);
bResShowPic(MBIT0+_buf[2] - 0x30, POS_BITRATE+10, POSY_BITRATE);
}
void vShowLoop()
{
ui_show_b(loop_id[tUserPreference.u8RepeatMode]);
}
void vShowEq()
{
ui_show_c(tUserPreference.u8EqMode+MEQICON1);
}
void vShowRepeat()
{
if(api_eGetRepeatMode() == REPEAT_MODE_SETA_OK)
ui_show_a(MRPLNOA);
else if(api_eGetRepeatMode() == REPEAT_MODE_SETAB_OK)
ui_show_a(MRPLNOB);
else
vShowBitrate();
}
void ui_show_data3(char *buf, UINT8 x, UINT8 y)
{
// if(scr_en2) return;
while(1)
{
if(*buf!=0)bResShowPic(MNUM0+*buf-0x30, x, y);
else
break;
buf++;
x+=5;
}
}
void vShowSequence()
{
my_sprintf(_buf, "%03d", curr_music.u16Order);
_buf[3] = ';';
my_sprintf(&_buf[4], "%03d",totfile);
//ui_show_data3(_buf,90,109);
ui_show_data2(_buf,3, 115);
}
void vShowTotalTime()
{
song_timeon(TIME_TOTAL);
ui_show_d(_buf, 1);
}
void vShowCurrentTime()
{
song_timeon(TIME_PLAY);
ui_show_d(_buf, 0);
}
void ui_draw(void)
{
//shoud show background now
bResShowPic(BACKDROP,0,0);
if(!api_bGetCurrMusicInfo(&curr_music))
return;
//show music type.
//vShowMusicType();
vShowBitrate();
//show speaker
//ui_show_spk(1);
//show eq type.
vShowEq();
//show loop type
vShowLoop();
//show music order
vShowSequence();
//vLcd_SongName();
//show total time.
vShowTotalTime();
//show current time
vShowCurrentTime();
//play_time_update(0);
last_time = 0;
bResShowPic(SCHEDU00, 16 , 5);
bResShowPic(RPLAY3,2,51);
//show progress
//gfx_progress(1);
//show volume.
ui_show_vol();
//show battary
ui_show_batt();
//show media type
bg_color = 0x1d1f;
fg_color = COLOR_UNSELECT;
if(my_disk==0) //sd
{
lcd_puts(56, 17, "SD",FONTSIZE_HYPER);
}
else //nand
{
lcd_puts(48, 17, "NAND", FONTSIZE_HYPER);
}
//show file name.
gfx_songname();
bResShowPic(STOP_PIC, 0 , 2);
}
void play_time_update(UINT8 para)
{
//static UINT32 last_time;
INT32U data time;
time = api_u32GetPlayingTime();
if(last_time != time) {
if(curr_screen->id == SCREEN_VOICE) {
vShowCurrentTime();
bResShowPic(SCHEDU00+ (38 * last_time / curr_music.u32Length)%38, 16 , 5);
last_time = api_u32GetPlayingTime();
}
}
}
void gfx_songname(void)
{
bg_color = COLOR_BLACK;
gfx_set_bg(COLOR_BLACK);
gfx_bg_rectangle(0,30, 128, 16);
fg_color = COLOR_UNSELECT;
/* Draw song file name */
lcd_max_str = 14;
gfx_filename(0,30);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -