Beispiel #1
0
void info_load(void)
{
	char str[50];
	UINT16 audioPID,ttxPID,subtPID;
	UINT32 cur_audio;
	TEXT_FIELD *txt;
	P_NODE p_node;
	T_NODE t_node;
	S_NODE s_node;
	
	sys_data_get_curprog_info(&p_node);
	get_tp_by_id(p_node.tp_id,&t_node);
	get_sat_by_id(t_node.sat_id, &s_node);

	cur_audio = (p_node.cur_audio >= p_node.audio_count) ? 0 : p_node.cur_audio;
	audioPID = p_node.audio_pid[cur_audio];
	ttxPID = p_node.teletext_pid;
	subtPID = p_node.subtitle_pid;
	if(p_node.audio_count == 0)
		sprintf(str,"V %d  No Audio  P %d",p_node.video_pid,p_node.pcr_pid);
	else
	{
		UINT8 str_audio_type[32];
		if(audioPID & AC3_DES_EXIST)
			STRCPY(str_audio_type, "AC3");
		else if(audioPID & AAC_DES_EXIST)
			STRCPY(str_audio_type, "AAC");
		else if(audioPID & ADTS_AAC_DES_EXIST)
			STRCPY(str_audio_type, "AAC");
		else
			MEMSET(str_audio_type, 0, sizeof(str_audio_type));
		
		sprintf(str,"V %d  A %d%s  P %d",p_node.video_pid,audioPID & 0x1FFF,str_audio_type, p_node.pcr_pid);
	}
	txt = &txt_pidinfo;
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str);
	
	txt = &txt_satname;
#ifndef DB_USE_UNICODE_STRING
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)s_node.sat_name);
#else
	OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)s_node.sat_name);
#endif

	sprintf(str,"%d/%s/%d", t_node.frq, (t_node.pol==0) ? "H" : "V",t_node.sym);
	txt = &txt_tpinfo;
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str);
	
	txt = &txt_progname;
#ifndef DB_USE_UNICODE_STRING
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)p_node.service_name);
#else
	OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)p_node.service_name);
#endif

	txt = &txt_string4;
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"PID");
}
Beispiel #2
0
/*description	: start an auto-scan according to the parameter asp.*/
INT32 as_service_start(struct as_service_param *asp)
{
    INT32 sat_id;
    struct mid27_cmd cmd;

    if (as_info != NULL)
        return 0;

    as_info = (struct as_module_info *)__MM_AS_START_ADDR;
    MEMSET(as_info, 0, sizeof(struct as_module_info));
    MEMCPY(&as_info->param, asp, sizeof(struct as_service_param));
    sat_id = asp->as_sat_id;
    get_sat_by_id(sat_id, &as_info->cur_sat);
    /*get default nim, for dual nim projects, will get correct nim later below*/    
    as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0);

    as_info->param.as_prog_attr |= P_SEARCH_SATTP;

#if (SYS_PROJECT_FE != PROJECT_FE_DVBC)
    dvbs_as_callback(AS_SGN_INIT, 0, 0, 0, 0);
#endif

#if (SYS_PROJECT_FE == PROJECT_FE_DVBS||SYS_PROJECT_FE == PROJECT_FE_DVBS2)
    /*get correct nim*/
    as_select_nim(&as_info->cur_sat);
   /*multi sat scan*/
    if ((asp->as_method==AS_METHOD_MULTI_FFT)||(asp->as_method==AS_METHOD_MULTI_NIT)
        ||(asp->as_method==AS_METHOD_MULTI_TP))
    {
        as_info->sat_nr = sat_id;
        MEMCPY(as_info->sat_id, asp->as_sat_ids,as_info->sat_nr*sizeof(UINT16));
    }
    else 
   
#endif
    /*single sat scan*/
    {
        as_info->sat_nr = 1;
        as_info->sat_id[0] = sat_id;
    }

    cmd.cmd_type = MID27_CMD_AS_START;	
    return mid27_send_cmd(&cmd, OSAL_WAIT_FOREVER_TIME);
	
}
Beispiel #3
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 #4
0
static void win_search_program_append(UINT32 tp_idx, UINT16 prog_idx)
{
	UINT32 si,i,j,n,cnt,str_len;
	UINT16* pstr;
	OSD_RECT rect;
	UINT8	shidx;
	char    str[30];
	
	DBG_PRINTF("Enter %s....\n",__FUNCTION__);
	
	if(prog_idx != INVALID_ID)
	{
		P_NODE p_node;

		get_prog_at(prog_idx, &p_node);
		MEMCPY(&win_search_cur_prog[p_node.av_flag], &p_node, sizeof(p_node));
		
		srch_ch_cnt[p_node.av_flag] ++;		
		cnt = srch_ch_cnt[p_node.av_flag];

		if(cnt <= INFOR_CHAN_CNT)
		{
			si = 0;
			n = cnt;
		}
		else
		{
			si = cnt - INFOR_CHAN_CNT;
			n = INFOR_CHAN_CNT;
		}

		if(si != 0)
		{
			for(i=0;i<n - 1;i++)
				MEMCPY(display_strs[10 + p_node.av_flag*10 + i], display_strs[10 + p_node.av_flag*10 + i + 1], MAX_DISP_STR_LEN*2);
		}

		pstr = display_strs[10 + p_node.av_flag*10 + n - 1];		
		if(p_node.ca_mode)
			ComAscStr2Uni("$", pstr);
		else
			ComAscStr2Uni("", pstr);
		str_len = ComUniStrLen(pstr);
		ComUniStrCopyChar((UINT8*)&pstr[str_len] ,p_node.service_name);

		if(p_node.av_flag == PROG_TV_MODE)
		{
			rect.uLeft 	= TVB_L + 20;//INFO_TV_L;
			rect.uTop  	= TVB_T + INFO_TXT_H;//INFO_TV_T+4;
			rect.uWidth = INFO_TV_W;
			rect.uHeight= INFO_TXT_H;
			shidx = TV_TXT_SH_IDX;
		}
		else
		{
			rect.uLeft 	= RADIOB_L + 20;//INFO_RADIO_L;
			rect.uTop  	= RADIOB_T + INFO_TXT_H;//INFO_RADIO_T+4;
			rect.uWidth = INFO_TV_W;//INFO_RADIO_W;
			rect.uHeight= INFO_TXT_H;
			shidx = RADIO_TXT_SH_IDX;
		}
		
		for(i=0;i<n;i++)
		{
			pstr = display_strs[10 + p_node.av_flag*10 + i];
			//win_srch_draw_info(&rect, NULL,pstr, shidx);
			win_srch_draw_info_ex(&rect, NULL,pstr, INFOMATION_TXT_IDX);
			rect.uTop += rect.uHeight;
		}


		rect.uTop = TVB_T+3;
		rect.uLeft += (rect.uWidth-80);
		rect.uWidth = 80;
        rect.uHeight = TXT_H;
		sprintf(str,"%d",cnt);
		win_srch_draw_info(&rect, str,NULL, shidx);
		tp_chsrched = 1;
		
	}

	if(tp_idx != 0xFFFFFFFF)
	{
		T_NODE t_node;
		S_NODE s_node;

		get_tp_by_id(tp_idx, &t_node);
		//get_sat_at(cur_sat_pos, VIEW_ALL,&s_node);
		get_sat_by_id(cur_sat_id, &s_node);
		srch_tp_cnt ++;

		cnt = srch_tp_cnt;
		if(cnt <= INFOR_TP_CNT)
		{
			si = 0;
			n = cnt;
		}
		else
		{
			si = cnt - INFOR_TP_CNT;
			n = INFOR_TP_CNT;
		}
		
		if(si != 0)
		{
			for(i=0;i<n - 1;i++)
			{
				MEMCPY(display_strs[ 30 + i], display_strs[30 + i + 1], MAX_DISP_STR_LEN*2);
			}
		}
		if(n>1)
		{
			pstr = display_strs[ 30 + n - 2];
#if 0			
			str_len = ComUniStrLen(pstr);
#else
			str_len = tp_info_chw_tbl[0] + tp_info_chw_tbl[1] + tp_info_chw_tbl[2] + tp_info_chw_tbl[3] + tp_info_chw_tbl[4];
#endif
			if(tp_chsrched)
				ComAscStr2Uni("OK", &pstr[str_len]);
			else
				ComAscStr2Uni("Failed", &pstr[str_len]);
		}

		pstr = display_strs[30 + n - 1];
		
		sprintf(str,"%d",srch_tp_cnt);
		ComAscStr2Uni(str,&pstr[0]);

#if 0		
		str_len = ComUniStrLen(pstr);
		str_len = tp_info_chw_tbl[0];
		ComUniStrCopyChar(&pstr[str_len], s_node.sat_name);
		str_len = ComUniStrLen(pstr);
		sprintf(str," %d %c %d ... ",t_node.frq,(t_node.pol == 0)? 'H' : 'V',t_node.sym);
		ComAscStr2Uni(str,&pstr[str_len]);
#else
		str_len = tp_info_chw_tbl[0];
		ComUniStrCopyChar((UINT8*)&pstr[str_len], s_node.sat_name);
		
		str_len += tp_info_chw_tbl[1];
		sprintf(str,"%d",t_node.frq);
		ComAscStr2Uni(str,&pstr[str_len]);
		
		str_len += tp_info_chw_tbl[2];
		sprintf(str,"%c",(t_node.pol == 0)? 'H' : 'V');
		ComAscStr2Uni(str,&pstr[str_len]);

		str_len += tp_info_chw_tbl[3];
		sprintf(str,"%d",t_node.sym);
		ComAscStr2Uni(str,&pstr[str_len]);

		str_len += tp_info_chw_tbl[4];
		STRCPY(str,"");
		ComAscStr2Uni(str,&pstr[str_len]);

#endif

		
		tp_chsrched = 0;
		
		rect.uLeft 	= INFO_TP_L;
		rect.uTop  	= INFO_TP_T;
		rect.uWidth = INFO_TP_W;
		rect.uHeight= INFO_TXT_H;
		shidx = TP_TXT_SH_IDX;
		for(i=0;i<n;i++)
		{
			
			pstr = display_strs[30 + i];
#if 0			
			win_srch_draw_info(&rect, NULL,pstr, shidx);
#else
			rect.uLeft 	= INFO_TP_L;
			str_len = 0;
			pstr = display_strs[30 + i];
			for(j=0;j<7;j++)
			{
				rect.uWidth = tp_info_w_tbl[j] - 2;	
				if(j != 5)
					win_srch_draw_info(&rect, NULL,pstr, shidx);				
				else
					win_srch_draw_info(&rect, "...",NULL, shidx);
				rect.uLeft +=  tp_info_w_tbl[j] ;
				if(j < 5)
				{
					pstr += tp_info_chw_tbl[j];
					//pstr += str_len;
				}
			}
#endif

			rect.uTop += rect.uHeight;
		}		

		
	}

	DBG_PRINTF("Exit %s....\n",__FUNCTION__);	
}
Beispiel #5
0
static void win_satsrch_set_search_param(void)
{
	UINT32  search_mode;
	UINT32 prog_type;
	S_NODE s_node;
	struct as_service_param param;
	struct nim_device *nim;
	struct vdec_device *vdec;
	struct vdec_io_get_frm_para vfrm_param;
	UINT32 addr, len;
	UINT32 i;
	//tv/radio/all
	if(SATSRCH_CHAN_IDX==1)
		prog_type = P_SEARCH_TV;
	else if(SATSRCH_CHAN_IDX==2)
		prog_type = P_SEARCH_RADIO;
	else// if(SATSRCH_CHAN_IDX==0)
		prog_type = P_SEARCH_TV|P_SEARCH_RADIO;
	
	/* FTA Only */
	if (SATSRCH_FTA_IDX == 1)
		search_mode = P_SEARCH_FTA;
	else// if (sSATSRCH_FTA_IDX == 1)
		search_mode = P_SEARCH_FTA|P_SEARCH_SCRAMBLED;

	param.as_from = AS_FREQ_MIN;
	param.as_to = AS_FREQ_MAX;

	param.as_prog_attr = prog_type|search_mode;
#ifndef NEW_DEMO_FRAME
    if(single_multi_srch_flag == 0)   
    {
	    get_tuner_sat(TUNER_EITHER,SATSRCH_SAT_IDX,&s_node);
        param.as_sat_id = s_node.sat_id;
        if (s_node.lnb_type == LNB_CTRL_22K)
        {
        	param.as_from = 950;
	        param.as_to = 2150;
        }
    }
    else
    {
         param.as_sat_ids = sat_ids;
    }
#else
	param.as_frontend_type = FRONTEND_TYPE; 
	if(single_multi_srch_flag == 0)   
	{
		get_tuner_sat(TUNER_EITHER,SATSRCH_SAT_IDX, &s_node);
		param.sat_ids[0] = s_node.sat_id;
		param.as_sat_cnt = 1;
	}
	else
	{
		param.as_sat_cnt = get_tuner_sat_cnt(TUNER_EITHER_SELECT);

		// multi-search max satellite number is 256
		if(param.as_sat_cnt > 256)
			param.as_sat_cnt = 256;
		MEMCPY(param.sat_ids, sat_ids, param.as_sat_cnt * sizeof(UINT16));
	}
#endif
#ifdef ORDER_GZ1011001   
	if(SATSRCH_MODE_IDX == 1)
#else
	if(SATSRCH_MODE_IDX == IDX_SCAN_MODE_AUTO_SCAN ||SATSRCH_MODE_IDX == IDX_SCAN_MODE_ACCURATE_SCAN )
#endif
	{
        if(single_multi_srch_flag == 0)        
		    param.as_method = AS_METHOD_FFT;
        else
            param.as_method = AS_METHOD_MULTI_FFT;
	}
	else if (SATSRCH_MODE_IDX == IDX_SCAN_MODE_PRESET_SCAN)
	{
		
		if(single_multi_srch_flag == 0)  
		    param.as_method = (SATSRCH_NIT_IDX==0)? AS_METHOD_SAT_TP : AS_METHOD_NIT;
        else
            param.as_method = (SATSRCH_NIT_IDX==0)? AS_METHOD_MULTI_TP : AS_METHOD_MULTI_NIT;
	}
 	for(i = 0;i < param.as_sat_cnt;i++)
 	{
 		 get_sat_by_id(param.sat_ids[i], &s_node);
	 	 if(s_node.tuner1_valid == 1)
	 	 	{
	 	 	 nim=    (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0);
	 	 	}
		 else if(s_node.tuner2_valid == 1)
		 	{
		 	nim=    (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 1);
		 	}
		 else 
		 	continue;
		 if(SATSRCH_MODE_IDX == IDX_SCAN_MODE_ACCURATE_SCAN)
		 	nim_io_control(nim, NIM_DRIVER_SET_BLSCAN_MODE, 1);
		 else
			nim_io_control(nim, NIM_DRIVER_SET_BLSCAN_MODE, 0);	
	}
	
	param.as_p_add_cfg = PROG_ADD_REPLACE_OLD;
	param.as_handler = NULL;

	// set param 
	win_search_set_param(&param);

	//update_data();
#if 0
	vdec = (struct vdec_device *)dev_get_by_id(HLD_DEV_TYPE_DECV, 0);
	vfrm_param.ufrm_mode = VDEC_UN_DISPLAY;
	vdec_io_control(vdec, VDEC_IO_GET_FRM, (UINT32)&vfrm_param);
	addr = vfrm_param.tFrmInfo.uC_Addr;
	len = (vfrm_param.tFrmInfo.uHeight*vfrm_param.tFrmInfo.uWidth*3)/2;
#else
    addr = __MM_AUTOSCAN_DB_BUFFER_ADDR;
    addr &= 0x8fffffff;
    len = __MM_AUTOSCAN_DB_BUFFER_LEN;
#endif
	db_search_init((UINT8 *)addr, len);

}
Beispiel #6
0
/* description	: auto scan main routine for command parsing and switching.*/
static void as_main(struct libpub_cmd *cmd)
{
    INT32 i, j;
    INT32 ret;
    INT32 method;
    INT32 tp_nr;
    INT32 as_method;
    UINT16 sat_id;
    UINT8 dmx_mode_need_resume = 0;
    UINT32 dmx_dma_mode;
    as_update_event_t event_handler;
    struct dmx_device *dmx = NULL;
    T_NODE *tp = &as_info->cur_tp;;
    S_NODE *sat = &as_info->cur_sat;
    struct ft_antenna *antenna = &as_info->antenna;	
    
    AS_PRINTF("start time stamp = %d\n", osal_get_tick());
    as_method = as_info->param.as_method;
	
    event_handler = as_info->param.as_handler;
    	if(event_handler!=NULL)
    	{
        	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANSTART);
    	}

	//Select DMX
    	dmx = dev_get_by_id(HLD_DEV_TYPE_DMX, 0);
    	if(dmx == NULL)
    	{
        	AS_PRINTF("%s(): select dmx failed!\n");
        	return;
    	}
    	as_info->dmx = dmx;

	//fix BUG20874: init psi info to avoid dmx changed by video playing
	psi_info_init(as_info->dmx, as_info->nim, (void *)__MM_PSI_START_ADDR, 180*1024);
	
    	//Check and Switch Buffer Mode of Dmx (From Divided Buffer To Union Buffer)
    	dmx_io_control(as_info->dmx, DMX_CHK_BUF_MODE, (UINT32)&dmx_dma_mode);
    	if(dmx_dma_mode == DMX_DIVIDED_BUFF_MODE)
    	{
        	dmx_io_control(as_info->dmx, DMX_SWITCH_TO_UNI_BUF, 0);
        	dmx_mode_need_resume = 1;
    	}
    	
    	for(i = 0; i<as_info->sat_nr; i++)
    	{
        	//For Each Satellite, Create its TP View, Set Antenna
        	sat_id = as_info->sat_id[i];
        	db_search_create_tp_view(sat_id);
		
        	if(event_handler != NULL)
        	{
            		event_handler(ASM_TYPE_SATELLITE, sat_id);
        	}

		//Set Antenna Information according to Satellite Information
        	MEMSET(sat, 0, sizeof(S_NODE));
        	get_sat_by_id(sat_id, sat);
        	AS_DUMP_SAT(sat);
        	MEMSET(antenna, 0, sizeof(struct ft_antenna));
        	sat2antenna(sat, antenna);
		
        	as_info->dual_LNB = (antenna->lnb_high>0) && (antenna->lnb_low>0) && (antenna->lnb_high != antenna->lnb_low);
        as_info->voltage_ctrl = (antenna->pol==LNB_POL_H)||(antenna->pol==LNB_POL_V);
//>>> Unicable begin
        if(antenna->lnb_type == LNB_CTRL_UNICABLE)
        {
    	    as_info->nim_para.unicable = 1;
    	    as_info->nim_para.Fub = antenna->unicable_freq;
        } 
        else
    	    as_info->nim_para.unicable = 0; 
//<<< Unicable end
        //select right nim and dmx    
        as_select_nim(sat);
        if(as_info->nim ==NULL)
        {
            AS_PRINTF("%s(): select nim failed!\n");
            continue;
        }

	 //for 29E 2-Tuner the dmx path may not same as default!!
	 tsi_dmx_src_select(TSI_DMX_0, TSI_TS_A);
        
        //blind scan
        if((AS_METHOD_FFT==as_method)||(AS_METHOD_MULTI_FFT==as_method))
        {
            method = AS_METHOD_FFT;
        }
        else
        {
            as_info->tp_nr = 0;
            MEMSET(as_info->tp_nit, 0,AS_MODULE_MAX_T_NUM*sizeof(UINT8));
            //single tp scan
            if((AS_METHOD_TP==as_method)||(AS_METHOD_TP_PID==as_method)
                ||(AS_METHOD_NIT_TP==as_method)||(AS_METHOD_NVOD==as_method))
            {
                as_info->tp_nr = 1;
				
                as_info->tp_id[0] = as_info->param.as_from;
                if ((AS_METHOD_NIT_TP==as_method)&&(event_handler!=NULL))
                		{
                    			event_handler(ASM_TYPE_INC_TRANSPONDER, 0);
                		}
            }
            //multi tp scan
            else if((AS_METHOD_SAT_TP==as_method)||(AS_METHOD_NIT==as_method)
                ||(AS_METHOD_MULTI_TP==as_method)||(AS_METHOD_MULTI_NIT==as_method)
                ||(AS_METHOD_NVOD_MULTI_TP==as_method))
            {
                tp_nr = get_tp_num_sat(sat_id);
                for(j=0; j<tp_nr; j++)
                {
                    get_tp_at(sat_id, j, tp);
                    if(as_info->param.as_frontend_type==FRONTEND_TYPE_S)
                    {
                       if(dvbs_tp_sanity_check(as_info->voltage_ctrl,tp, sat)==FALSE)
                    			 	{
                            			continue;
                    			 	}
                    			}
                    			else if(as_info->param.as_frontend_type == FRONTEND_TYPE_C)
                    			{
                       			if(dvbc_tp_sanity_check(FALSE, tp, NULL) == FALSE)
                       			{
                            			continue;
                       			}
                    			}
                    
                    			AS_DUMP_TP(tp);
#ifdef NVOD_FEATURE
                    			if((AS_METHOD_NVOD_MULTI_TP == as_method) && (tp->nvod_flg == 1))
#endif
					{
                    				as_info->tp_id[as_info->tp_nr++] = tp->tp_id;
					}

                    			if (AS_MODULE_MAX_T_NUM == as_info->tp_nr)
                    			{
                        			AS_PRINTF("%s: tp exceed AS_MODULE_MAX_T_NUM!\n", __FUNCTION__);
                    			}
                		}
            }

	    if((AS_METHOD_NIT==as_method)||(AS_METHOD_NIT_TP==as_method)
                ||(AS_METHOD_MULTI_NIT==as_method))
            {
                MEMSET(as_info->tp_nit, 1, as_info->tp_nr);
            }
            	
            method = AS_METHOD_TP;
        }

        ret = as_scan(sat_id, sat, method, 0);
        
        update_data( );

        	if (ret || as_info->stop_scan_signal)
        	{
            		break;
        	}
    	}

	//Show Scan Over by Upper Layer
    	if(event_handler != NULL)
    	{
        	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANOVER);
    	}

    	dmx_io_control(as_info->dmx, CLEAR_STOP_GET_SECTION, 0);
	//Switch Buffer Mode of Dmx (From Union Buffer to Divided Buffer)
    	if(dmx_mode_need_resume)
    	{
        	dmx_io_control(as_info->dmx, DMX_SWITCH_TO_DVI_BUF, 0);
    	}
    	sie_open(as_info->dmx, MAX_FILTER_NUMBER, NULL, 0);
     
    osal_task_dispatch_off();
    nim_io_control(as_info->nim, NIM_DRIVER_STOP_ATUOSCAN, 0);
    as_info = NULL;
    AS_PRINTF("end time stamp = %d\n", osal_get_tick());
    osal_task_dispatch_on();
}
Beispiel #7
0
/* description	: auto scan main routine for command parsing and switching.*/
static void as_main(struct mid27_cmd *cmd)
{
    INT32 i;
    INT32 j;
    INT32 ret;
    INT32 method;
    INT32 tp_nr;
    INT32 as_method;
    UINT16 sat_id;
    T_NODE *tp;
    S_NODE *sat;
    UINT8 dmx_mode_need_resume = 0;
    UINT32 dmx_dma_mode;
    as_update_event_t event_handler;
	
    extern BOOL cc_stop_channel(BOOL, BOOL);

#ifdef BASE_TP_HALF_SCAN_SUPPORT
	if(cmd->cmd_type == MID27_CMD_AS_HL_START)
	{
		as_bastp_halfscan(cmd);
		return;
	}
#endif
    AS_PRINTF("start time stamp = %d\n", osal_get_tick());
    cc_stop_channel(0, 0);
    /*get default nim, for dual nim projects, will get correct nim later below*/    
    as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0);

    as_info->dmx = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, 0);

	//fix BUG20874: init psi info to avoid dmx changed by video playing
#ifdef BASE_TP_HALF_SCAN_SUPPORT

	psi_info_init(as_info->dmx, as_info->nim, (void *)__MM_PSI_START_ADDR, 280*1024);
#else
        psi_info_init(as_info->dmx, as_info->nim,(void *)__MM_PSI_START_ADDR, 180*1024);
#endif
	
    dmx_io_control(as_info->dmx, DMX_CHK_BUF_MODE, (UINT32)&dmx_dma_mode);
    if(dmx_dma_mode == DMX_DIVIDED_BUFF_MODE)
    {
        dmx_io_control(as_info->dmx, DMX_SWITCH_TO_UNI_BUF, 0);
        dmx_mode_need_resume = 1;
    }
    tp = &as_info->cur_tp;
    sat = &as_info->cur_sat;
    as_method = as_info->param.as_method;
    event_handler = as_info->param.as_handler;
    event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANSTART);

    for(i = 0; i<as_info->sat_nr; i++)
    {
        sat_id = as_info->sat_id[i];
        db_search_create_tp_view(sat_id);

        #if (SYS_PROJECT_FE == PROJECT_FE_DVBS||SYS_PROJECT_FE == PROJECT_FE_DVBS2)
        event_handler(ASM_TYPE_SATELLITE, sat_id);
        get_sat_by_id(sat_id, sat);
        /*get correct nim*/
        as_select_nim(sat);
        #endif

        AS_DUMP_SAT(sat);

        if ((AS_METHOD_FFT == as_method)||(AS_METHOD_MULTI_FFT == as_method))
        {
            method = AS_METHOD_FFT;
        }
        else
        {
            as_info->tp_nr = 0;
            MEMSET(as_info->tp_nit, 0,AS_MODULE_MAX_T_NUM*sizeof(UINT8));

            if ((AS_METHOD_TP == as_method)||(AS_METHOD_TP_PID == as_method)
                ||(AS_METHOD_NIT_TP== as_method)||(AS_METHOD_NVOD == as_method))
            {
                as_info->tp_nr = 1;
                as_info->tp_id[0] = as_info->param.as_from;
                if (AS_METHOD_NIT_TP == as_method)
                    event_handler(ASM_TYPE_INC_TRANSPONDER, 0);
            }
            else if ((AS_METHOD_SAT_TP == as_method)||(AS_METHOD_NIT == as_method)
                ||(AS_METHOD_MULTI_TP == as_method)||(AS_METHOD_MULTI_NIT == as_method)
                ||(AS_METHOD_NVOD_MULTI_TP==as_method))
            {
                tp_nr = get_tp_num_sat(sat_id);
                for(j=0; j<tp_nr; j++)
                {
                    get_tp_at(sat_id, j, tp);
                    if (FALSE == tp_sanity_check(as_info,tp, sat))
                    continue;
                    AS_DUMP_TP(tp);
            #ifdef NVOD_FEATURE
                        if(tp->nvod_flg==1)
            #endif
                    as_info->tp_id[as_info->tp_nr++] = tp->tp_id;

                    if (AS_MODULE_MAX_T_NUM == as_info->tp_nr)
                        AS_PRINTF("%s: tp exceed AS_MODULE_MAX_T_NUM!\n", __FUNCTION__);
                }
            } 
            if ((AS_METHOD_NIT == as_method)||(AS_METHOD_NIT_TP == as_method)
                ||(AS_METHOD_MULTI_NIT == as_method))
            {
                MEMSET(as_info->tp_nit, 1, as_info->tp_nr);
            }
            
            method = AS_METHOD_TP;
        }

        ret = as_scan(sat_id, sat, method, as_method != AS_METHOD_NVOD);
        
        update_data( );

        if (ret||as_info->stop_scan_signal)
            break;
    }
#ifdef KAON_SAVE_USE
	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANOVER|(prog_num << 16));
#else
	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANOVER);
#endif

    dmx_io_control(as_info->dmx, CLEAR_STOP_GET_SECTION, 0);
    if(dmx_mode_need_resume)
        dmx_io_control(as_info->dmx, DMX_SWITCH_TO_DVI_BUF, 0);

    sie_open(as_info->dmx, MAX_FILTER_NUMBER, NULL, 0);
    osal_task_dispatch_off();
    if ((as_info->param.as_method == AS_METHOD_NVOD)
            ||(as_info->param.as_method==AS_METHOD_NVOD_MULTI_TP))
    {
        nim_io_control(as_info->nim, NIM_DRIVER_STOP_ATUOSCAN, 0);
        as_info = NULL;
        AS_PRINTF("end time stamp = %d\n", osal_get_tick());
        mid27_declare_cmd_finish(MID27_FLG_AS_NVOD);
    }
    else
    {
        nim_io_control(as_info->nim, NIM_DRIVER_STOP_ATUOSCAN, 0);
        as_info = NULL;
        AS_PRINTF("end time stamp = %d\n", osal_get_tick());
    }
    osal_task_dispatch_on();
}
Beispiel #8
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	VACTION unact;
	UINT8 bID,back_saved;
	S_NODE  s_node;
	P_NODE p_node;
	T_NODE t_node;
	bID = OSD_GetObjID(pObj);
	INT16 i=0;
	INT16 n =0;
	UINT16 prog_num =0;
	UINT8 av_flag = 0;


	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			switch(bID)
			{
				case IDC_CON1:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(1500);
					si_monitor_off(0xFFFFFFFF);
					n = get_sat_num(VIEW_ALL);
					
					recreate_prog_view(VIEW_ALL | PROG_TV_MODE,0);
					for(i=0;i<n;i++)
					{
						get_sat_at(i, VIEW_ALL,&s_node);
						del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
					}
					
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                        		break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);

					si_monitor_off(0xFFFFFFFF);
					n = get_sat_num(VIEW_ALL);
					
					recreate_prog_view(VIEW_ALL | PROG_RADIO_MODE,0);
					for(i=0;i<n;i++)
					{
						get_sat_at(i, VIEW_ALL,&s_node);
						del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
					}
					
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);
					sort_prog_node(PROG_FTA_SORT);	
					av_flag = sys_data_get_cur_chan_mode();
					prog_num = get_prog_num(VIEW_ALL | av_flag, 0);
			              libc_printf("prog_num11111111==%d\n",prog_num);
					for(i=prog_num-1;i>=0;i--)
					{
						get_prog_at(i,&p_node);
						get_tp_by_id(p_node.tp_id, &t_node);
						get_sat_by_id(t_node.sat_id, &s_node);

					    if(p_node.ca_mode == 0)
					    {
					        libc_printf("iiiiiiiiiiiiiiiiii====%d\n",i);
						 del_prog_at((UINT16)i);
					    }
					}
						
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
					break;

				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);
					sort_prog_node(PROG_FTA_SORT_EXT);	
					av_flag = sys_data_get_cur_chan_mode();
					prog_num = get_prog_num(VIEW_ALL | av_flag, 0);
			              libc_printf("prog_num222222222==%d\n",prog_num);
					for(i=prog_num-1;i>=0;i--)
					{
						get_prog_at(i,&p_node);
						get_tp_by_id(p_node.tp_id, &t_node);
						get_sat_by_id(t_node.sat_id, &s_node);
					    if(p_node.ca_mode)
					    {
					   	 libc_printf("i===============%d\n",i);
						 del_prog_at((UINT16)i);
					    }
					}

					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                    			break;

				default:
					break;
				}
			
		}
		break;
	}

	return ret;
}
Beispiel #9
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;
}