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

📄 setting_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 "setting_main.h"
//#include "lrc_parse.h"
#include "setting_display.h"
#include "setting_utile.h"
#include "res.h"
#include "res_show.h"
#include "ap_common.h"
#include "ui_main.h"
#include "prefer.h"

#define PROGRESS_Y  24
#define PROGRESS_X  4
#define FILE_NAME_X 2
#define FILE_NAME_Y 95

#if 0

extern void song_timeon(SONGTIME type);


void gfx_progress(UINT8 pct)
{
	UINT8 i, w, h;
	UINT16 pitch;
	
	/* Draw background process bar */
	gfx_image(PROGRESS_X,PROGRESS_Y,&image_table[6]);
	
	if(pct > 100)
		pct = 100;
	else if(pct == 0)
		return;

	w = ((UINT16)pct * image_table[7].w) / 100;
	h = image_table[7].h;
	pitch = (UINT16)image_table[7].w << 1;

	/* Alignment to even */
	w = (w + 1) & (~0x1);
	if(!api_bSectionFileSeek(image_table[7].offset, SEEK_SET))
		return;
	
	lcd_set_rw_area(PROGRESS_X,PROGRESS_Y, w, h);
	
	/* Draw percentage */
	for(i = 0; i < h; i++) {
		api_u16SectionFileRead(pixel_buf, pitch);
		lcd_put_data((UINT16)pixel_buf, (UINT16)w << 1);
	}
}


void vShowMusicType()
{
    	 ui_show_a(MMP3);   
}

void vShowBitrate()
{
    	if(curr_music.eMusicType == MUSIC_TYPE_MP3)  //mp3
    	{
         	ui_show_a(MMP3);
    	}
    	else
    	{
        	ui_show_a(MWMA);
    	}
    	my_sprintf(_buf, "%03d", curr_music.u16BitRate);   	
    	bResShowPic(MBIT0+_buf[0] - 0x30, POSITION_A + 1 + 2,120);
    	bResShowPic(MBIT0+_buf[1] - 0x30, POSITION_A + 6 + 3,120);
    	bResShowPic(MBIT0+_buf[2] - 0x30, POSITION_A + 12 + 3,120);
}

void vShowLoop()
{
    	ui_show_b(tUserPreference.u8RepeatMode+MLOOP1);	
}

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 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 vShowCurrentTime()
{
	song_timeon(TIME_PLAY);
	ui_show_d(_buf, 0); 	
}

void ui_draw(void)
{
	//shoud show background now
	bResShowPic(BACKMAIN,0,0);
	bResShowPic(WWWA001,4,33);
	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();
	//show file name.
	gfx_songname();
	//show total time.
	vShowTotalTime();
	//show current time
	vShowCurrentTime();
	//show progress
	gfx_progress(1);
	//show volume.
	ui_show_vol();
	//show battary
	ui_show_batt();
}



void gfx_music_lyrics(UINT8 *str)
{
	INT8S data r1;
	UINT8 n, y;
	
	gfx_image(8,33,&image_table[8]);
	
	fg_color = COLOR_WHITE;
	bg_color = COLOR_BLACK;

	r1 = 0;
	n = 0;
	y = 37;
	api_s8GetFont16x16BMP(0, TRUE);
	while(*str != '\0') {
		if(n >= 12) {
			n = 0;
			y += 16;
			if(y >= (37 + (16 * 3)))
				break;
		}
		
		if(*str <= 0x80 && r1 != 1) {
			if(lcd_putc_8x16(14 + (n * 8), y, *str++))
				n++;
			continue;
		}
		else {
			r1 = api_s8GetFont16x16BMP(*str++, FALSE);
			if(r1 == 0) {
				if(lcd_putc_16x16(14 + (n * 8), y, 0))
					n += 2;
			}
		}
	}
}



void show_lyrics(UINT8 *str)
{
	gfx_music_lyrics(str);
}

void play_time_update(void)
{
}

void gfx_songname(void)
{
	bg_color = COLOR_BLACK;
	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;
	gfx_filename(8, 95);
}

#endif

⌨️ 快捷键说明

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