📄 rec_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 "rec_main.h"
//#include "lrc_parse.h"
#include "rec_display.h"
#include "rec_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
INT16U u16TotalMem,u16RemainMem;
extern void song_timeon(SONGTIME type);
void vShowMusicType()
{
switch(tUserPreference.rectype)
{
case 0: //wav32k
bResShowPic(RVOR32K, POSITION_A+2, POSITIONY_A);
break;
case 1:
bResShowPic(RVOR32K, POSITION_A+2, POSITIONY_A);
break;
}
}
void vShowSequence()
{
my_sprintf(_buf,"%03d", curr_music.u16Order);
ui_show_h(_buf,0);
my_sprintf(_buf,"%03d",totfile);
ui_show_h(_buf,1);
}
void vShowTotalTime()
{
song_timeon(TIME_TOTAL);
ui_show_d(_buf, 1);
}
void ui_show_rdata(UINT8 *buf, UINT8 x, UINT8 y)
{
while(1)
{
if(*buf!=0)bResShowPic(RE_0+*buf-0x30, x, y);
else
break;
buf++;
x+=11;
}
}
void vShowCurrentTime()
{
song_timeon(TIME_PLAY);
ui_show_rdata(_buf,40, 80);
}
void vShowRemainTime(UINT16 a)
{
//song_timeon(TIME_PLAY);
UINT16 temp;
temp = a*64;
my_sprintf(_buf, "%02d:%02d:%02d",(INT16U)((temp % 3600)), (INT16U)((temp % 3600) / 60), (INT16U)(temp % 60));
ui_show_rdata(_buf,10, 30);
}
void ui_draw(void)
{
//shoud show background now
bResShowPic(BACKREC1,0,0);
//show rectype
vShowMusicType();
//show music order
//vShowSequence();
//show file name.
gfx_songname();
//show total time.
//vShowTotalTime();
//show current time
//vShowCurrentTime();
my_sprintf(_buf, "00:00:00");
//my_sprintf()
//ui_show_d(_buf, 0);
ui_show_rdata(_buf,40, 80);
//show progress
//gfx_progress(1);
//show volume.s
//ui_show_vol();
//show battary
ui_show_batt();
//show media type
bg_color = 0xdf9e;
fg_color = COLOR_UNSELECT;
if(my_disk==0) //sd
{
lcd_puts(30,142, "SD",FONTSIZE_HYPER);
}
else //nand
{
lcd_puts(30,142, "NAND", FONTSIZE_HYPER);
}
}
void play_time_update(void)
{
static UINT32 last_time;
INT32U data time;
time = api_u32GetPlayingTime();
if(last_time != time) {
if(curr_screen->id == SCREEN_REC) {
vShowCurrentTime();
// api_bGetStorageInfo(&u16TotalMem, &u16RemainMem);
// vShowRemainTime(u16RemainMem);
last_time = api_u32GetPlayingTime();
}
}
}
void gfx_songname(void)
{
bg_color = 0x7000;
gfx_set_bg(COLOR_BLACK);
//gfx_bg_rectangle(FILE_NAME_X, 95, XRES, 16);
fg_color = COLOR_UNSELECT;
/* Draw song file name */
//lcd_max_str = 14;
if(!api_bGetRecordFileInfo(&curr_finfo))
return;
my_sprintf(_buf, "%s.WAV", curr_finfo.pu8FileName);
lcd_puts(18, 38, _buf, FONTSIZE_8x16);
//gfx_filename(8, 95);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -