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

📄 movie_display.c

📁 智原mp3 SDK 开发包 与巨力 有mp3 wma ogg decoder
💻 C
字号:
/************************
 *   mp3_display.c
 ************************/

#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "display.h"
#include "file_brower.h"
#include "movie_main.h"
//#include "lrc_parse.h"
#include "movie_display.h"
#include "movie_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 code loop_id[3] ={MLOOP1,MLOOP2,MLOOP5};
extern void song_timeon(SONGTIME type);

#if 0
void gfx_progress(UINT8 pct)
{
	UINT8 i, w;
	//UINT16 pitch;

	/* Draw background process bar */
	bResShowPic(SCROT,PROGRESS_X,PROGRESS_Y);
	
	if(pct > 100)
		pct = 100;
	else if(pct == 0)
		return;

	/* Alignment to even */
	w = ((UINT16)pct * 120) / 100;
	w = (w + 1) & (~0x1);
	
	lcd_set_rw_area(PROGRESS_X,PROGRESS_Y, w, 4);
	
	for(i=0;i<(w<<1);i++)
	{
		pixel_buf[i] = Color_RED_def;
	}
	/* Draw percentage */
	for(i = 0; i < 4; i++) {
		lcd_put_data((UINT16)pixel_buf, (UINT16)w << 1);
	}
	
}
#endif

void vShowMusicType()
{
    	//ui_show_a(MMUSIC);
    	 ui_show_a(MAMV);   
}

void vShowLoop()
{
    	ui_show_b(loop_id[tUserPreference.u8RepeatMode]);	
}

void vShowEq()
{
    	ui_show_c(tUserPreference.u8EqMode+MEQICON1);
}

#if 0
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();		
}
#endif
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_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);
	bResShowPic(RPLAY3,2,51);
	
	if(!api_bGetCurrMusicInfo(&curr_music))
		return;	
	//show music type.
	vShowMusicType();
	//show loop type
	vShowLoop();
	//show music order
	vShowSequence();
		
	//show file name.
	gfx_songname();
	ui_show_vol();
	//show battary
	ui_show_batt();
 	
 	//show media type
	bg_color = 0x1d1f;
	fg_color = COLOR_WHITE;
	if(my_disk==0)  //sd
	{
		lcd_puts(56, 17, "SD",FONTSIZE_HYPER);
	}
	else      //nand
	{
		lcd_puts(48, 17, "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_MOVIE) {
			last_time = api_u32GetPlayingTime();
		}
	}
}

void gfx_songname(void)
{
	bg_color = COLOR_BLACK;
	gfx_set_bg(COLOR_BLACK);
	gfx_bg_rectangle(0, 34, 128, 16);	
	fg_color = COLOR_UNSELECT;
	/* Draw song file name */
	lcd_max_str = 12;
	gfx_filename(0,34);
}

⌨️ 快捷键说明

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