📄 display_hl.h
字号:
/*
* Sunplus search function
* Creat by terry
*/
//
// DispCookOSD0
// Prepare the content of OSD0 to temp buffer
// (from OSD0_TEMP_YA-th KBytes in DRAM, size=38*16*1*24*4/8=7104 Bytes)
//
// input : bChange
// 1 : re-generate all content
// 0 : only update timing display parts
// dwTime :
// < 0 : remain time (-00:00:00)
// > 0 : elapsed time( 00:00:00)
//
// output : none
//
// side-effect : none
//
// notes:
// 0 5 15 18 22 25
// CD TRACK SPK PBC REP TIME
// VCD TRACK SPK PBC REP TIME
// SVCD TRACK SPK PBC REP TIME
// DVD TITLE CHAPTER TIME
// MP3 TRACK SPK REP TIME
//
// Color table
// palette_16color_setup(defined in osd1.c)
//
//===========================================================================================
// debug option
//===========================================================================================
#undef io_write
#define io_write(x);
#ifdef SUPPORT_CDG //Jeff 20020824
#include "cdg.h"
extern UINT8 bReadSubChannel;
#endif
#include "sinf.h"
#include "kinf.h"//wangap
#ifdef MIX_CDMP3_DISC_DISPLAY_REAL_CD_TRK //linrc add 2004-10-29 11:16
#include "cdxa.h"
#endif
#if defined (DISPLAY_MP4_VER_PI) || defined(DISPLAY_MP4_AV_INFO) //Maoyong 2004.06.29
#include "fsNav.h"
#include "avi_if.h"
#include "audcodec.h"
#endif
#ifdef OSD_BMP
#include "osd_BmpUI.h"
#include "fsNAV.h"
#endif
#ifdef MP3_2GOTO_TYPE
#include "fsNAV.h"
#endif
#ifdef DIV_GOTO_DISPLAY
#ifdef NINTAUS_OSD_STR //2004-2-16 10:58张宇P
#define REGION2_FONTCOLOR 2//word color
#define REGION2_NUMCOLOR 2 //number color
#else
#define REGION2_FONTCOLOR 8//word color
#define REGION2_NUMCOLOR 7 //number color
#endif
#define REGION2_BKCOLOR 10//background color
#define REGION2_RCOLOR 10//region color
#define REGION2_HL_COLOR 4//to hilight
#endif
//===========================================================================================
// function
//===========================================================================================
#ifndef DIV_GOTO_DISPLAY
void hi_light_time(int pos)
{
//skip the TT and CH characters
#if defined (OSD_BMP_DISPLAY_TT_TIME) || defined(OSD_BMP_DISPLAY_CH_TIME)
if(cd_type_loaded == CDDVD)
pos += 3 * DISP_LITTLE_CHAR_WIDTH;
#endif
int time=0,shift_base=0;
if((index_x-5)<=1)
{
time=goto_hour;
shift_base=4;
}
else if((index_x-5)<=3)
{
time=goto_min;
shift_base=3;
}
else if((index_x-5)<=5)
{
time=goto_sec;
shift_base=2;
}
#ifdef OSD_BMP_DISPLAY //There is no blank in front of the time string in osd_bmp_display,feeling 20040920
shift_base += 1;
#endif
if((index_x-5)%2==0)//even
{
psprintf(linebuf, "%01d", time/10);
io_write("i");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+(index_x-shift_base), 0, linebuf, 0, 2);
#elif defined (OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+(index_x-shift_base)* DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,time shows little character,feeling 200408
#else
do_DispOSD0String(pos+(index_x-shift_base), 0, linebuf, 2, 4);
#endif
}
else
{
psprintf(linebuf, "%01d", time%10);
io_write("h");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+(index_x-shift_base), 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+(index_x-shift_base)* DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,time val shows little character,feeling200408
#else
do_DispOSD0String(pos+(index_x-shift_base), 0, linebuf, 2, 4);
#endif
}
}
void hi_light_chapter(int id,int pos)//kenny 2002/4/13
{
if(index_x==2)
{
psprintf(linebuf, "%01d",id/100);
io_write("g");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos, 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos, 0, linebuf, 2, 4);
#endif
}
else if(index_x==3)
{
psprintf(linebuf, "%01d",(id%100)/10);
io_write("f");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+1, 0, linebuf, 0, 2);
#elif defined (OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+1*DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos+1, 0, linebuf, 2, 4);
#endif
}
else if(index_x==4)
{
psprintf(linebuf, "%01d",id%10);
io_write("e");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+2, 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+2*DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos+2, 0, linebuf, 2, 4);
#endif
}
}
//Maoyong 2004.04.28 marked MP3_DIRECT_SELECT
//#ifdef MP3_DIRECT_SELECT
//zhaoyanhua modify the function to show 4 digits when CDROM.3-7-16 16:43
void hi_light_title(int id, int pos)
{
if (cd_type_loaded == CDROM)
{
int id0 = 0,id1= 0,id2=0,id3=0;
id0 = id/1000;
id1 = (id%1000)/100;
id2 = ((id%1000)%100);
id2 = id2/10;
id3 = (id%1000)%100;
id3 = id3%10;
if(index_x==0)
{
psprintf(linebuf, "%01d",id0);
io_write("d");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos, 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos, 0, linebuf, 2, 4);
#endif
}
else if(index_x==1)
{
psprintf(linebuf, "%01d",id1);
io_write("c");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+1, 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+1*DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos+1, 0, linebuf, 2, 4);
#endif
}
else if(index_x==2)
{
psprintf(linebuf, "%01d",id2);
io_write("c");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+2, 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+2*DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos+2, 0, linebuf, 2, 4);
#endif
}
else if(index_x==3)
{
psprintf(linebuf, "%01d",id3);
io_write("c");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+3, 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+3*DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos+3, 0, linebuf, 2, 4);
#endif
}
}
else //not CDROM
{
if(index_x==0)
{
psprintf(linebuf, "%01d",id/10);
io_write("d");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos, 0, linebuf, 0, 2);
#elif defined (OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos, 0, linebuf, 2, 4);
#endif
}
else if(index_x==1)
{
psprintf(linebuf, "%01d",id%10);
io_write("c");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+1, 0, linebuf, 0, 2);
#elif defined(OSD_BMP_DISPLAY)
do_DispOSD0LittleString(pos+1*DISP_LITTLE_CHAR_WIDTH, 12, linebuf, DISP_GBLUE, DISP_GREEN);//in bmp display,title val shows little character,feeling
#else
do_DispOSD0String(pos+1, 0, linebuf, 2, 4);
#endif
}
}
}
/*#else //not MP3_DIRECT_SELECT
void hi_light_title(int id, int pos)
{
if(index_x==0)
{
psprintf(linebuf, "%01d",id/10);
io_write("d");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos, 0, linebuf, 0, 2);
#else
do_DispOSD0String(pos, 0, linebuf, 2, 4);
#endif
}
else if(index_x==1)
{
psprintf(linebuf, "%01d",id%10);
io_write("c");
#ifdef SDRAM_16Mb_Mode
do_DispOSD0String(pos+1, 0, linebuf, 0, 2);
#else
do_DispOSD0String(pos+1, 0, linebuf, 2, 4);
#endif
}
}
#endif //end MP3_DIRECT_SELECT
*/
#else//if defined DIV_GOTO_DISPLAY
void hi_light_time(int pos)
{
BYTE buf[20];
int time=0,shift_base=0;
// osd_draw_region_rect(pos*8,0,8*8,24,5,2);
if((index_x-5)<=1)
{
time=goto_hour;
shift_base=5;//shift_base=4;
}
else if((index_x-5)<=3)
{
time=goto_min;
shift_base=4;//shift_base=3;
}
else if((index_x-5)<=5)
{
time=goto_sec;
shift_base=3;//shift_base=2;
}
if((index_x-5)%2==0)//even
{
psprintf(buf, "%01d", time/10);
io_write("i");
}
else
{
psprintf(buf, "%01d", time%10);
io_write("h");
}
osd_DrawRegionString(pos+(index_x-shift_base), 0, buf, REGION2_NUMCOLOR, REGION2_HL_COLOR, 2);
}
void hi_light_chapter(int id, int pos)
{
BYTE buf[20];
int shift = 0;
//osd_draw_region_rect(pos, 0,2*16, 2*16 , 5,2);
if(index_x == 2)
{
psprintf(buf, "%01d",id/100);
shift = 0;
}
else if(index_x== 3)
{
psprintf(buf, "%01d",(id%100)/10);
shift = 1;
}
else if(index_x==4)
{
psprintf(buf, "%01d",id%10);
shift = 2;
}
osd_DrawRegionString(pos+shift,0,buf,REGION2_NUMCOLOR, REGION2_HL_COLOR, 2);
}
void hi_light_title(int id, int pos)
{
BYTE buf[20];
int shift = 0;
#ifdef MP3_DIRECT_SELECT//zhaoyanhua add 2004-2-16 11:20
if (cd_type_loaded == CDROM)
{
int id0 = 0,id1= 0,id2=0,id3=0;
id0 = id/1000;
id1 = (id%1000)/100;
id2 = ((id%1000)%100);
id2 = id2/10;
id3 = (id%1000)%100;
id3 = id3%10;
if(index_x == 0)
{
psprintf(buf, "%01d",id0);
shift = 0;
}
else if(index_x == 1)
{
psprintf(buf, "%01d",id1);
shift = 1;
}
else if(index_x == 2)
{
psprintf(buf, "%01d",id2);
shift = 2;
}
else if(index_x == 3)
{
psprintf(buf, "%01d",id3);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -