Beispiel #1
0
static void win_set_mpflielist_help2(struct mp_help_item1_resource *helpinfo,UINT8 item_count)
{
	UINT8 i = 0;
	BITMAP *pBtn;
	TEXT_FIELD *pTxt;
	struct mp_help_item1_resource* helpitem;

	for(i = 0; i < item_count;i++)
	{
		helpitem = &helpinfo[i];

		pBtn = pHelp2Btn_icons[i];
		OSD_SetBitmapContent(pBtn, helpitem->bmp_id);

		pTxt = pHelp2Txt_ids[i];
		OSD_SetTextFieldContent(pTxt,STRING_ID,helpitem->str_id);
	}
	
	if(item_count<HELPCNT)//some help item not show
	{
		for(i=item_count; i<HELPCNT; i++)
		{
			pBtn = pHelp2Btn_icons[i];
			OSD_SetBitmapContent(pBtn , 0);

			pTxt = pHelp2Txt_ids[i];
			OSD_SetTextFieldContent(pTxt,STRING_ID,0);
		}
	}
}
Beispiel #2
0
void win_set_youtube_title()
{
	BITMAP *pBmp;
	TEXT_FIELD *pTxt;
	struct mp_title_tab_resource* titleitem;

	
	pBmp = &usb_title_bmp2;
	OSD_SetBitmapContent(pBmp, 0);
	pTxt = &usb_title_txt2;
	OSD_SetTextFieldContent(pTxt,STRING_ID,0);

	pBmp = &usb_title_bmp3;
	OSD_SetBitmapContent(pBmp, 0);
	pTxt = &usb_title_txt3;
	OSD_SetTextFieldContent(pTxt,STRING_ID,0);

	pBmp = &usb_title_bmp4;
	OSD_SetBitmapContent(pBmp, 0);
	pTxt = &usb_title_txt4;
	OSD_SetTextFieldContent(pTxt,STRING_ID,0);

	titleitem = &youtube_title_tab[0];
	pBmp = &usb_title_bmp1;
	pBmp->head.frame.uLeft=TITLE_YT_ICON1_L;
	OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
	pTxt = &usb_title_txt1;
	pTxt->head.frame.uLeft=TITLE_YT_ICON1_L+pBmp->head.frame.uWidth;
	pTxt->head.frame.uWidth=TITLE_YT_TXT_W;
	OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);

	
}
Beispiel #3
0
static void playlist_display_items(UINT16 uTop)
{
	UINT8 i;
	char str_buff[MAX_FILE_NAME_SIZE + 1];
	RET_CODE ret;
	TEXT_FIELD *pTxt;
	BITMAP *pBmp;
	FileInfo playlist_node;
	BOOL move_flag;
	UINT16 file_idx, curitem, index;
	POBJLIST pOl;

	pOl = &ol_playlist;
	curitem = OSD_GetObjListNewPoint(pOl);
	for(i = 0; i < PL_ITEM_CNT;i++)
	{
		index = uTop + i;
		move_flag = FALSE;
		if((moving_flag==1) && (move_file_idx != INVALID_IDX) && (index == curitem))
		{
			move_flag = TRUE;
		}

		file_idx = list_index_2_playlist_index(pOl, index);
		ret = get_file_from_play_list(cur_display_playlist,(file_idx +1),&playlist_node);

		if(ret == RET_SUCCESS)
		{
			pTxt = playlist_idxs[i];
			sprintf(str_buff,"%d",(uTop + i + 1));
			OSD_SetTextFieldContent(pTxt,STRING_ANSI,(UINT32)str_buff);
			pBmp = playlist_icons[i];
			OSD_SetBitmapContent(pBmp, file_icon_ids[playlist_node.filetype]);
			pTxt = playlist_files[i];
			//filter_unkownfont_name(playlist_node.name,str_buff);
			win_shorten_filename(playlist_node.name,str_buff);
			OSD_SetTextFieldContent(pTxt,STRING_UTF8,(UINT32)str_buff);
			pBmp = playlist_moveicons[i];
			if(move_flag == TRUE)
				//OSD_SetBitmapContent(pBmp, IM_TV_DEL);
				OSD_SetAttr(pBmp, C_ATTR_ACTIVE);				
			else
				OSD_SetAttr(pBmp, C_ATTR_HIDDEN);	
		}
		else
		{
			pTxt = playlist_idxs[i];
			OSD_SetTextFieldContent(pTxt,STRING_ANSI,(UINT32)"");
			pBmp = playlist_icons[i];
			OSD_SetBitmapContent(pBmp, 0);
			pTxt = playlist_files[i];
			OSD_SetTextFieldContent(pTxt,STRING_ANSI,(UINT32)"");
			pBmp = playlist_moveicons[i];
			OSD_SetAttr(pBmp, C_ATTR_HIDDEN);	
		}
	}
}
Beispiel #4
0
static void win_open_playlist_help(void)
{
    UINT8 i;
    UINT16 hlp_imgs[] =
    {
        IM_EPG_COLORBUTTON_RED,
        IM_EPG_COLORBUTTON_GREEN,
        IM_EPG_COLORBUTTON_YELLOW,
    };

    UINT16 hlp_strs[] = {
        RS_HELP_MOVE,
        RS_HELP_DELETE,
        RS_DELETE_ALL
    };


    DEF_BITMAP(hlp_bmp,NULL, NULL, \
               C_ATTR_ACTIVE,C_FONT_DEFAULT, \
               0, 0, 0, 0, 0, \
               0,0,0,0, \
               WSTL_MIX_BMP_HD, WSTL_MIX_BMP_HD, WSTL_MIX_BMP_HD, WSTL_MIX_BMP_HD, \
               NULL,NULL,  \
               C_ALIGN_LEFT| C_ALIGN_VCENTER, 0, 0,0)

    DEF_TEXTFIELD(hlp_txt,NULL,NULL,C_ATTR_ACTIVE,0, \
                  0,0,0,0,0, \
                  0,0,0,0, \
                  WSTL_TEXT_12_HD,WSTL_TEXT_12_HD,WSTL_TEXT_12_HD,WSTL_TEXT_12_HD,    \
                  NULL,NULL,  \
                  C_ALIGN_LEFT | C_ALIGN_VCENTER, 0,0,RS_COMMON_OK,NULL)

    for(i = 0; i < 2; i++)
    {
        OSD_SetObjRect((POBJECT_HEAD)&hlp_bmp, \
                       PL_HLP_L+i*(PL_HLP_ICON_W+PL_HLP_TXT_W1), PL_HLP_T, PL_HLP_ICON_W, PL_HLP_H);
        OSD_SetBitmapContent(&hlp_bmp, hlp_imgs[i]);
        OSD_DrawObject((POBJECT_HEAD)&hlp_bmp,C_UPDATE_ALL);

        OSD_SetObjRect((POBJECT_HEAD)&hlp_txt, \
                       PL_HLP_L+PL_HLP_ICON_W+i*(PL_HLP_ICON_W+PL_HLP_TXT_W1), PL_HLP_T, PL_HLP_TXT_W1, PL_HLP_H);
        OSD_SetTextFieldContent(&hlp_txt,STRING_ID,hlp_strs[i]);
        OSD_DrawObject((POBJECT_HEAD)&hlp_txt,C_UPDATE_ALL);
    }
    //show  delete all
    OSD_SetObjRect((POBJECT_HEAD)&hlp_bmp, \
                   PL_HLP_L+2*(PL_HLP_ICON_W+PL_HLP_TXT_W1), PL_HLP_T, PL_HLP_ICON_W, PL_HLP_H);
    OSD_SetBitmapContent(&hlp_bmp, hlp_imgs[2]);
    OSD_DrawObject((POBJECT_HEAD)&hlp_bmp,C_UPDATE_ALL);

    OSD_SetObjRect((POBJECT_HEAD)&hlp_txt, \
                   PL_HLP_L+PL_HLP_ICON_W+2*(PL_HLP_ICON_W+PL_HLP_TXT_W1), PL_HLP_T, PL_HLP_TXT_W2, PL_HLP_H);
    OSD_SetTextFieldContent(&hlp_txt,STRING_ID,hlp_strs[2]);
    OSD_DrawObject((POBJECT_HEAD)&hlp_txt,C_UPDATE_ALL);

}
Beispiel #5
0
void win_detitle_list_display()
{
    CONTAINER* con;
    TEXT_FIELD* text;
    OBJLIST* ol;
    UINT16 index, cnt,iconID;
    BITMAP *bmp;
    ol = &detitle_olist;
    cnt = OSD_GetObjListCount(ol);
    BOOL del_flag;
    //argly :), may remove status item later
    OSD_SetTextFieldContent(&detitle_status0, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status1, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status2, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status3, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status4, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status5, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status6, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status7, STRING_ID, (UINT32)0);
    OSD_SetTextFieldContent(&detitle_status8, STRING_ID, (UINT32)0);
    OSD_SetBitmapContent(&ca_detitle_delete_0, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_1, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_2, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_3, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_4, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_5, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_6, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_7, 0);
    OSD_SetBitmapContent(&ca_detitle_delete_8, 0);
    for(index=0; index<cnt; index++)
    {
        con = (CONTAINER*)detitle_olist_ListField[index];

        del_flag = detitle_get_del_flag(index);

        /* index */
        text = (TEXT_FIELD*)OSD_GetContainerNextObj(con);
        OSD_SetTextFieldContent(text, STRING_NUMBER, Detitle_Chknum[index]);

        /* status**/
        text = (TEXT_FIELD*)OSD_GetObjpNext(text);
        OSD_SetTextFieldContent(text, STRING_ID, (UINT32)RS_DETITLE_STATUS_READED);

        /* detitle confirm code**/
        //text = (TEXT_FIELD*)OSD_GetObjpNext(text);
        //OSD_SetTextFieldContent(text, STRING_NUMBER, (UINT32)Detitle_Chknum[index]);
        /* Delete */
        bmp = (BITMAP*)OSD_GetObjpNext(text);
        iconID = (del_flag) ?IM_TV_DEL: 0;
        OSD_SetBitmapContent(bmp, iconID);
    }

}
Beispiel #6
0
void win_set_device_icon(BITMAP *pBmp, char *lib_devicename)
{
	if(strncmp(lib_devicename, "ud", 2) == 0)
	{
#ifdef MAINMENU_TYPE_SEVEN
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_USB_3C);
#else
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_USB);
#endif
	}
	else if(strncmp(lib_devicename, "hd", 2) == 0)
	{
#ifdef MAINMENU_TYPE_SEVEN
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_HARDD_3C);
#else
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_HARDD);
#endif
	}
	else if(strncmp(lib_devicename, "sd", 2) == 0)
	{
#ifdef MAINMENU_TYPE_SEVEN
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_SD_3C);
#else
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_SD);
#endif
	}
	else
	{
		OSD_SetBitmapContent(pBmp, 0);
	}
}
Beispiel #7
0
static void win_srch_draw_bmp(OSD_RECT* pRect, UINT16 iconID)
{
	BITMAP* bmp;

	bmp = &srch_bmp;
	
	OSD_SetRect2(&bmp->head.frame,pRect);
	OSD_SetBitmapContent(bmp, iconID);
	OSD_DrawObject( (POBJECT_HEAD)bmp, C_UPDATE_ALL);
}
Beispiel #8
0
void win_set_device_icon(BITMAP *pBmp, char *lib_devicename)
{
	if(strncmp(lib_devicename, "ud", 2) == 0)
	{
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_USB);
	}
	else if(strncmp(lib_devicename, "hd", 2) == 0)
	{
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_HARDD);
	}
	else if(strncmp(lib_devicename, "sd", 2) == 0)
	{
		OSD_SetBitmapContent(pBmp, IM_MP3_ICON_MEM_SD);
	}
	else
	{
		OSD_SetBitmapContent(pBmp, 0);
	}
}
Beispiel #9
0
static void win_open_movefile_help(void)
{
	UINT8 i;
	UINT16 hlp_imgs[] =
	{
#ifdef MAINMENU_TYPE_SEVEN
		IM_OSD3C_MPLAY_GREEN,
		IM_MPLAY_HBUTTON_LR_GRAY,
		IM_3C_MPLAY_HBUTTON_I_GRAY,
#else
		IM_EPG_COLORBUTTON_GREEN,
		IM_MEDIAPLAY_HELPBUTTON_LR,
		IM_MEDIAPLAY_HELPBUTTON_I,
#endif
	};

	UINT16 hlp_strs[] = {
		RS_HELP_COPY,
		RS_MP_HELP_SWITCH,
		0};


	DEF_BITMAP(hlp_bmp,NULL, NULL, \
	C_ATTR_ACTIVE,C_FONT_DEFAULT, \
	0, 0, 0, 0, 0, \
	0,0,0,0, \
	WSTL_MIX_BMP_HD, WSTL_MIX_BMP_HD, WSTL_MIX_BMP_HD, WSTL_MIX_BMP_HD, \
	NULL,NULL,  \
	C_ALIGN_CENTER| C_ALIGN_VCENTER, 0, 0,0)
	
	DEF_TEXTFIELD(hlp_txt,NULL,NULL,C_ATTR_ACTIVE,0, \
	0,0,0,0,0, \
	0,0,0,0, \
	WSTL_TEXT_12_HD,WSTL_TEXT_12_HD,WSTL_TEXT_12_HD,WSTL_TEXT_12_HD,    \
	NULL,NULL,  \
	C_ALIGN_LEFT | C_ALIGN_VCENTER, 4,0,RS_COMMON_OK,NULL)
	
	for(i = 0; i < 3;i++)
	{
		OSD_SetObjRect((POBJECT_HEAD)&hlp_bmp, \
			MV_HLP_L+i*(MV_HLP_ICON_W+MV_HLP_TXT_W), MV_HLP_T, MV_HLP_ICON_W, MV_HLP_H);
		OSD_SetBitmapContent(&hlp_bmp, hlp_imgs[i]);
		OSD_DrawObject((POBJECT_HEAD)&hlp_bmp,C_UPDATE_ALL);

		OSD_SetObjRect((POBJECT_HEAD)&hlp_txt, \
			MV_HLP_L+MV_HLP_ICON_W+i*(MV_HLP_ICON_W+MV_HLP_TXT_W), MV_HLP_T, MV_HLP_TXT_W, MV_HLP_H);
		OSD_SetTextFieldContent(&hlp_txt,STRING_ID,hlp_strs[i]);
		OSD_DrawObject((POBJECT_HEAD)&hlp_txt,C_UPDATE_ALL);
	}
}
Beispiel #10
0
static BOOL spidercam_title_update(UINT8 param, BOOL status)//用来给16个选项赋状态,param为0~15的索引号,status为TURE高亮,为FALSE暗色
{
	UINT8 i;
	i = param;
	if(i<0||i>=SPIDERCAM_HOST_COUNT)
	return FALSE;

	spidercam_set_title_rect(TITLE_ITEM_L+i*(TITLE_ITEM_GRAP+TITLE_ITEM_W), TITLE_ITEM_T, TITLE_ITEM_W, TITLE_ITEM_H);

	uHostConStatus[i]	= status;	
	if(uHostConStatus[i])
	{
		OSD_SetBitmapContent(&spidercam_title_bitmap, spidercam_title_item_bmp_ids[BMP_ON_INDEX]);
	}
	else
	{
		OSD_SetBitmapContent(&spidercam_title_bitmap, spidercam_title_item_bmp_ids[BMP_OFF_INDEX]);
	}
	
	OSD_DrawObject( (POBJECT_HEAD)&spidercam_title_bitmap, C_UPDATE_ALL);
	return TRUE;

}
Beispiel #11
0
static void spidercam_title_display()
{
	UINT8 i;

	for(i=0;i<SPIDERCAM_HOST_COUNT;i++)
	{
		spidercam_set_title_rect(TITLE_ITEM_L+i*(TITLE_ITEM_GRAP+TITLE_ITEM_W), TITLE_ITEM_T, TITLE_ITEM_W, TITLE_ITEM_H);

		if(uHostConStatus[i])
		{
			OSD_SetBitmapContent(&spidercam_title_bitmap, spidercam_title_item_bmp_ids[BMP_ON_INDEX]);
		}
		else
		{
			OSD_SetBitmapContent(&spidercam_title_bitmap, spidercam_title_item_bmp_ids[BMP_OFF_INDEX]);
		}

		OSD_SetTextFieldContent(&spidercam_title_txtname,STRING_NUMBER, i+1);
		
		OSD_DrawObject( (POBJECT_HEAD)&spidercam_title_bitmap, C_UPDATE_ALL);
		OSD_DrawObject( (POBJECT_HEAD)&spidercam_title_txtname, C_UPDATE_ALL);
	}

}
Beispiel #12
0
static void win_progress_bar_draw_bmp(UINT16 iconID)
{
	BITMAP* bmp;
//	OSD_RECT rect;
	UINT32 posi;

	bmp = &progress_bar_bmp;

//	win_usb_backup_tmr_loop++;
//	posi = win_usb_backup_tmr_loop % PROGRESS_BAR_ICON_CNT;
//	OSD_SetRect(&rect, INFO_WAV_L, INFO_WAV_T, INFO_WAV_W, INFO_WAV_H);

//	OSD_SetRect2(&bmp->head.frame,pRect);
	OSD_SetBitmapContent(bmp, progress_bar_ids[iconID]);
	OSD_DrawObject( (POBJECT_HEAD)bmp, C_UPDATE_ALL);
}
void win_mlimit_draw_bmpinfo(UINT32 pos,UINT32 state)
{
	BITMAP* bmp;
	UINT16 icon;

	bmp = &mlimit_bmpinfo;
	bmp->head.frame.uLeft = (pos == 0)? BMPINFO_L1 : BMPINFO_L2;

	if(state>=2)
		icon = 0;
	else
		icon = bmp_info_icons[pos][state];
	
	OSD_SetBitmapContent(bmp, icon);

	OSD_DrawObject((POBJECT_HEAD)bmp,C_UPDATE_ALL);
}
Beispiel #14
0
void win_progname_draw_bmp(void)
{
	UINT32 i,j;
	BITMAP* bmp;
	UINT16 icon;
	prog_bmp_t_gray* p_prog_bmp;
	bmp = &prog_bmp;
	for(i=0;i<PROG_BMP_GRAY_NUM;i++)
	{
		p_prog_bmp = &prog_bmps_gray[i];
		icon = prog_bmps_gray[i].icon;
		OSD_SetBitmapContent(bmp, icon);
		OSD_SetRect(&bmp->head.frame, p_prog_bmp->left, p_prog_bmp->top, p_prog_bmp->width,p_prog_bmp->height);
		OSD_DrawObject( (OBJECT_HEAD*) bmp, C_UPDATE_ALL);
	}
   
}
Beispiel #15
0
void win_screen_prog_infor(void)
{

	UINT16 cur_channel;
	P_NODE p_node;
	char string[100]={0};
	UINT16 unistr_dest[200]={0};
	
	TEXT_FIELD* txt;
	txt = &g_screen_saver_text;
	BITMAP* bmp;
       bmp = &g_screen_saver_bmp;
	
	memset(string,0,sizeof(string));
	memset(unistr_dest,0,sizeof(unistr_dest));

	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	get_prog_at(cur_channel,&p_node);

	sprintf(string,"%04d  ",cur_channel + 1);
	ComAscStr2Uni(string,unistr_dest);      
	ComUniStrCat(&unistr_dest,(UINT32)p_node.service_name); 
	if( p_node.ca_mode)   //guop add 20110624
	{
		OSD_SetTextFieldContent(txt, STRING_ANSI,(UINT32)"Scrambled");
	}
	else
	{
		OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)unistr_dest);
	}
	txt->head.frame.uTop = top_offset+70;
	txt->head.frame.uLeft= left_offset+20;

//	OSD_SetBitmapContent(bmp, IM_SCREEN_SAVER_RADIO);
	OSD_SetBitmapContent(bmp, IM_VOLUME);
	bmp->head.frame.uTop = top_offset+15;
	bmp->head.frame.uLeft= left_offset+85;


}
Beispiel #16
0
void win_progname_draw_infor(void)
{
	UINT16 group_name[MAX_SERVICE_NAME_LENGTH + 1 + 10];
	UINT8   group_type,av_mode;

	UINT16 cur_channel;
	P_NODE p_node;
	S_NODE s_node;
//	T_NODE t_node;
	char string[100];
	char prog_name[MAX_SERVICE_NAME_LENGTH + 1];
	INT32 ret,len;
	UINT32 i,j;
	BITMAP* bmp;
	TEXT_FIELD* txt;
	UINT16 icon;
	date_time dt;
	prog_txt_t* p_prog_txt;
	prog_bmp_t* p_prog_bmp;
	eit_event_info_t *pe=NULL,*fe=NULL;
	UINT8 *s1=NULL,*s2=NULL;
	INT32 strlen;
	struct ACTIVE_SERVICE_INFO service;

	struct t_ttx_lang *ttx_lang_list;
	UINT8 ttx_lang_num;
	struct t_subt_lang* sub_lang_list;
	UINT8 sub_lang_num;

	bmp = &prog_bmp;
	txt = &prog_text;
	UINT32 fav_mask;

	fav_mask = 0;
	for(i=0;i<MAX_FAVGROUP_NUM;i++)
		fav_mask |= (0x01<<i);


	av_mode = sys_data_get_cur_chan_mode();
	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	ret = get_prog_at(cur_channel,&p_node);
	get_sat_by_id(p_node.sat_id, &s_node);
	get_cur_group_name((char*)group_name,&group_type);
	get_local_time(&dt);
/*
#ifdef _EPG_MULTI_SERVICE
#ifdef EPG_FAST_PARSE			
	epg_fast_pasrse_set(FALSE,NULL,NULL);
#endif
	get_tp_by_id(p_node.tp_id, &t_node);
	api_epg_parse(p_node.tp_id, t_node.network_id, t_node.t_s_id, p_node.prog_number, epg_type_pf);

	struct active_service_t service;
	service.tp_id = p_node.tp_id;
	service.orig_network_id = t_node.network_id;
	service.ts_id = t_node.t_s_id;
	service.service_id = p_node.prog_number;
	api_epg_set_active_service(&service, 1);

	api_epg_parse(p_node.tp_id, t_node.network_id, t_node.t_s_id, p_node.prog_number, epg_type_pf);
#endif
*/
	service.tp_id = p_node.tp_id;
	service.service_id = p_node.prog_number;
	epg_set_active_service(&service, 1);

	/*current next epg info */
	pe=epg_get_cur_service_event((INT32)cur_channel, PRESENT_EVENT, NULL,NULL,NULL, /*event_update*/TRUE);
	fe=epg_get_cur_service_event((INT32)cur_channel, FOLLOWING_EVENT, NULL,NULL,NULL, event_update);
    if(event_update==FALSE)
    {
        if(pe==NULL || fe==NULL)
        {
            event_update = TRUE;    
        }
    }
    else
    {
        if(pe!=NULL && fe!=NULL)
        {
            event_update = FALSE;
        }
    }
	s1=epg_get_event_name(pe, &len);
//	s1=(UINT8*)epg_get_event_name(pe, present_name, 32);
	s2=epg_get_event_name(fe, &len);
//	s2=(UINT8*)epg_get_event_name(fe, following_name, 32);

	TTXEng_GetInitLang(&ttx_lang_list, &ttx_lang_num);
	subt_get_language(&sub_lang_list ,&sub_lang_num);
	if(sub_lang_num == 0)
		TTXEng_GetSubtLang(&ttx_lang_list,&sub_lang_num);

		
	for(i=0;i<PROG_BMP_NUM;i++)
	{
	    p_prog_bmp = &prog_bmps[i];
	    icon = INVALID_ID;
	    switch(p_prog_bmp->bmp_type)
	    {
	     case PROG_BMP_STATIC:
	        icon = prog_bmps[i].icon;
	       break;
#ifndef MODIFY_FOR_EGYPT_CUSTOMER	   
	    case PROG_BMP_AV_TYPE:
	        if(av_mode==TV_CHAN)
	            icon = IM_INFO_BAR_TV;
	        else
	            icon = IM_INFO_BAR_RADIO;            
	        break;
#endif
	    case PROG_BMP_EPG:
	        if( (s1||s2) )
	            icon = prog_bmps[i].icon;
	        break;
	    case PROG_BMP_TTX:
			if(ttx_lang_num>0)
	            icon = prog_bmps[i].icon;
	        break;
	    case PROG_BMP_SUBT:
			if(sub_lang_num>0)
	            icon = prog_bmps[i].icon;
	        break;			
	    case PROG_BMP_LOCK:
	        if(p_node.lock_flag)
	            icon = prog_bmps[i].icon;
	        break;
	    case PROG_BMP_FAV:
			if(p_node.fav_group[0] & fav_mask)
				icon = prog_bmps[i].icon;
	       break;
	    case PROG_BMP_CA:
			{
#if 0				
				BOOL			b,bFlag;

				INT8 level,quality,lock;
				signal_lock_status lock_flag;
				signal_scramble_status scramble_flag;
				signal_lnbshort_status lnbshort_flag;
				signal_parentlock_status parrentlock_flag;

				bFlag = GetSignalStatus(&lock_flag, &scramble_flag,&lnbshort_flag,&parrentlock_flag);  
				if(bFlag && lock_flag== SIGNAL_STATUS_LOCK
					&& lnbshort_flag==SIGNAL_STATUS_LNBNORMAL 
					&& parrentlock_flag==SIGNAL_STATUS_PARENT_UNLOCK
					&& scramble_flag == SIGNAL_STATUS_SCRAMBLED)
					icon = prog_bmps[i].icon;
#else
				if(p_node.ca_mode)
					icon = prog_bmps[i].icon;
#endif				
					
        	}
			break;
        default:
            break;
        }
	OSD_SetBitmapContent(bmp, icon);
	OSD_SetRect(&bmp->head.frame, p_prog_bmp->left, p_prog_bmp->top, p_prog_bmp->width,p_prog_bmp->height);
	OSD_DrawObject( (OBJECT_HEAD*) bmp, C_UPDATE_ALL);
    }
    
    for(i=0;i<PROG_TXT_NUM;i++)
    {
        p_prog_txt = &prog_txts[i];
        
        string[0] = '\0';
        switch(p_prog_txt->txt_type)
        {
        case PROG_TXT_PROG_NAME: 
#ifndef DB_USE_UNICODE_STRING  
            STRCPY(prog_name,p_node.service_name);
            for(j=0;j<STRLEN(prog_name);j++)
                if(prog_name[j] >= 0x80)
                {
                    prog_name[j] = '\0';
                    break;
                }
            if(p_node.ca_mode==0)
                sprintf(string,"%s(%s)",prog_name,s_node.sat_name);
            else
                sprintf(string,"$%s(%s)",prog_name,s_node.sat_name);

#else
            if(p_node.ca_mode==0)
                STRCPY(string,"");
            else
                STRCPY(string,"$");
			
            ComAscStr2Uni(string,len_display_str);
            strlen = ComUniStrLen( len_display_str);
            //strcpy_uni(&len_display_str[strlen],p_node.service_name);
            ComUniStrCopyChar((UINT8 * )&len_display_str[strlen],p_node.service_name);
            strlen = ComUniStrLen( len_display_str);
            ComAscStr2Uni("(",&len_display_str[strlen]);
            strlen = ComUniStrLen( len_display_str);
            ComUniStrCopyChar((UINT8 * )&len_display_str[strlen],s_node.sat_name);
            strlen = ComUniStrLen( len_display_str);
            ComAscStr2Uni(")",&len_display_str[strlen]);
#endif            
            
            break;
        case PROG_TXT_DATE:
            sprintf(string,"%02d/%02d",dt.month,dt.day);
            ComAscStr2Uni(string, (UINT16 *)len_display_str);
            break;
        case PROG_TXT_TIME:
            sprintf(string,"%02d:%02d",dt.hour,dt.min);
            ComAscStr2Uni(string, (UINT16 *)len_display_str);
            break;
        case PROG_TXT_PROG_NUM:
            sprintf(string,"%04d",cur_channel + 1);
            ComAscStr2Uni(string, (UINT16 *)len_display_str);
            break;
        case PROG_TXT_EPG_NOW:
            if (s1 )				
			{
				sprintf(string,"Now: ");
				ComAscStr2Uni(string, (UINT16 *)len_display_str);
				len =ComUniStrLen(len_display_str);
				ComUniStrCopyChar((UINT8*)&len_display_str[len],s1);
			}
            else
			{
                        OSD_SetTextFieldStrPoint(txt,NULL);
                        OSD_SetTextFieldContent(txt,STRING_ID,RS_EPG_NO_INFORMATION);
			}
            break;
        case PROG_TXT_EPG_NEXT:
            if (s2)				
			{
				sprintf(string,"Next: ");
				ComAscStr2Uni(string, (UINT16 *)len_display_str);
				len =ComUniStrLen(len_display_str);
				ComUniStrCopyChar((UINT8*)&len_display_str[len],s2);		
			}
            else
			{
	            sprintf(string," ");
	            ComAscStr2Uni(string, (UINT16 *)len_display_str);
			}
    	     break;
        case PROG_TXT_PROG_GROUP:
#ifndef DB_USE_UNICODE_STRING  
            sprintf(string,"%s",group_name);
#else
            ComUniStrCopy(len_display_str, group_name);
#endif
            break;
        default:
            ;
        }  

#ifndef DB_USE_UNICODE_STRING
        ComAscStr2Uni(string, (UINT16 *)len_display_str);
#else

/*
        if(p_prog_txt->txt_type != PROG_TXT_PROG_NAME 
            && p_prog_txt->txt_type != PROG_TXT_PROG_GROUP
                        &&p_prog_txt->txt_type != PROG_TXT_EPG_NOW
            &&p_prog_txt->txt_type != PROG_TXT_EPG_NEXT)
            ComAscStr2Uni(string, (UINT16 *)len_display_str);
*/
	if(p_prog_txt->txt_type == PROG_TXT_PROG_NUM) 
		txt->head.bFont = 2;
	else
		txt->head.bFont = 0;
 
#endif

	OSD_SetRect(&txt->head.frame, p_prog_txt->left, p_prog_txt->top, p_prog_txt->width,p_prog_txt->height);
	//txt->pText = (UINT8*)len_display_str;
	txt->head.style.bShowIdx = p_prog_txt->shidx;
	OSD_DrawObject( (OBJECT_HEAD *)txt, C_UPDATE_ALL);
	OSD_SetTextFieldContent(txt,STRING_ID,0);
	OSD_SetTextFieldStrPoint(txt,len_display_str);
    }
#ifdef MODIFY_FOR_EGYPT_CUSTOMER
	progname_signal_refresh(TRUE);
#endif

}
Beispiel #17
0
static void mail_disp()
{
	UINT32 i, valid_idx;
	UINT32 MJD_Date;
	UINT16 UTC_Date[3];
	UINT8 K;
	UINT8 asc_str[100];
	UINT16 top, cnt, page, index, strid,iconID;
	UINT16 mail_title[40+1], date[20];
	UINT8 str[6];//-----yuanlin
	BOOL del_flag;
	OBJLIST *ol;
	CONTAINER *item;
	TEXT_FIELD *txt;
	BITMAP *bmp;

	ol = &mail_ol;

	cnt = OSD_GetObjListCount(ol);
	page = OSD_GetObjListPage(ol);
	top = OSD_GetObjListTop(ol);

	for (i = 0; i < page; i++)
	{
		item = (CONTAINER*)mail_ol_ListField[i];
		index = top + i;
		del_flag = FALSE;

		valid_idx = (index < cnt) ? 1 : 0;
		if (valid_idx)
		{
			del_flag = mail_get_del_flag(index);
		}

		/* IDX */
		txt = (TEXT_FIELD*)OSD_GetContainerNextObj(item);
		if (valid_idx)
		{
			sprintf(str, "%02d", index + 1);
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str);
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");
         
		/*mail title*/
		txt = (TEXT_FIELD*)OSD_GetObjpNext(txt);
		if (valid_idx)
		{
			convert_gb2312_to_unicode(email_head[index].title, 40+1, mail_title, 40+1);
			OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)mail_title);
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");
		wincom_scroll_textfield_stop(txt);



		
		/* time */
		txt = (TEXT_FIELD*)OSD_GetObjpNext(txt);
		if (valid_idx)
		{
			#if 1
			MEMSET(len_display_str, 0, sizeof(len_display_str));
			MJD_Date = email_head[index].create_Time[0]*256 + email_head[index].create_Time[1];
			UTC_Date[0] = ( MJD_Date-15078.2 )/365.25;//MJD算法计算发行年份
			UTC_Date[1] =  ( MJD_Date-14956.1-(UINT32)(UTC_Date[0]*365.25))/30.6001;//月份
			UTC_Date[2] = MJD_Date-14956-(UINT32)(UTC_Date[0]*365.25)-(UINT32)(UTC_Date[1]*30.6001);//日期
			if( (UTC_Date[1]==15) || (UTC_Date[1]==14) )
				K=1;
			else
				K=0;
			UTC_Date[0] += K;
			UTC_Date[1] = UTC_Date[1]-1-K*12;
			UTC_Date[0] += 1900;//Year since 1900
			
			sprintf(asc_str, "%02d%02d-%02d-%02d",(UINT8)(UTC_Date[0]/100),(UINT8)(UTC_Date[0]%100),UTC_Date[1],UTC_Date[2]);
			ComAscStr2Uni(asc_str, len_display_str);
			
			OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)len_display_str);
			#else
			convert_sysdate_to_uni(email_head[index].create_Time, date);
			date[16] = '\0';
			OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)date);
			#endif
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");
        
			/* Delete */
		bmp = (BITMAP*)OSD_GetObjpNext(txt);
		iconID = (del_flag) ?IM_TV_DEL: 0;
		OSD_SetBitmapContent(bmp, iconID);
         
	}
}
Beispiel #18
0
static void win_satlist_set_display(void)
{
	UINT32 i,j,n,lnb_cnt;
	S_NODE s_node;
	OBJLIST* ol;
	UINT16 top,cnt,page,index,curitem;
	UINT32 valid_idx,sat_longitude,ew_flag;
	CONTAINER* item;
	TEXT_FIELD* txt;
	char str[30];
	UINT16 icon_id;
	BITMAP* bmp;
	SYSTEM_DATA* sys_data;
	UINT8	hl_idx;

	sys_data = sys_data_get();
	
#ifdef SUPPORT_TWO_TUNER
	if(sys_data->antenna_connect_type == ANTENNA_CONNECT_DUAL_DIFF)
		lnb_cnt = 2;
	else
		lnb_cnt = 1;
#endif		


	ol = &satlist_olist;

	cnt = OSD_GetObjListCount(ol);
	page = OSD_GetObjListPage(ol); 
	top = OSD_GetObjListTop(ol);
	curitem = OSD_GetObjListNewPoint(ol);

	for(i=0;i<page;i++)
	{
		item = (CONTAINER*)satlist_items[i];
		index = top + i;
		
		if(index< cnt)
			valid_idx = 1;
		else
			valid_idx = 0;		

		if(valid_idx)
			get_sat_at(index,VIEW_ALL,&s_node);

		 /* Sat IDX */
		txt = (PTEXT_FIELD)OSD_GetContainerNextObj(item);
		if(valid_idx)
			OSD_SetTextFieldContent(txt, STRING_NUMBER, (UINT32) (index + 1));
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");

		/* Sat Name*/
		txt = (PTEXT_FIELD)OSD_GetObjpNext(txt);
		if(valid_idx)
#ifdef DB_USE_UNICODE_STRING
			OSD_SetTextFieldContent(txt, STRING_UNICODE,(UINT32)s_node.sat_name);
#else
			OSD_SetTextFieldContent(txt, STRING_ANSI,(UINT32),s_node.sat_name);
#endif
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");


		 /* Sat Orbit*/
		txt = (PTEXT_FIELD)OSD_GetObjpNext(txt);
		if(valid_idx)
		{
			sat_longitude = s_node.sat_orbit; 
            if(sat_longitude>1800)
            {
                sat_longitude = 3600 - sat_longitude;
                ew_flag = 0;
            }
            else
                ew_flag = 1;
            sprintf(str,"%s %d.%d",ew_flag? "E" : "W",
                sat_longitude/10, 
                sat_longitude%10);

			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str);
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");

#ifdef SUPPORT_TWO_TUNER
		for(j=0;j<lnb_cnt;j++)
		{
			icon_id = 0;
			if(valid_idx)
			{
				if((j==0 && s_node.tuner1_valid) || (j==1 && s_node.tuner2_valid))
				{
#ifndef SUPPORT_SELECT_SAME_SAT
					if(s_node.tuner1_valid && s_node.tuner2_valid)
					{
						s_node.tuner2_valid = 0;
						modify_sat(s_node.sat_id, &s_node);
					}
#endif /* #if0 */
					icon_id = IM_TV_FAVORITE;
				}
			}
			
			bmp = sat_lnb_sel_bmps[i][j];
			OSD_SetBitmapContent(bmp, icon_id);

			hl_idx = BMP_HL_IDX;
			if(index == curitem)
			{
				if(OSD_GetFocusObject((POBJECT_HEAD)item) == (POBJECT_HEAD)bmp)
					hl_idx = BMP_HLEDIT_IDX;
			}
			bmp->head.style.bHLIdx = hl_idx;

		}

#endif		

	}
Beispiel #19
0
static void SetSingnalStr(void)
{
    TEXT_FIELD*  txt;
    BITMAP*    bmp;
#ifdef CTI_CA
	UINT8 error;
	char str[100]={0};
#endif

    UINT16 strID;
    UINT16 imageID;

	txt = &sigstatus_txt;
	bmp = &sigstatus_bmp1;
#ifdef CTI_CA
	memset(str,0,sizeof(str));
#endif

	if (win_signal_status_show_unlocked())
	{
	    imageID = ICON_ID_SIGNAL_NO;
	    strID = STRING_ID_SIGNAL_NO;
	}
	else if (win_signal_status_show_scrambled())
	{
	    imageID = ICON_ID_SIGNAL_SCRAMBLED;
	    strID = STRING_ID_SIGNAL_SCRAMBLED;
#ifdef CTI_CA
		error = get_cti_error_code();
		if( error< 31)
		{
			sprintf(str,"E%02d, %s", error,cti_errocode_string[error]);
		}
		else
			sprintf(str,"E%02d !!!", error);
#endif
	}
	else if(lv_lnbshort_status == SIGNAL_STATUS_LNBSHORT
#ifdef SYS_12V_SHORT_DET
#if(SYS_12V_SHORT_DET== SYS_FUNC_ON)
		|| v12_power_short == SIGNAL_STATUS_LNBSHORT
#endif
#endif
			)
	{
	    imageID = ICON_ID_SIGNAL_LNBSHORT;
	    strID = STRING_ID_SIGNAL_LNBSHORT;
	}
	else if(lv_parrentlock_status == SIGNAL_STATUS_PARENT_LOCK)
	{
		imageID = ICON_ID_SIGNAL_PARRENTLOCK;
		strID = STRING_ID_SIGNAL_PARRENTLOCK;
	}
	else 
	{
		imageID = 0;
		strID = 0;
	}
#ifdef CTI_CA
	OSD_SetTextFieldContent(&cti_prompt_txt, STRING_ANSI, (UINT32)str);
#endif
	OSD_SetTextFieldContent(txt, STRING_ID, strID);
	OSD_SetBitmapContent(bmp, imageID);
}
Beispiel #20
0
static PRESULT slide_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT16 slide_interval;
	PlayListLoopType loop_type;
    struct osd_device *osd_dev;
    struct OSDRect pRect;
   	struct OSDPara OpenPara;    
    UINT32 region_id =0;

	VACTION unact;
	FileInfo file_node;
	char image_name[FULL_PATH_SIZE];
	int next_image;
	static UINT8 timer_start_flag = 0;
	UINT32 file_idx;
	SYSTEM_DATA *sys_cfg = sys_data_get();

	switch(event)
	{
    case EVN_PRE_OPEN:
		imageslide_timer_id = OSAL_INVALID_ID;
		imageslide_proc_id = OSAL_INVALID_ID;

		if(from_imagepreview == TRUE)
		{
			imageslide_pause_state = IMG_PAUSE_STATE;
		}
		else
		{
			imageslide_pause_state = IMG_UNPAUSE_STATE;
		}
		win_imageslide_showpause();
		api_set_preview_vpo_color(FALSE);
		vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,0), TV_4_3, NORMAL_SCALE);
#ifdef DUAL_VIDEO_OUTPUT
		vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,1), TV_4_3, NORMAL_SCALE);
#endif
		break;
    case EVN_POST_OPEN:
		image_rot_ang = ANG_ORI;
		
		loop_type = image_slide_setting.bRepeat ? PLAY_LIST_REPEAT : PlAY_LIST_SEQUENCE;
		set_play_list_info(cur_playlist_image,&cur_image_idx,&loop_type);

		get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
		win_get_fullname(image_name, file_node.path, file_node.name);
//        while(jpeg_decoder_task_not_over)
//        {
//            libc_printf("error condition!\n");
//            osal_task_sleep(20);
//        }
        image_abort();
        timer_slide = osal_get_tick();
		win_image_file_play(image_name, image_rot_ang);
		slideidx_display(TRUE);
		decode_finish_flag = FALSE;        
        break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		ret = win_imageslide_unkown_act_proc(unact);
		break;
	case EVN_PRE_CLOSE:
		g_from_imageslide = TRUE;
		imagedec_ioctl(1, IMAGEDEC_IO_CMD_CLEAN_FRM, TRUE);	//when quit win_slide, clean 2 frm buffer
		
		if(image_folderloop_flag == 1)//filelist
		{
			get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
			win_get_fullname(image_name, file_node.path, file_node.name);
			usblist_set_filelist_param(image_name);
		}
		image_abort();
///*
#ifdef  DUAL_ENABLE
#ifdef  PNG_GIF_TEST  

        pRect.uLeft =136;
	    pRect.uTop = 40;
	    pRect.uWidth = 1008;//OSD_MAX_WIDTH;//608;
	    pRect.uHeight = 640;//OSD_MAX_HEIGHT;//430;	
    
        OpenPara.eMode = OSD_HD_ARGB1555;
        OpenPara.uGAlpha = 0x0f;
        OpenPara.uGAlphaEnable = 0;
        OpenPara.uPalletteSel = 0;
        osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 0);
        if (osd_dev != NULL)
	    {		
            OSDDrv_Close((HANDLE)osd_dev);
            //AD_GIF_PRINTF("%s() OSD_layer2 is closed!\n", __FUNCTION__);
        }
        OSDDrv_Open((HANDLE)osd_dev, &OpenPara);
        osal_task_sleep(20);
        //trans_color = OSD_GetTransColor(OpenPara.eMode,TRUE);
	    OSDDrv_IoCtl((HANDLE)osd_dev, OSD_IO_SET_TRANS_COLOR, 0x00);
	    OSDDrv_CreateRegion((HANDLE)osd_dev, region_id, &pRect, NULL);
        pRect.uLeft = pRect.uTop = 0;
        OSDDrv_RegionFill((HANDLE)osd_dev,region_id,&pRect,0x00);   
        OSDDrv_ShowOnOff((HANDLE)osd_dev, TRUE); 
            
#endif            
#endif
//*/        
		api_stop_timer(&imageslide_timer_id);
		api_stop_timer(&imageslide_proc_id);
        timer_start_flag = 0;
		imageslide_timer_id = OSAL_INVALID_ID;
		imageslide_proc_id = OSAL_INVALID_ID;
		win_set_image_multiview_firstidx();
		sys_cfg = sys_data_get();
		sys_data_set_display_mode(&(sys_cfg->avset));

		OSD_ClearObject((POBJECT_HEAD)&imageslide_idx,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&imageslide_pause,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&decode_txt_progress,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
		break;
	case EVN_POST_CLOSE:
		image_restore_vpo_rect();//TODO
		break;
	case EVN_MSG_GOT:
        if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
        {
			//storage_dev_mount_hint(1);
			file_list_check_storage_device(FALSE, FALSE);
        }
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER)
		{
            if(param2 > timer_slide)
            {
    			image_abort();
            }
            else
            {
                libc_printf("slide @@@@@@@@@@@@@@ es case\n");
                break;
            }
			decode_finish_flag = TRUE;
			if(imageslide_pause_state == IMG_UNPAUSE_STATE)
		    {
				slide_interval = (image_slide_setting.uTime_gap * 1000);
				if(0 != slide_interval)
					imageslide_timer_id = api_start_timer("IMAGESLIDE",slide_interval,win_imageslide_handler);
				else
				{
					imageslide_pause_state = IMG_PAUSE_STATE;
					win_imageslide_showpause();
				}
			}
		}
		else if (param1 == CTRL_MSG_SUBTYPE_STATUS_IMGTOOVER) // timer timeouts
		{
			//TODO: play next
			
//            while(jpeg_decoder_task_not_over)
//            {
//                libc_printf("\n%%%%%%%%%%%%%%%%%%%%%%%%%\n");
//                osal_task_sleep(20);
//            }
			image_abort();
			next_image = get_next_index_from_play_list(cur_playlist_image);
			
			if (next_image != -1)
			{
				cur_image_idx = next_image;
				set_play_list_info(cur_playlist_image,&cur_image_idx,NULL);
				get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
				win_get_fullname(image_name, file_node.path, file_node.name);
				win_image_file_play(image_name, image_rot_ang);
				decode_finish_flag = FALSE;
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_UPDATE_VIEW, 0, TRUE);
			}
			else
			{
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT, 0,TRUE);
			}
		}
		else if(param1 == CTRL_MSG_SUBTYPE_CMD_EXIT)
		{
			if(from_imagepreview == TRUE)
				back_to_filelist = TRUE;
			ret = PROC_LEAVE;
		}
		else if(param1 == CTRL_MSG_SUBTYPE_CMD_UPDATE_VIEW)
		{
			slideidx_display(TRUE);
			ret = PROC_LOOP;
		}
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_MP3OVER)
		{
			win_play_next_music_ex();
		}
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_PROC_UPDATE)
		{
			OSD_SetBitmapContent(&decode_bmp_progress, loading_bmp_ids[proc_cnt]);
			OSD_DrawObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
			proc_cnt ++;
			if(proc_cnt >= LOADING_MAX)
				proc_cnt = 0;
		}		
		
		if ((param1 == CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_PROCESS) || (param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER))
		{
			if ((param2 < 100) && (param1 == CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_PROCESS))
			{
				loading_progress = (param2 * LOADING_MAX)/100;
				if (loading_progress > LOADING_MAX - 1)
					loading_progress = LOADING_MAX - 1;

				if(0 == timer_start_flag)
				{
					imageslide_proc_id = OSAL_INVALID_ID;
					imageslide_proc_id = api_start_cycletimer("SLIDE_PROC", 200, win_imageslide_proc_handler);
					timer_start_flag = 1;
				}
			//	OSD_SetBitmapContent(&decode_bmp_progress, loading_bmp_ids[loading_progress]);
			//	OSD_DrawObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
			}
			else if((param2 >= 100) || (param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER))
			{
				OSD_ClearObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
				api_stop_timer(&imageslide_proc_id);
				imageslide_proc_id = OSAL_INVALID_ID;
				timer_start_flag = 0;
				proc_cnt = 0;
			//	imageslide_proc_id = OSAL_INVALID_ID;
			}
		}
		break;
	default:
		break;
	}

	return ret;
}
Beispiel #21
0
void win_set_mp_pvr_title(UINT8 main_title, TITLE_TYPE title_type)
{
	BITMAP *pBmp;
	TEXT_FIELD *pTxt;
	struct mp_title_tab_resource* titleitem;
	TITLE_TYPE type;
	POBJECT_HEAD pObj;

	if(main_title == 1)
	{
		type = title_type;
		titleitem = &title_tab[type];
		pBmp = &usb_title_bmp1;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt1;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);

		type = (title_type+1)%TITLE_NUMBER;
		titleitem = &title_tab[type+TITLE_NUMBER];
		pBmp = &usb_title_bmp2;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt2;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);
     	OSD_SetColor(pTxt, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH);

		type = (title_type+2)%TITLE_NUMBER;
		titleitem = &title_tab[type+TITLE_NUMBER];
		pBmp = &usb_title_bmp3;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt3;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);
     	OSD_SetColor(pTxt, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH);

		type = (title_type+3)%TITLE_NUMBER;
		titleitem = &title_tab[type+TITLE_NUMBER];
		pBmp = &usb_title_bmp4;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt4;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);
     	OSD_SetColor(pTxt, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH);
	}
	else
	{
		type = title_type;
		titleitem = &title_tab[type];
		pBmp = &usb_title_bmp1;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt1;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);

		type = (title_type+1)%TITLE_NUMBER;
		titleitem = &title_tab[type+TITLE_NUMBER*2];
		pBmp = &usb_title_bmp2;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt2;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);
     	OSD_SetColor(pTxt, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY);

		type = (title_type+2)%TITLE_NUMBER;
		titleitem = &title_tab[type+TITLE_NUMBER*2];
		pBmp = &usb_title_bmp3;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt3;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);
     	OSD_SetColor(pTxt, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY);

		type = (title_type+3)%TITLE_NUMBER;
		titleitem = &title_tab[type+TITLE_NUMBER*2];
		pBmp = &usb_title_bmp4;
		OSD_SetBitmapContent(pBmp, titleitem->bmp_id);
		pTxt = &usb_title_txt4;
		OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id);
     	OSD_SetColor(pTxt, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY);
	}
}
Beispiel #22
0
static PRESULT slide_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT16 slide_interval;
	PlayListLoopType loop_type;

	VACTION unact;
	FileInfo file_node;
	char image_name[FULL_PATH_SIZE];
	int next_image;
	static UINT8 timer_start_flag = 0;
	UINT32 file_idx;

	switch(event)
	{
    case EVN_PRE_OPEN:
		imageslide_timer_id = OSAL_INVALID_ID;
		imageslide_proc_id = OSAL_INVALID_ID;

		if(from_imagepreview == TRUE)
		{
			imageslide_pause_state = IMG_PAUSE_STATE;
		}
		else
		{
			imageslide_pause_state = IMG_UNPAUSE_STATE;
		}
		win_imageslide_showpause();
		api_set_preview_vpo_color(FALSE);
		break;
    case EVN_POST_OPEN:
		image_rot_ang = ANG_ORI;
		
		loop_type = image_slide_setting.bRepeat ? PLAY_LIST_REPEAT : PlAY_LIST_SEQUENCE;
		set_play_list_info(cur_playlist_image,&cur_image_idx,&loop_type);

		get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
		win_get_fullname(image_name, file_node.path, file_node.name);
		win_image_file_play(image_name, image_rot_ang);
		slideidx_display(TRUE);
		decode_finish_flag = FALSE;        
        break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		ret = win_imageslide_unkown_act_proc(unact);
		break;
	case EVN_PRE_CLOSE:
		g_from_imageslide = TRUE;
		imagedec_ioctl(1, IMAGEDEC_IO_CMD_CLEAN_FRM, TRUE);	//when quit win_slide, clean 2 frm buffer
		
		if(image_folderloop_flag == 1)//filelist
		{
			get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
			win_get_fullname(image_name, file_node.path, file_node.name);
			usblist_set_filelist_param(image_name);
		}
		image_abort();
		api_stop_timer(&imageslide_timer_id);
		api_stop_timer(&imageslide_proc_id);
        timer_start_flag = 0;
		imageslide_timer_id = OSAL_INVALID_ID;
		imageslide_proc_id = OSAL_INVALID_ID;
		win_set_image_multiview_firstidx();

		OSD_ClearObject((POBJECT_HEAD)&imageslide_idx,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&imageslide_pause,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&decode_txt_progress,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
		break;
	case EVN_POST_CLOSE:
		image_restore_vpo_rect();//TODO
		break;
	case EVN_MSG_GOT:
        if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
        {
			//storage_dev_mount_hint(1);
			file_list_check_storage_device(FALSE, FALSE);
        }
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER)
		{
			image_abort();
			decode_finish_flag = TRUE;
			if(imageslide_pause_state == IMG_UNPAUSE_STATE)
		    {
				slide_interval = (image_slide_setting.uTime_gap * 1000);
				if(0 != slide_interval)
					imageslide_timer_id = api_start_timer("IMAGESLIDE",slide_interval,win_imageslide_handler);
				else
				{
					imageslide_pause_state = IMG_PAUSE_STATE;
					win_imageslide_showpause();
				}
			}
		}
		else if (param1 == CTRL_MSG_SUBTYPE_STATUS_IMGTOOVER) // timer timeouts
		{
			//TODO: play next
			next_image = get_next_index_from_play_list(cur_playlist_image);
			
			if (next_image != -1)
			{
				cur_image_idx = next_image;
				set_play_list_info(cur_playlist_image,&cur_image_idx,NULL);
				get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
				win_get_fullname(image_name, file_node.path, file_node.name);
				win_image_file_play(image_name, image_rot_ang);
				decode_finish_flag = FALSE;
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_UPDATE_VIEW, 0, TRUE);
			}
			else
			{
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT, 0,TRUE);
			}
		}
		else if(param1 == CTRL_MSG_SUBTYPE_CMD_EXIT)
		{
			if(from_imagepreview == TRUE)
				back_to_filelist = TRUE;
			ret = PROC_LEAVE;
		}
		else if(param1 == CTRL_MSG_SUBTYPE_CMD_UPDATE_VIEW)
		{
			slideidx_display(TRUE);
			ret = PROC_LOOP;
		}
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_MP3OVER)
		{
			win_play_next_music_ex();
		}
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_PROC_UPDATE)
		{
			OSD_SetBitmapContent(&decode_bmp_progress, loading_bmp_ids[proc_cnt]);
			OSD_DrawObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
			proc_cnt ++;
			if(proc_cnt >= LOADING_MAX)
				proc_cnt = 0;
		}		
		
		if ((param1 == CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_PROCESS) || (param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER))
		{
			if ((param2 < 100) && (param1 == CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_PROCESS))
			{
				loading_progress = (param2 * LOADING_MAX)/100;
				if (loading_progress > LOADING_MAX - 1)
					loading_progress = LOADING_MAX - 1;

				if(0 == timer_start_flag)
				{
					imageslide_proc_id = OSAL_INVALID_ID;
					imageslide_proc_id = api_start_cycletimer("SLIDE_PROC", 200, win_imageslide_proc_handler);
					timer_start_flag = 1;
				}
			//	OSD_SetBitmapContent(&decode_bmp_progress, loading_bmp_ids[loading_progress]);
			//	OSD_DrawObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
			}
			else if((param2 >= 100) || (param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER))
			{
				OSD_ClearObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
				api_stop_timer(&imageslide_proc_id);
				imageslide_proc_id = OSAL_INVALID_ID;
				timer_start_flag = 0;
				proc_cnt = 0;
			//	imageslide_proc_id = OSAL_INVALID_ID;
			}
		}
		break;
	default:
		break;
	}

	return ret;
}
Beispiel #23
0
static PRESULT win_progname_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT32 i;
	VACTION unact;
	static UINT16 recall_channel = P_INVALID_ID;
	SYSTEM_DATA *sys_data;
	ID taskID;
	UINT8 *screenBuf;
	UINT32 vKey;
	enum API_PLAY_TYPE ret_enum;
	P_NODE pnode;
	UINT16 channel = 0;

	sys_data = sys_data_get();

	switch (event)
	{
		case EVN_PRE_OPEN:
#if(CAS_TYPE == CAS_CONAX)
                if(get_mmi_showed()!=5)
                {
#endif
//Clear the subtitle or teletext content of the last program
#if ((SUBTITLE_ON == 1 )||(TTX_ON ==1))
			api_osd_mode_change(OSD_WINDOW);
#endif
#if(CAS_TYPE == CAS_CONAX)
                    }
#endif
			taskID = osal_task_get_current_id();
			screenBuf = OSD_GetTaskVscrBuffer(taskID);
			MEMSET(screenBuf, OSD_TRANSPARENT_COLOR, OSD_VSRC_MEM_MAX_SIZE);

#ifdef NVOD_FEATURE		
			if(GetNvodPlayFlag())
				return PROC_LEAVE;
#endif
			PROGNAME_TIMER_TIME = sys_data->osd_set.time_out;
			if (PROGNAME_TIMER_TIME == 0 || PROGNAME_TIMER_TIME > 10)
				PROGNAME_TIMER_TIME = 5;
			PROGNAME_TIMER_TIME *= 1000;
			recall_channel = P_INVALID_ID;
			if ((param2 &MENU_OPEN_TYPE_MASK) == MENU_OPEN_TYPE_KEY)
			{
                vKey = param2 & MENU_OPEN_PARAM_MASK;
				if (vKey == V_KEY_RECALL)
				{
					recall_channel = recall_play_channel(0);
					if (recall_channel == P_INVALID_ID)
						return PROC_LEAVE;
				}
 #ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
				else if( (param2 & MENU_OPEN_PARAM_MASK ) == V_KEY_INFOR)
				{
					if(get_mmi_msg_cnt()>0)
					{
						ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE);
						MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: info key; code:0");
						set_mmi_showed(10);
					}
				}
#endif
#endif
                else
                {
                    if(V_KEY_UP==vKey || V_KEY_DOWN==vKey || V_KEY_C_UP==vKey ||\
                        V_KEY_C_DOWN==vKey || V_KEY_P_UP==vKey || V_KEY_P_DOWN==vKey\
                         || V_KEY_TVRADIO==vKey)
                    {
                        unact = win_progname_keymap(pObj, vKey);
                        if(VACT_PASS != unact)
                        {
                            win_progname_unkown_act_proc(unact);
                        }
                    }
                }
			
			}
#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_IRDETO)
			if(IRCA_BAN_GetBannerShow())
			{
				//ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS,0x00200000 , FALSE);
				ap_send_msg_expand(CTRL_MSG_SUBTYPE_STATUS_MCAS,0x00000020 ,0, FALSE);
				//ap_cas_call_back(0x00000020);
			}
#endif
#endif
            //ad_show(AD_CHANNEL_BAR);
			OSD_SetBitmapContent(&Bitmappr2, IM_PIC);

			break;

		case EVN_POST_OPEN:                 
			channel = sys_data_get_cur_group_cur_mode_channel();
			
			if(get_prog_at(channel, &pnode) != SUCCESS)
			{
				return PROC_LEAVE;
			}
			
			/* if parent lock && no pwd, play it ,...just want to show pwd*/
			/*if(pnode.lock_flag && GetChannelParrentLock())
			{
				api_play_channel(channel,TRUE,TRUE,FALSE);
			}
			*/
			
			if (show_and_playchannel)
			{
				show_and_playchannel = 0;
				ret_enum = api_play_channel(channel,TRUE,TRUE,FALSE);
				#ifdef MIS_AD
				MIS_ShowEpgAdv(0);
				#endif
			}

			if (recall_channel != P_INVALID_ID)
			{
				ret_enum = api_play_channel(recall_channel, TRUE, TRUE, FALSE);
				OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			}
#ifdef AD_SANZHOU
			if((recall_channel == P_INVALID_ID)||(get_prog_at(recall_channel, &pnode) == SUCCESS))
			{
				szxc_ad_hide_txt();
				szxc_ad_show_txt(pnode.prog_number);
				szxc_ad_hide_pic(AD_BANNER);
				szxc_ad_show_banner(pnode.prog_number,banner_pic_rt);
			}
#endif
			progname_timer = api_start_timer(PROGNAME_TIMER_NAME, PROGNAME_TIMER_TIME, progname_timer_func);  

			ShowMuteOnOff();
			ShowPauseOnOff();

			#ifdef MIS_AD
			Mis_Set_SameChan_AdvShowOnce(TRUE);
			Mis_Set_EnterAutoShow(FALSE);
			#endif
			break;
		case EVN_PRE_CLOSE:
            		//ad_stop(AD_CHANNEL_BAR);
			#ifdef MIS_AD
			MIS_HideEpgAdv();
			#endif
			break;
		case EVN_POST_CLOSE:
			api_stop_timer(&progname_timer);
			win_progname_stop_scroll();
#if ((SUBTITLE_ON==1)||(TTX_ON==1))
			api_osd_mode_change(OSD_SUBTITLE);
#endif
#ifdef AD_SANZHOU
			szxc_ad_hide_pic(AD_BANNER);
#endif
			break;
		case EVN_PRE_DRAW:
			if(0 != win_progname_set_info())
				ret = PROC_LEAVE;
			break;
		case EVN_POST_DRAW:
			break;
		case EVN_UNKNOWNKEY_GOT:
			ap_hk_to_vk(0, param1, &vKey);
			if(check_exit_key_validate(vKey))
			{
				ap_send_msg(CTRL_MSG_SUBTYPE_KEY, param1, FALSE);
				ret = PROC_LEAVE;
			}
			break;
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1 >> 16);
			ret = win_progname_unkown_act_proc(unact);
			break;
		case EVN_MSG_GOT:
			ret = win_progname_message_proc(param1, param2);
			break;

		default:
			break;
	}

	return ret;

}
Beispiel #24
0
static void win_mpegYT_player_draw_infor(void)
{
	BITMAP* bmp;
	TEXT_FIELD* txt;
	PROGRESS_BAR* bar;
	mpegYTplayer_bmp_t* bmp_desc;
	mpegYTplayer_txt_t* txt_desc;
	UINT32 i, hd_fulless;
	UINT16 icon;
	char string[30];
	UINT32 hh, mm, ss;
	UINT32 play_pos = 0;
	FileInfo file_node;
	char name_buffer[MAX_FILE_NAME_SIZE + 1];

	bmp = &mpegYT_player_bmp;
	txt = &mpegYT_player_text;
	bar = &mpegYT_player_bar;

	for (i = 0; i < MPEGYT_BMP_NUM; i++)
	{
		bmp_desc = &mpegYTplayer_bmps[i];
		icon = INVALID_ID;
		switch (bmp_desc->bmp_type)
		{
		case MPEGYT_BMP_STATIC:
			//icon = bmp_desc->icon;
			break;
		case MPEGYT_BMP_PLAY_RECORD:
			icon = bmp_desc->icon;
			break;
		case MPEGYT_BMP_PLAY_MODE:
			if (MPEGYTInfo.PlayState < sizeof(mpegplayer_yt_status_icons) / 2)
			{
				icon = mpegplayer_yt_status_icons[MPEGYTInfo.PlayState];
			}
			break;
		case MPEGYT_BMP_HDD_STATUS:
			/*			step_sectors =  (hdd_info.total_size - hdd_info.tms_size) / 5;
						if(step_sectors >0 )
						{
							hd_fulless = (hdd_info.rec_size + step_sectors/2) / step_sectors ;
							if(hd_fulless == 5)
								hd_fulless = 4;
							icon = MP_HDstatus_icons[4-hd_fulless];//hd_fulless -> 4-hd_fulles, show used space!
						}
			*/
			break;
		default:
			break;
		}


		OSD_SetBitmapContent(bmp, icon);
		OSD_SetRect(&bmp->head.frame, bmp_desc->left, bmp_desc->top, bmp_desc->width, bmp_desc->height);
		OSD_DrawObject( (OBJECT_HEAD*) bmp, C_UPDATE_ALL);
	}

	for (i = 0;i < MPEGYT_TXT_NUM;i++)
	{
		txt_desc = &mpegYTplayer_txts[i];

		OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");

		switch (txt_desc->txt_type)
		{
		case MPEGYT_TXT_PLAY_NAME:
			//get_file_from_file_list(win_file_list[VIDEO_FILE_LIST], mpegYTlist_idx, &file_node);
			//filter_unkownfont_name(file_node.name, name_buffer);
			win_shorten_filename(entry_youtube->title,name_buffer);
			sprintf(name_buffer, "%s", name_buffer);
			OSD_SetTextFieldContent(txt, STRING_UTF8, (UINT32)name_buffer);
			break;
		case MPEGYT_TXT_DATE:
			//sprintf(string,"%02d/%02d",dt.month,dt.day);
			//STRCPY(string, "");
			sprintf(string, "%02d/%02d/%02d",
					entry_youtube->pub_date.year,
					entry_youtube->pub_date.month,
					entry_youtube->pub_date.day);
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)string);
			break;
		case MPEGYT_TXT_TIME:
			//sprintf(string,"%02d:%02d",dt.hour,dt.min);
			STRCPY(string, "");
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)string);
			break;
		case MPEGYT_TXT_PLAY_MODE:
			STRCPY(string, "");
			if (MPEGYTInfo.PlayState == MPEG_STOP)
			{
				sprintf(string, "%s", "Stop");
			}
			else if (MPEGYTInfo.PlayState == MPEG_PLAY)
			{
				sprintf(string, "%s", "Play");
			}
			else if (MPEGYTInfo.PlayState == MPEG_PAUSE)
			{
				sprintf(string, "%s", "Pause");
			}
			else if (MPEGYTInfo.PlayState == MPEG_FF || MPEGYTInfo.PlayState == MPEG_FB)
			{
				sprintf(string, "X%d", mpegYTspeed_steps[MPEGYTInfo.PlaySpeed]);
			}
			else if (MPEGYTInfo.PlayState == MPEG_SF || MPEGYTInfo.PlayState == MPEG_SB)
			{
				sprintf(string, "X1/%d", mpegYTspeed_steps[MPEGYTInfo.PlaySpeed]);
			}
			else if(MPEGYTInfo.PlayState == MPEG_STEP)
			{
				sprintf(string,"%s","Step");
			}
#ifdef SUPPORT_DIVX_CERT
            else if(MPEGYTInfo.PlayState == MPEG_RESUME_STOP)
            {
                sprintf(string,"%s","Stop");
            }
#endif
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)string);
			break;
		case MPEGYT_TXT_PLAY_1ST_TIME:
			STRCPY(string, "");
			MPEGYTInfo.PlayTime = (UINT32)MPGFileDecoderGetPlayTime() + s_ytvideo_seektime;
            if (MPEGYTInfo.PlayState == MPEG_STOP)
                MPEGYTInfo.PlayTime = 0;
#if 1
			hh = MPEGYTInfo.PlayTime / 3600;
			mm = (MPEGYTInfo.PlayTime % 3600) / 60;
			ss = MPEGYTInfo.PlayTime % 60;
#else
			hh = entry_youtube->info->duration/3600;
			mm = (entry_youtube->info->duration % 3600) / 60;
			ss = entry_youtube->info->duration % 60;			
#endif
			sprintf(string, "%02d:%02d:%02d", hh, mm, ss);
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)string);
			break;

		case MPEGYT_TXT_PLAY_2ND_TIME:
			STRCPY(string, "");
#if 0
			hh = MPEGYTInfo.TotalTime / 3600;
			mm = (MPEGYTInfo.TotalTime % 3600) / 60;
			ss = MPEGYTInfo.TotalTime % 60;
#else
			hh = entry_youtube->info->duration/3600;
			mm = (entry_youtube->info->duration % 3600) / 60;
			ss = entry_youtube->info->duration % 60;	
#endif
			sprintf(string, "%02d:%02d:%02d", hh, mm, ss);
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)string);
			break;
		case MPEGYT_TXT_HDD_STATUS:
			/*step_sectors = (hdd_info.total_size - hdd_info.tms_size)/100;
			if(step_sectors >0 )
			{
				sprintf(string,"%d%%",(100 - (hdd_info.rec_size+ step_sectors/2 )/step_sectors));
			}
			else
			{
				STRCPY(string,"");
			}
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)string);
			*/
			break;
		}

		OSD_SetRect(&txt->head.frame, txt_desc->left, txt_desc->top, txt_desc->width, txt_desc->height);
		txt->head.style.bShowIdx = txt_desc->shidx;
		OSD_DrawObject( (OBJECT_HEAD *)txt, C_UPDATE_ALL);
	}

	/* Draw progress bar */
	OSD_SetProgressBarPos(bar, 100);
	OSD_SetRect(&bar->head.frame, BAR_L, BAR_T, BAR_W, 24);
	bar->rcBar.uLeft 	= 2;
	bar->rcBar.uTop 		= 5;
	bar->rcBar.uWidth	= BAR_W - 4;
	bar->rcBar.uHeight 	= 14;//16 - 6;
	bar->wTickFg 		= WSTL_BAR_06;
	OSD_DrawObject((POBJECT_HEAD)bar, C_UPDATE_ALL);

	/* Draw play pos */
//    BarState.nPos = MPEGYTInfo.PlayTime;
	if (BarState.nRange)
	{
		play_pos = BarState.nPos * 100 / BarState.nRange;
	}
	OSD_SetRect(&bmp->head.frame, bar->head.frame.uLeft+6 + (bar->head.frame.uWidth-12)*play_pos / 100*OSD_GetProgressBarPos(bar) / 100 - POS_ICON_WIDTH / 2,
				bar->head.frame.uTop, POS_ICON_WIDTH, bar->head.frame.uHeight);
	OSD_SetBitmapContent(bmp, IM_PVR_DOT);
	OSD_DrawObject((POBJECT_HEAD)bmp, C_UPDATE_ALL);

	/* Draw play cursor */
	if (CURSOR_MOVING == BarState.State)
	{
		if (BarState.nRange)
		{
			play_pos = BarState.nCursor * 100 / BarState.nRange;
		}
		OSD_SetRect(&bmp->head.frame, bar->head.frame.uLeft + 6 + (bar->head.frame.uWidth-4)*play_pos / 100/**OSD_GetProgressBarPos(bar) / 100*/ - POS_ICON_WIDTH / 2,
		//OSD_SetRect(&bmp->head.frame, bar->head.frame.uLeft + 6 + (bar->head.frame.uWidth-4)*play_pos / 100*OSD_GetProgressBarPos(bar) / 100 - POS_ICON_WIDTH / 2,
					bar->head.frame.uTop, POS_ICON_WIDTH, bar->head.frame.uHeight);
		OSD_SetBitmapContent(bmp, IM_PVR_DOT_ORANGE);
		OSD_DrawObject((POBJECT_HEAD)bmp, C_UPDATE_ALL);
	}
}
Beispiel #25
0
INT32 win_progname_set_info(void)
{
	UINT16 group_name[MAX_SERVICE_NAME_LENGTH + 1+10];
	UINT8 group_type, av_mode;

	UINT16 cur_channel;
	P_NODE p_node;
	S_NODE s_node;
	char string[100];
	char prog_name[MAX_SERVICE_NAME_LENGTH + 1];
	INT32 ret, len;
	UINT32 i, j;
	UINT16 icon;
	date_time dt;
	eit_event_info_t *pe = NULL,  *fe = NULL;
	UINT8 *s1 = NULL,  *s2 = NULL;
	INT32 strlen;
	struct ACTIVE_SERVICE_INFO service;
	UINT8 *src;
    UINT8 *src8;
	date_time start_time, end_time, local_time;
	INT32 day, h, m, sec, timeLen, timePassed, progProcessLen;

	UINT32 fav_mask;

	struct t_ttx_lang *ttx_lang_list;
	UINT8 ttx_lang_num;
	struct t_subt_lang* sub_lang_list;
	UINT8 sub_lang_num;
	fav_mask = 0;
	for (i = 0; i < MAX_FAVGROUP_NUM; i++)
		fav_mask |= (0x01 << i);

	get_STC_offset(&h, &m, &sec);

	av_mode = sys_data_get_cur_chan_mode();
	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	ret = get_prog_at(cur_channel, &p_node);
	if(ret != SUCCESS)
		return -1;
	get_sat_by_id(p_node.sat_id, &s_node);
	get_cur_group_name((char*)group_name, &group_type);
	get_local_time(&dt);
	service.tp_id = p_node.tp_id;
	service.service_id = p_node.prog_number;
	epg_set_active_service(&service, 1);

	/* Get current next epg info */
	pe = epg_get_cur_service_event((INT32)cur_channel, PRESENT_EVENT, NULL, NULL, NULL, event_update);
	fe = epg_get_cur_service_event((INT32)cur_channel, FOLLOWING_EVENT, NULL, NULL, NULL, FALSE);
	s1 = (UINT8*)epg_get_event_name(pe, present_name, 32);
	s2 = (UINT8*)epg_get_event_name(fe, following_name, 32);

	#ifdef TTX_ON
	TTXEng_GetInitLang(&ttx_lang_list, &ttx_lang_num);
	#endif
	#ifdef SUBTITLE_ON
	subt_get_language(&sub_lang_list ,&sub_lang_num);
	#endif
	#ifdef TTX_ON
	if(sub_lang_num == 0)
		TTXEng_GetSubtLang(&ttx_lang_list,&sub_lang_num);
	#endif
	/* Set bmp content */
	if (av_mode == TV_CHAN)
		icon = IM_PAY;
	else
		icon = IM_INFORMATION_RADIO;
	OSD_SetBitmapContent(&prog_bmp, icon);
	#ifdef TTX_ON
	if(ttx_lang_num>0)
		icon = IM_INFORMATION_ICON_TTX;
	else
		icon = INVALID_ID; 
	//soc_printf("ttx icon id:%x, ", icon);
	OSD_SetBitmapContent(&prog_name_ttx, icon);
	//OSD_SetRect(&bmp->head.frame, p_prog_bmp->left, p_prog_bmp->top, p_prog_bmp->width,p_prog_bmp->height);
	OSD_DrawObject( (OBJECT_HEAD*) (&prog_name_ttx), C_UPDATE_ALL);
	#endif
	

	#ifdef SUBTITLE_ON
	if(sub_lang_num>0)
		icon = IM_INFORMATION_ICON_SUBTITLE;
	else 
		icon = INVALID_ID;
	//soc_printf("subt icon id:%x\n", icon);
	OSD_SetBitmapContent(&prog_name_subt, icon);
	OSD_DrawObject( (OBJECT_HEAD*) (&prog_name_subt), C_UPDATE_ALL);
	#endif

	/* Init display strings */
	for (i=0; i<7; i++)
		MEMSET(display_strs[20+i], 0, 2*MAX_DISP_STR_LEN);

	/* Set prog_name content */
	MEMSET(string, 0, sizeof(string));
	if (p_node.ca_mode == 0)
		STRCPY(string, "");
	else
		STRCPY(string, "$");

	ComAscStr2Uni(string, display_strs[20]);
	strlen = ComUniStrLen(display_strs[20]);
	ComUniStrCopyChar((UINT8*) &display_strs[20][strlen], p_node.service_name);

	/* Set prog_time content */
	MEMSET(string, 0, sizeof(string));
	sprintf(string, "%4d.%02d.%02d ", dt.year, dt.month, dt.day);
	ComAscStr2Uni(string, display_strs[21]);
	strlen = ComUniStrLen(display_strs[21]);
	src = OSD_GetUnicodeString(weekday_id[dt.weekday%7]);
	ComUniStrCopyChar((UINT8*) &display_strs[21][strlen], src);

	/* Set prog_num content */
	MEMSET(string, 0, sizeof(string));
	sprintf(string, "%03d", cur_channel + 1);
	ComAscStr2Uni(string, display_strs[22]);

	/* Set epg_time_now, epg_now, prog_process content */
	if (s1)
	{
		MEMSET(string, 0, sizeof(string));
		get_STC_offset(&h, &m, &sec);
		get_event_start_time(pe, &start_time);
		get_event_end_time(pe, &end_time);

		convert_time_by_offset(&start_time, &start_time, h, m);
		convert_time_by_offset(&end_time, &end_time, h, m);
 
		sprintf(string, "%02d:%02d~%02d:%02d ", start_time.hour, start_time.min,  \
			end_time.hour, end_time.min);
		ComAscStr2Uni(string, (UINT16*)display_strs[23]);
		ComUniStrCopyChar((UINT8*) &display_strs[24][0], s1);

		//draw prog process
		get_local_time(&local_time);
		get_time_offset(&start_time, &end_time, &day, &h, &m, &sec);
		timeLen = day * 24 * 60+h * 60+m;
		get_time_offset(&start_time, &local_time, &day, &h, &m, &sec);
		timePassed = day * 24 * 60+h * 60+m;
		if ((timeLen <= 0) || (timePassed <= 0))
			progProcessLen = 0;
		else
			progProcessLen = timePassed * PROG_PROCESS_W / timeLen;
		if (progProcessLen > PROG_PROCESS_W)
			progProcessLen = PROG_PROCESS_W;
		///prog_process.head.frame.uWidth = progProcessLen;
	}
	else
	{
		MEMSET(string, 0, sizeof(string));
        src8 = OSD_GetUnicodeString(RS_EPG_NO_INFORMATION);
		ComUniStrCopyChar((UINT8*) &display_strs[23][0], src8);
		sprintf(string, " ");
		ComAscStr2Uni(string, (UINT16*)display_strs[24]);
	}
	
	/* Set epg_time_next, epg_next content */
	if (s2)
	{
		MEMSET(string, 0, sizeof(string));
		get_STC_offset(&h, &m, &sec);
		get_event_start_time(fe, &start_time);
		get_event_end_time(fe, &end_time);


		convert_time_by_offset(&start_time, &start_time, h, m);
		convert_time_by_offset(&end_time, &end_time, h, m);

		sprintf(string, "%02d:%02d~%02d:%02d ", start_time.hour, start_time.min,  \
			end_time.hour, end_time.min);

		ComAscStr2Uni(string, display_strs[25]);
		ComUniStrCopyChar((UINT8*) &display_strs[26][0], s2);
	}
	else
	{
		MEMSET(string, 0, sizeof(string));
		sprintf(string, " ");
		ComAscStr2Uni(string, (UINT16*)display_strs[25]);
		ComAscStr2Uni(string, (UINT16*)display_strs[26]);
	}
	return 0;
}