Exemplo n.º 1
0
void win_multifeed_set_display(void)
{
	TEXT_FIELD *txt;
	OBJLIST* ol;	
	UINT16 i,cnt,top_idx,cur_idx,dep;
	P_NODE p_node;
	UINT16 channel;
	UINT8 name[32];

	channel = sys_data_get_cur_group_cur_mode_channel();

	get_prog_at(channel,&p_node);

	ol = &multifeed_ol;
	cnt = OSD_GetObjListCount(ol);
	dep = OSD_GetObjListPage(ol);	
	top_idx = OSD_GetObjListTop(ol);

	for(i=0;i<dep;i++)
	{
		cur_idx = top_idx + i;		
		txt = text_items[i];

		if(cur_idx < cnt )
		{
			multifeed_get_feed_name(p_node.prog_id, cur_idx, name);
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)name);
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");
	}
	
}
Exemplo n.º 2
0
void win_multifeed_load(void)
{
	OBJLIST* ol;	
	P_NODE p_node;
	UINT16 channel,cnt,sel,top_idx,cur_idx,dep;
	struct MULTIFEED_INFO multifeed_info;
	INT32 ret;

	ol = &multifeed_ol;

	channel = sys_data_get_cur_group_cur_mode_channel();

	get_prog_at(channel,&p_node);
	MEMSET(&multifeed_info, 0, sizeof(struct MULTIFEED_INFO));
	ret = multifeed_get_info(p_node.prog_id, &multifeed_info);

	sel = 0xFFFF;
	cnt = multifeed_info.num;

	if(multifeed_info.idx < cnt)
		sel= multifeed_info.idx;
		
	dep = OSD_GetObjListPage(ol);	
	cur_idx = 0;
	top_idx = 0;
	if(sel<multifeed_info.num)
		cur_idx = sel;
	top_idx = cur_idx / dep * dep;

	OSD_SetObjListCount(ol, cnt);
	OSD_SetObjListSingleSelect(ol, sel);	
	OSD_SetObjListTop(ol, top_idx);
	OSD_SetObjListCurPoint(ol, cur_idx);
	OSD_SetObjListNewPoint(ol, cur_idx);	
}
Exemplo n.º 3
0
void cti_chnchg_para_reset()
{
	chn_idx_sel_no=0xffff;
	choiced_yes = FALSE;
	pre_channel_index = sys_data_get_cur_group_cur_mode_channel();
	info_showed = FALSE;
	MEMSET(pre_info, 0, sizeof(pre_info));
}
Exemplo n.º 4
0
/* change group and recreate program view with current channel mode, then play it
 * this function does too many things, should be changed later..
 */
void change_group(INT32 shift)
{
	UINT16 cur_channel, max_channel;
	P_NODE p_node;
	UINT32 n;
	SYSTEM_DATA *sys_data;
	UINT8 cur_chan_mode;
	BOOL b_ret;

	sys_data = sys_data_get();

	sys_data_change_group(0);
	
	cur_chan_mode = sys_data_get_cur_chan_mode();
	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	max_channel = get_prog_num(VIEW_ALL | cur_chan_mode, 0);
	if (cur_channel >= max_channel)
		cur_channel = 0;

	n = 0;
	get_prog_at(cur_channel, &p_node);
	while ( ( p_node.skip_flag
	          || ( sys_data->chan_sw == CHAN_SWITCH_FREE && p_node.ca_mode )
	          || ( sys_data->chan_sw == CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode ) )
	        && n != max_channel )
	{
		cur_channel = (cur_channel + 1+max_channel) % max_channel;
		get_prog_at(cur_channel, &p_node);
		n++;
	};

//	if (show_and_playchannel)
//	{
//		sys_data_set_cur_group_channel(cur_channel);
		//win_progname_redraw();
//	}
#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
	/*clean msg*/
	clean_mmi_msg(1, TRUE);
	clean_mmi_msg(3, TRUE);
	clean_mmi_msg(4, TRUE);
	clean_mmi_msg(6, TRUE);
	if(get_mmi_showed()==1||get_mmi_showed()==6)
		win_mmipopup_close();
	if(get_mmi_showed()!=5)
		set_mmi_showed(10);
#endif
#endif

	api_play_channel(cur_channel, TRUE, TRUE, FALSE);
#ifdef AD_SANZHOU
	szxc_ad_hide_txt();
	szxc_ad_show_txt(p_node.prog_number);
	szxc_ad_hide_pic(AD_BANNER);
	szxc_ad_show_banner(p_node.prog_number,banner_pic_rt);
#endif
}
Exemplo n.º 5
0
void win_timerset_timerservice_change(BOOL update)
{
	UINT8 action;
	TEXT_FIELD *txt;
	MULTISEL *msel;
	UINT16 ch_idx, ch_cnt;
	TIMER_SET_CONTENT *settimer;
	P_NODE p_node;


	settimer = &timer_set;

	if (TIMER_MODE == TIMER_MODE_OFF)
		action = C_ATTR_INACTIVE;
	else
	{
		if (TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE)
			action = C_ATTR_INACTIVE;
		else
			action = C_ATTR_ACTIVE;
	}

	/* TIMER service information: message or channel */
	txt = &timer_txt_serviceinfo;
	msel = &timer_msel_serviceinfo;

	if (TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE)
	{
		/* TIMER_SERVICE_SMG */
		OSD_SetMultiselSelType(msel, STRING_ID);
		OSD_SetMultiselCount(msel, 3);
		OSD_SetMultiselSelTable(msel, (void*)WakeupMessageStr_id);
		if (settimer->wakeup_message >= 3)
			settimer->wakeup_message = 0;
		OSD_SetMultiselSel(msel, settimer->wakeup_message);
	}
	else
	{
		//modified by Robin

		if (get_prog_by_id(settimer->wakeup_channel, &p_node) == DB_SUCCES)
			ch_idx = get_prog_pos(settimer->wakeup_channel);
		else
			ch_idx = sys_data_get_cur_group_cur_mode_channel();
		ch_cnt = get_prog_num(VIEW_ALL | settimer->wakeup_chan_mode, 0);
		OSD_SetMultiselSelType(msel, STRING_PROC);
		OSD_SetMultiselCount(msel, ch_cnt);
		OSD_SetMultiselSel(msel, ch_idx);
	}
	OSD_SetTextFieldContent(txt, STRING_ID, (UINT32)TimerServiceTxtStr_id[TIMER_SERVICE_TYPE]);
	if (update)
		OSD_DrawObject((POBJECT_HEAD) &timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

	set_container_active(&timer_con_duration, action);
	if (update)
		OSD_DrawObject((POBJECT_HEAD) &timer_con_duration, C_UPDATE_ALL);
}
Exemplo n.º 6
0
void show_current_epg_detail_win(void)
{	
	UINT16 curitem;
	date_time start_dt,end_dt;
	date_time sch_first_time,sch_second_time,sch_third_time,sch_fourth_time;
	date_time start_time;
	INT32 event_num;
	eit_event_info_t* sch_event = NULL;
	struct win_epg_item_info epg_eve_list_info;
	struct winepginfo current_hl_item;
	SYSTEM_DATA* sys_data;
	
	sys_data = sys_data_get();
	
	if(sys_data->local_time.buseGMT == TRUE)
		get_UTC(&sch_first_time);
	else
		get_STC_time(&sch_first_time);

	if(sch_first_time.min>= 30)
		sch_first_time.min= 30;
	else
		sch_first_time.min = 0;
	win_epg_get_hour_offset(&sch_first_time,&sch_second_time,&sch_third_time,&sch_fourth_time);
	//----------------------
	start_dt =sch_first_time;
	end_dt=sch_fourth_time;

	if(end_dt.min==0)
		end_dt.min=29;
	else
		end_dt.min=59;

	start_dt.sec = 0;
	end_dt.sec = 0;

	curitem = sys_data_get_cur_group_cur_mode_channel();
	libc_printf("curitem = %d \n",curitem);
	sch_event=epg_get_cur_service_event((INT32)curitem, SCHEDULE_EVENT, &sch_first_time, &end_dt, &event_num, FALSE);
	osal_delay(300);
	//--------------------------
	libc_printf("sch_event->event_id = %d \n",sch_event->event_id);
//	if(sch_event->event_id == INVALID_ID)
//		return;
	if(event_num > 0 && sch_event != NULL)
	{
		current_hl_item.event_idx= sch_event->event_id;
		current_hl_item.start = start_dt;
		current_hl_item.end = end_dt;
		current_hl_item.pos =1;
	libc_printf("sch_event = %d \n",sch_event);
		win_epg_detail_open(curitem, &current_hl_item);
	}
}
Exemplo n.º 7
0
void change_fav_channel(INT32 shift)
{
	UINT16 cur_channel,max_channel;
    P_NODE p_node;
    UINT32 i,n;
    SYSTEM_DATA* sys_data;
	
	UINT32 fav_mask;

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

    sys_data = sys_data_get();
	
	max_channel = get_prog_num(VIEW_ALL|sys_data->cur_chan_mode[sys_data->normal_group_idx], 0);
    if(max_channel==0)
        return;
	cur_channel = sys_data_get_cur_group_cur_mode_channel();
    
    n = 0;
    do{
	    cur_channel = (cur_channel + shift + max_channel) % max_channel;
        get_prog_at(cur_channel, &p_node);
        if(shift==0)
            shift = 1;
        n++;
     }while( (p_node.skip_flag  
                || ( (p_node.fav_group[0] & fav_mask) == 0 )
                || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode)
                || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode))   
              && n!=max_channel);
    
    if(p_node.skip_flag 
        || ( (p_node.fav_group[0] & fav_mask) == 0)
        || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode)
        || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode)
        )
        return;

    /*  If first time show the osd and play channel,
        to avoid display incorrect channel when meet skip channel.
    */
	if(show_and_playchannel)
    {
        sys_data_set_cur_group_channel(cur_channel);
        win_progname_redraw();
    }
    
	api_play_channel(cur_channel, TRUE, TRUE,FALSE);
}
Exemplo n.º 8
0
void BackToFullScrPlay()
{
	OSD_RECT rect;
	UINT16 cur_channel;
	UINT8 no_channel = 0, back_saved;

	ap_clear_all_menus();
	menu_stack_pop_all();

	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE , 0);
	if (get_prog_num(VIEW_ALL | PROG_TV_MODE, 0) == 0)
	{
		no_channel = 1;
	}
	if (get_prog_num(VIEW_ALL | PROG_RADIO_MODE, 0) > 0)
	{
		if (no_channel)
			sys_data_set_cur_chan_mode(RADIO_CHAN);
		no_channel = 0;
	}

	if (no_channel)
	{
		if (OSD_ObjOpen((POBJECT_HEAD) &g_win_mainmenu, MENU_OPEN_TYPE_STACK) != PROC_LEAVE)
			menu_stack_push((POBJECT_HEAD) &g_win_mainmenu);
	}
	else
	{
		hde_set_mode(VIEW_MODE_FULL);
		vpo_ioctl(g_vpo_dev, VPO_IO_DIRECT_ZOOM, 0);
		/* Clear OSD */
		OSD_GetRectOnScreen(&rect);
		OSDDrv_RegionFill((HANDLE)g_osd_dev, 0, &rect, OSD_TRANSPARENT_COLOR);
		/* show mute & pause status*/
		ShowMuteOnOff();
		ShowPauseOnOff();
//		ap_cas_message_show();
		/* show channel index */
		key_pan_display_channel(cur_channel);

		if(GetChannelParrentLock())
		{
			api_play_channel(cur_channel,TRUE,TRUE,FALSE);
		}
		//--{{{退到全屏播放的时候,弹出INFO BAR
		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)CHANNEL_BAR_HANDLE, TRUE);	
	}
}
Exemplo n.º 9
0
static int SetTP(unsigned int argc, unsigned char *argv[])
{
    UINT32 freq;	
    UINT32 sym;	
    UINT16 channel;

    T_NODE t_node;	
    P_NODE p_node;		

    if (argc != 3)
    {
        SH_PRINTF("Usage: SetPara <freq> <sym>\n");
        return -1;
    }	
    
    freq = ATOI(argv[1]);
    sym = ATOI(argv[2]);
    
    reset_group();
    channel = sys_data_get_cur_group_cur_mode_channel();
    get_prog_at(channel,&p_node);
    get_tp_by_id(p_node.tp_id, &t_node);
    recreate_tp_view(VIEW_SINGLE_SAT, t_node.sat_id);

    t_node.frq = freq;
    t_node.sym = sym;

    modify_tp(t_node.tp_id,&t_node);    
    api_play_channel(p_node.prog_id, TRUE, FALSE, TRUE); 
    //UIChChgPlayProg(0,p_node.prog_id);
    //UIChChgPlayProg(0,CC_CMD_RESET_CRNT_CH);//for 3501D sfu test
    //UIChChgPlayProg(0,p_node.prog_id);
    
    //LIB_ASH_OC('\r'); 
    //LIB_ASH_OC('\n'); 	

    LIB_ASH_OC('S');
    LIB_ASH_OC('U');        
    LIB_ASH_OC('C');
    LIB_ASH_OC('C');        
    LIB_ASH_OC('E');        
    LIB_ASH_OC('S');        	
    LIB_ASH_OC('S');        		

    LIB_ASH_OC('\r'); 
    LIB_ASH_OC('\n'); 	
	reset_perflag();
    return 0;    
}
Exemplo n.º 10
0
static void win_rs232upg_start()
{
	UINT16 channel;

	OSD_SetProgressBarPos(&rs232upg_bar_progress,(INT16)0);
	OSD_SetTextFieldContent(&rs232upg_txt_progress, STRING_NUM_PERCENT, (UINT32)0);

	sys_upgrade(win_rs232upg_update,upg_check_exit_key/*UIGetExitKey*/);
	FreeSlavelist();
	if(screen_back_state == SCREEN_BACK_VIDEO)
	{
		channel = sys_data_get_cur_group_cur_mode_channel();
		api_play_channel(channel, TRUE, TRUE,FALSE);
	}
}
Exemplo n.º 11
0
static PRESULT timerlst_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 bID;
	TIMER_SET_CONTENT rettimer,*timer;
	SYSTEM_DATA* sys_data;
	P_NODE p_node;
	UINT16 curview_index = 0;


	bID = OSD_GetObjID(pObj);
	sys_data = sys_data_get();
	

	switch(event)
	{
	case EVN_PRE_DRAW:
		break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			sys_data->timer_set.common_timer_num = bID;
			
			timer = &sys_data->timer_set.TimerContent[bID - 1];
			if(timer->timer_mode==TIMER_MODE_OFF)
			{
				timer->wakeup_chan_mode = sys_data_get_cur_chan_mode();
				curview_index = sys_data_get_cur_group_cur_mode_channel();
				get_prog_at(curview_index,&p_node);
				timer->wakeup_channel = p_node.prog_id;
			}/*if the timer if off,set the default channel as current playing one.*/
			
			if(win_timerset_open(timer,&rettimer,timer->timer_mode==TIMER_MODE_OFF))
				MEMCPY(timer,&rettimer,sizeof(TIMER_SET_CONTENT));			
			OSD_TrackObject((POBJECT_HEAD)&g_win_timerlist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
		}
		break;
	default:
		;
		
		
	}

	return ret;
}
Exemplo n.º 12
0
static PRESULT osd_item_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact,input;
	UINT8	id = OSD_GetObjID(pObj);
	BOOL bchanged = FALSE;
	UINT16 	cur_channel = 0;
	P_NODE p_node;

	switch(event)
	{		
	case EVN_FOCUS_PRE_GET:
		break;
		
	case EVN_FOCUS_PRE_LOSE:
		break;

	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16) ;
		if((unact == VACT_INCREASE) || (unact == VACT_DECREASE))
		{
			win_LCN_left_right_key(pObj,id);
			bchanged = TRUE;
			cur_channel = sys_data_get_cur_group_cur_mode_channel();
			get_prog_at(cur_channel, &p_node);
		}
		
		if(sys_data_get_LCN())
			sort_prog_node(PROG_LCN_SORT);
		else
			sort_prog_node(PROG_DEFAULT_SORT); //-m by wangyang 2011-12-21
			//sort_prog_node(PROG_TYPE_SID_SORT);
		update_data();

		if (bchanged)
		{
			cur_channel = get_prog_pos(p_node.prog_id);
			sys_data_set_cur_group_channel(cur_channel);
		}
		
		ret = PROC_LOOP;
		break;
	}
	return ret;

}
Exemplo n.º 13
0
void win_multifeed_change_feed()
{
	OBJLIST* ol;	
	UINT16 sel;
	UINT16 cur_channel = sys_data_get_cur_group_cur_mode_channel();
	
	ol = &multifeed_ol;
	if(OSD_GetObjListCount(ol) == 0)
		return;

	sel = OSD_GetObjListSingleSelect(ol);
      
	if(SUCCESS == multifeed_change_feed(cur_channel, sel))
	{
		api_play_channel(cur_channel, TRUE, TRUE,FALSE);
	}
}
Exemplo n.º 14
0
void win_otaset_load_default_setting(BOOL checkonly)
{
	INT8 rule[20];
	UINT32 freq, symbol, constellation, freq_def;
	P_NODE p_node;
	T_NODE t_node;
	UINT32 prog_num;
	UINT16 cur_channel;
	UINT8  dot_pos;

	UINT32 channel_number=0,fi=0;

	SYSTEM_DATA*	sys_data;
	sys_data = sys_data_get();

    if(sys_data->current_ft_count > 0)
    {
	    ota_symb = sys_data->current_ft[0].c_param.sym;
	    ota_modulation = sys_data->current_ft[0].c_param.constellation;
    }

	get_default_bandparam(sys_data->country, (Band_param *)&uCountryParam);

	prog_num = get_prog_num(VIEW_ALL | TV_CHAN | RADIO_CHAN , 0);
	if (0 != prog_num)
	{
		get_prog_at( sys_data_get_cur_group_cur_mode_channel(),&p_node);
		get_tp_by_id(p_node.tp_id,&t_node);

		ota_freq = t_node.frq;
		ota_symb = t_node.sym;
		ota_modulation= t_node.FEC_inner;
	}
    else
    {
		ota_freq = uCountryParam[0].start_freq;
		ota_symb = sys_data->current_ft[0].c_param.sym;
		ota_modulation= sys_data->current_ft[0].c_param.constellation;
	}
	ota_pid = OTA_DATA_PID;
Exemplo n.º 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;


}
Exemplo n.º 16
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;
	
	sys_data = sys_data_get();
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		if(screen_back_state == SCREEN_BACK_MENU)
		{
			ap_clear_all_menus();
		}
		
		b_popdetail = FALSE;
		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)
		{
			if( (param2 & MENU_OPEN_PARAM_MASK ) == V_KEY_RECALL)
			{
				recall_channel = recall_play_channel(0);
			    if(recall_channel == P_INVALID_ID)
			        return PROC_LEAVE;
			}
		}
        api_inc_wnd_count();
			
		break;
	case EVN_POST_OPEN:
		if(show_and_playchannel)
		{
			UINT16 channel;

			show_and_playchannel = 0;

			channel = sys_data_get_cur_group_cur_mode_channel();
			api_play_channel(channel, TRUE, TRUE,FALSE);
		}
		
		if(recall_channel != P_INVALID_ID)
		{
			api_play_channel(recall_channel, TRUE, TRUE,FALSE);
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);			
		}

		progname_timer = api_start_timer(PROGNAME_TIMER_NAME,PROGNAME_TIMER_TIME,progname_timer_func);
		ShowMuteOnOff();
		ShowPauseOnOff();
#ifdef DVR_PVR_SUPPORT
		ShowRecHintOSDOnOff(GetRecHintState());		
#endif
		break;
	case EVN_PRE_CLOSE:
		break;
	case EVN_POST_CLOSE:
		api_stop_timer(&progname_timer);
        sys_data_save(1);
        api_dec_wnd_count();
		if(b_popdetail)
		{
#if 0//def DVR_PVR_SUPPORT
			if(pvr_info.hdd_valid && (ap_pvr_set_state() != PVR_STATE_IDEL))
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_pvr_ctrl, TRUE);
			else
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_progdetail, TRUE);				
#else
			ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_progdetail, TRUE);
#endif
		}
		break;
	case EVN_PRE_DRAW:
		break;
	case EVN_POST_DRAW:
#ifdef MODIFY_FOR_EGYPT_CUSTOMER
		win_progname_draw_bmp();
#endif
		win_progname_draw_infor();
		break;
	case EVN_UNKNOWNKEY_GOT:
		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;	
}
Exemplo n.º 17
0
BOOL GetSignalStatus(  signal_lock_status* lock_flag,
                        signal_scramble_status* scramble_flag,
                        signal_lnbshort_status* lnbshort_flag,
                        signal_parentlock_status* parrentlock_flag)
{
    UINT8 lock;
    struct dmx_device * dmx_dev;
    signal_lnbshort_status lnbshort;
    SYSTEM_DATA* sys_data;
    sys_data = sys_data_get();    
    UINT8 scrabled,scrable_typ;
    P_NODE p_node;
    UINT16 cur_channel;
    struct VDec_StatusInfo curStatus;
    static UINT16 prechan;
    static UINT32 descDetTime = 0;
	struct nim_device* nim_dev;
#ifdef NEW_DEMO_FRAME
    static UINT32 unlock_times;
	INT32 ts_route_id;
	struct ts_route_info ts_route;
    struct nim_config nim_config;
#endif

	if(cur_tuner_idx == 0)
		nim_dev = g_nim_dev;
	else
		nim_dev = g_nim_dev2;	
    
#ifdef NEW_DEMO_FRAME
	MEMSET(&ts_route, 0, sizeof(struct ts_route_info));
	if(ts_route_get_by_type(TS_ROUTE_MAIN_PLAY, &ts_route_id, &ts_route) != RET_FAILURE)
	{
		nim_dev = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, ts_route.nim_id);
	}
	else
	{
		nim_dev = (cur_tuner_idx == 0) ? g_nim_dev : g_nim_dev2;
	}
#endif

    
    lnbshort = SIGNAL_STATUS_LNBNORMAL;

#if(SYS_LNB_SHORT_DET == SYS_FUNC_ON)

    /*  
    if(sys_data->bLNB_power == LNB_POWER_ON)
    {
        if(LNB_state() == 1)//short
        {
            lnbshort = SIGNAL_STATUS_LNBSHORT;
        }
    }
    */
    lnbshort = lnb_power_short;    
#elif(SYS_12V_SHORT_DET == SYS_FUNC_ON)
	lnbshort = v12_power_short;
#endif

    if(lnbshort_flag != NULL)
        *lnbshort_flag = lnbshort;    
    SetSignalLNBShortStatus(lnbshort);

//    if(*lnbshort_flag  == SIGNAL_STATUS_LNBSHORT)
//        return TRUE;    
    
#ifdef NEW_DEMO_FRAME
	dmx_dev = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, ts_route.dmx_id);
#else
	dmx_dev = g_dmx_dev;
#endif

#ifdef DVR_PVR_SUPPORT
	if(singal_play_chan_nim_busy)
		lock = SIGNAL_STATUS_UNLOCK;
	else
#endif
    		nim_get_lock(nim_dev,&lock);
#if 0//def NEW_DEMO_FRAME  //reset diseqc, but it may hold this process, if attached to UI flow maybe cause bug!
	if(!lock)
		unlock_times++;
	else 
		unlock_times = 0;
	if((unlock_times > 10)&& sys_data->bLNB_power)
	{
		dev_get_nim_config(nim_dev, FRONTEND_TYPE_S, &nim_config);
		frontend_set_antenna(nim_dev, &nim_config.antenna, &nim_config.xpond, 1); 
		if(frontend_lnb_22k_ctl(&nim_config.antenna) || (nim_dev == g_nim_dev2))
			frontend_set_nim(nim_dev, &nim_config.antenna,&nim_config.xpond,1);
		
		nim_get_lock(nim_dev,&lock);
		unlock_times = 0;  
	}
#endif

    if (parrentlock_flag == NULL)
        lv_lock_status = lock? SIGNAL_STATUS_LOCK : SIGNAL_STATUS_UNLOCK;
    else
	    SetSignalLockStatus( lock? SIGNAL_STATUS_LOCK : SIGNAL_STATUS_UNLOCK);

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

#if 0
	scrabled = 0;
	if(dmx_io_control(dmx_dev,IS_AV_SCRAMBLED,(UINT32)(&scrable_typ)) == RET_SUCCESS )
	{
		if(scrable_typ & (VDE_TS_SCRBL|VDE_PES_SCRBL))
			scrabled = 1;
		else
		{
			scrabled = 0;			
		}
	}
#else
    scrabled = key_get_dmx0_scramble(NULL);
#endif

#ifdef CI_SUPPORT2
	if ((parrentlock_flag == NULL) && (p_node.ca_mode) && (!scrabled) && lock && (screen_back_state == SCREEN_BACK_VIDEO) && (VIEW_MODE_FULL == hde_get_mode()) 
#ifdef DVR_PVR_SUPPORT
		&& !freeze_for_pvr //black screen result in pvr state trans!
		&& api_pvr_is_live_playing()
#endif
		)
	{
	    vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus);
		UINT32 freeze_flag = curStatus.display_idx;
		if((curStatus.uFirstPicShowed)  && (curStatus.uCurStatus == VDEC_DECODING)) //for scramble prog and freeze screen (show black screen and scramble osd) 
		{
			osal_task_sleep(100);
			//vdec_io_control(g_decv_dev, VDEC_IO_GET_STATUS, (UINT32)&curStatus);
			vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus);
			if(freeze_flag == curStatus.display_idx)
			{
				osal_task_sleep(100);
				//vdec_io_control(g_decv_dev, VDEC_IO_GET_STATUS, (UINT32)&curStatus);
				vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus);
				if(freeze_flag == curStatus.display_idx) // freeze screen state!
				{
					scrabled = 1;	
#ifdef DVR_PVR_SUPPORT //add to simulate monitor's function for video hold state because monitor is off under DVR project!
					if((!last_ca_pmt_cmd_time) || (last_ca_pmt_cmd_time && (osal_get_tick() > last_ca_pmt_cmd_time + 6000)))
					{
						if(ca_pmt_cmd_cnt >= 2)
						{
							UIChChgPlayProg(0,CC_CMD_RESET_CRNT_CH);
							ca_pmt_cmd_cnt = 0;
						}
						else
						{
							//cc_send_ca_pmt();
							cc_send_ca_pmt(p_node.prog_id);
							ca_pmt_cmd_cnt++;
						}
						last_ca_pmt_cmd_time = osal_get_tick();
					}
#endif
				}
                else
                {
                    ca_pmt_cmd_cnt = 0;
                }
			}
            else
            {
                ca_pmt_cmd_cnt = 0;
            }
		}
		else if(!curStatus.uFirstPicShowed) //for scramble prog and black screen
		{
			scrabled = 1;
            ca_pmt_cmd_cnt = 0;
		}
	}
#endif


#ifdef CTI_CA
{
	UINT32 freeze_flag = curStatus.display_idx;
	
    vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus);
	freeze_flag = curStatus.display_idx;
	if((curStatus.uFirstPicShowed)  && (curStatus.uCurStatus == VDEC_DECODING)) //for scramble prog and freeze screen (show black screen and scramble osd) 
	{
		osal_task_sleep(100);

		vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus);
		if(freeze_flag == curStatus.display_idx)
		{
			osal_task_sleep(100);

			vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus);
			if(freeze_flag == curStatus.display_idx) // freeze screen state!
			{
				scrabled = 1;	
			}
		}
	}
	else if(!curStatus.uFirstPicShowed) //for scramble prog and black screen
	{
		scrabled = 1;
	}

/*qjzheng 2010.5.7 BUG2003 不能播放加锁节目时, 有时提示是CA错误*/
	if( !lv_lock_status )
	{
		scrabled = 0;
	}
}
#endif


    if (parrentlock_flag)
    {
        if (scrabled)
        {
            if (lv_scramble_fake)
                scrabled = 0;
        }
    	SetSignalScrambleStatus(scrabled? SIGNAL_STATUS_SCRAMBLED : SIGNAL_STATUS_UNSCRAMBLED);
    }
    else
    {
        lv_scramble_status = scrabled? SIGNAL_STATUS_SCRAMBLED : SIGNAL_STATUS_UNSCRAMBLED;
    }

    /*Never in In multi-view mode*/
    if(lock && !scrabled && hde_get_mode()!=VIEW_MODE_MULTI)
    {
        if(p_node.ca_mode && sys_data_get_cur_chan_mode() == TV_CHAN)
        {
            if(!curStatus.uFirstPicShowed && curStatus.uCurStatus!=VDEC_PAUSED)
            {
                descDetTime ++;
                if(descDetTime == 1)
                    prechan = cur_channel;
                if(descDetTime >=3 && prechan == cur_channel)
                    scrabled = 1;
                else
                    descDetTime = 0;                    
            }
            else
                descDetTime = 0;
        }
    }   

    if(lock_flag != NULL)
        *lock_flag = lv_lock_status;
    if(scramble_flag != NULL)
        *scramble_flag = lv_scramble_status;
    if(parrentlock_flag != NULL)
        *parrentlock_flag = lv_parrentlock_status;
	
    if(lv_lock_status == SIGNAL_STATUS_LOCK 
        && lv_scramble_status == SIGNAL_STATUS_UNSCRAMBLED
        && lv_lnbshort_status == SIGNAL_STATUS_LNBNORMAL
        && lv_parrentlock_status == SIGNAL_STATUS_PARENT_UNLOCK)
        return FALSE;
    else
    	{	
	    	 return TRUE;        
    	}
       
}
Exemplo n.º 18
0
UINT16 recall_play_channel(UINT8 index)
{
	UINT8 group_type,group_pos = 0;
	UINT8 cur_mode,new_mode,cur_group_idx,cur_group_type,cur_group_pos;
	UINT8 int_group_idx;
	UINT16 cur_channel,playing_channel;
	S_NODE s_node;
	P_NODE *pnode;
	BOOL exit = FALSE;
    INT32 n;
    UINT8 mode_changed;

    playing_channel= sys_data_get_cur_group_cur_mode_channel();
    cur_group_idx = sys_data_get_cur_group_index();
	sys_data_get_cur_mode_group_infor(cur_group_idx,&cur_group_type,  &cur_group_pos, &cur_channel);
	
	index = 0;

    cur_mode = sys_data_get_cur_chan_mode();
    
    if(cur_mode != recent_channels[index].mode)
    {
        sys_data_set_cur_chan_mode(recent_channels[index].mode);
        mode_changed = 1;
    }
    else
        mode_changed = 0;
  
	int_group_idx = recent_channels[index].internal_group_idx;    

	if(int_group_idx==0)
	{
		group_type = ALL_SATE_GROUP_TYPE;
		group_pos = 0;
	}
	else if( int_group_idx<= MAX_SAT_NUM )
	{
		group_type = SATE_GROUP_TYPE;
		group_pos = int_group_idx - 1;
	}
	else
	{
		group_type = FAV_GROUP_TYPE;
		group_pos = int_group_idx - 1 - MAX_SAT_NUM;
	}

	cur_group_idx = sys_data_get_cur_group_index();

	new_mode = sys_data_get_cur_chan_mode();

    //printf("%d,%d,%d\n",cur_group_type,cur_group_pos,cur_channel);
	if(mode_changed || group_type != cur_group_type || (group_pos!=cur_group_pos && group_type!=ALL_SATE_GROUP_TYPE))
	{

RECREATE_PROG_VIEW:	
		if(group_type==ALL_SATE_GROUP_TYPE)
			recreate_prog_view(VIEW_ALL | new_mode, 0);
		else if(group_type==SATE_GROUP_TYPE)
		{
			if( get_sat_at(group_pos,VIEW_ALL,&s_node) != SUCCESS)
				return P_INVALID_ID;
			recreate_prog_view(VIEW_SINGLE_SAT|new_mode,s_node.sat_id);
		}
		else
			recreate_prog_view(VIEW_FAV_GROUP|new_mode,group_pos);

		if(exit)
		{
		    //printf("No this group,exit to previous group,int_group_idx%d\n",int_group_idx);
			return P_INVALID_ID;
		}

		if( get_prog_num(VIEW_ALL | new_mode, 0) >0 )
			sys_data_set_cur_intgroup_index(int_group_idx);
		else
		{
			exit = TRUE;
			group_type = cur_group_type;
			group_pos = cur_group_pos;
			new_mode = cur_mode;
            sys_data_set_cur_chan_mode(cur_mode);
			goto RECREATE_PROG_VIEW;
		}
		mode_changed = 1;// re-using this variable
	}else
	{
        mode_changed = 0;// re-using this variable
	}

	cur_mode = sys_data_get_cur_chan_mode();

    //cur_channel = get_prog_pos(&recent_channels[index].p_node);
    pnode = &recent_channels[index].p_node;
    cur_channel = get_prog_pos(pnode->prog_id);
	n=  get_prog_num(VIEW_ALL | cur_mode, 0);
    if(cur_channel>= n)
    {
        if(n>0)
            cur_channel = n - 1;
/*		
        else
        {
           exit = TRUE;
           group_type = cur_group_type;
           group_pos = cur_group_pos;
           sys_data_set_cur_chan_mode(cur_mode);
           goto RECREATE_PROG_VIEW;
        }        
*/        
    } 
    if(0 == mode_changed && playing_channel == cur_channel)
    {
        cur_channel = P_INVALID_ID;
    }
    return cur_channel;
}
Exemplo n.º 19
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

}
Exemplo n.º 20
0
void change_channel(INT32 shift)
{
	UINT16 cur_channel,max_channel;
    P_NODE p_node;
    UINT32 n;
    SYSTEM_DATA* sys_data;
	UINT16 cur_tp_id;
    UINT8  cur_ca_mode;
	UINT8 change_enable = TRUE;
    sys_data = sys_data_get();

#if 0//def PVR_DMX_DELAY_SUPPORT          //guop edit 20110118
	if (api_pvr_is_recording())
	{
		UINT8 back_saved;
		win_compopup_init(WIN_POPUP_TYPE_OK);					   
		win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H);
		win_compopup_set_msg("Please stop record, then change channel!",NULL,0);
		win_compopup_open_ext(&back_saved);
		return;
	}
#endif

	//max_channel = get_node_num(TYPE_PROG_NODE, NULL);
	max_channel = get_prog_num(VIEW_ALL|sys_data->cur_chan_mode[sys_data->normal_group_idx], 0);
    if(max_channel==0)
        return ;
	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	get_prog_at(cur_channel, &p_node);
	cur_tp_id = p_node.tp_id;
    cur_ca_mode = p_node.ca_mode;
	//libc_printf("cur_tp_id = %d, cur_channel= %d\n",cur_tp_id,cur_channel);

    if( !(show_and_playchannel && shift==0) )
    {
        n = 0;
        do{
    	    cur_channel = (cur_channel + shift + max_channel) % max_channel;
            get_prog_at(cur_channel, &p_node);
            if(shift==0)
                shift = 1;
            n++;
         }while( (p_node.skip_flag  
                    || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode)
                    || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode))   
                  && n!=max_channel);
        
        if(p_node.skip_flag || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode)
                    || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode))
            return ;
    }

#if ((!defined(NEW_DEMO_FRAME)) || \
	 (defined(NEW_DEMO_FRAME) && defined(CC_USE_TSG_PLAYER)))
#ifdef DVR_PVR_SUPPORT
	if (api_pvr_is_recording())
	{
		if (p_node.tp_id == cur_tp_id)
		{
			change_enable = TRUE;

			if (cur_ca_mode && (sys_data_get_scramble_record_mode() == 1) &&
				api_pvr_is_record_active() && api_pvr_is_recording_cur_prog())
			{
				change_enable = FALSE;
			}
		}
		else
		{
			change_enable = FALSE;
		}
	}
	
	if (!change_enable)
	{
		UINT8 back_saved;
		win_compopup_init(WIN_POPUP_TYPE_OK); 					   
		win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W+100, MSG_POPUP_LAYER_H);
		win_compopup_set_msg("Please stop record, then change channel!",NULL,0);
		win_compopup_open_ext(&back_saved);
	}
#endif
#endif

	if(change_enable)
	{
	    /*  If first time show the osd and play channel,
	        to avoid display incorrect channel when meet skip channel.
	    */
		if(show_and_playchannel)
	    {
	        sys_data_set_cur_group_channel(cur_channel);
	        win_progname_redraw();
	    }


		for(n=0;n<MAX_TIMER_NUM;n++)
		{//bug30192.when timer play,if change channel,cancel timer duration.
			if((sys_data->timer_set.TimerContent[n].wakeup_state == TIMER_STATE_RUNING) 
				&& (sys_data->timer_set.TimerContent[n].wakeup_duration_time > 0)
				&& (sys_data->timer_set.TimerContent[n].timer_service == TIMER_SERVICE_CHANNEL))
				sys_data->timer_set.TimerContent[n].wakeup_duration_time = 0;
		}

		api_play_channel(cur_channel, TRUE, TRUE,FALSE);
#ifdef MULTIFEED_SUPPORT
        if(multifeed_have_feed(p_node.prog_id))
        {
            UINT32 hk;
            ap_vk_to_hk(0, V_KEY_RED, &hk);
            ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hk, TRUE);
        }
#endif
	}
}
Exemplo n.º 21
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;
}
Exemplo n.º 22
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;

}
Exemplo n.º 23
0
void cti_chnchg_function()
{
	UINT16 chn_idx=0xffff;
	date_time local_time;
	CTI_CHN_CHG_CONTENT chnchg_data;
	UINT8 save;
	BOOL need_change = TRUE,info_changed = FALSE;
	win_popup_choice_t sel;
	UINT16 string[CHANNEL_JUMP_STR_LEN_MAX/2+1];

	INT sec = 0;
	if(pre_channel_index!=sys_data_get_cur_group_cur_mode_channel())//换台了
	{
		cti_chnchg_para_reset();
	}

	if(!get_cti_chnchg_flg())
	{
		return;
	}

	MEMSET(&local_time,0,sizeof(date_time));
	get_local_time(&local_time);

	MEMSET(&chnchg_data,0,sizeof(CTI_CHN_CHG_CONTENT));
	get_cti_chnchg_data(&chnchg_data);

	//显示内容有没有变化
	if(MEMCMP(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString))==0)
	{
		info_changed = FALSE;
	}
	else
	{
		info_changed = TRUE;
	}

	chn_idx=GetPlayChannelID(chnchg_data.bType,chnchg_data.wPart1,
							chnchg_data.wPart2,chnchg_data.wPart3,chnchg_data.wPart4);

	if((chnchg_data.bStatus==0)
		||(chnchg_data.bStatus==2))//立即跳转
	{
		set_cti_chnchg_flg(FALSE);
	}
	else//时间跳转
	{
		if(api_compare_day_time_ext(&(chnchg_data.stStartTime),&local_time)>=0)	//跳转时间没有到
		{
			need_change = FALSE;
		}
		else if(api_compare_day_time_ext(&(chnchg_data.stEndTime),&local_time)>=0)	//正常跳转
		{
			sec = cti_mktime(&(chnchg_data.stEndTime),&local_time);
		}
		else//控制时间已过
		{
			need_change = FALSE;
			set_cti_chnchg_flg(FALSE);
			return;
		}
	}

	if((chn_idx!=0xffff)
		&&(chn_idx!=sys_data_get_cur_group_cur_mode_channel())
		&&need_change)
	{

		if(chnchg_data.bStatus==0)//强制立即跳转
		{
			BackToFullScrPlay();
			win_compopup_init ( WIN_POPUP_TYPE_SMSG );
			win_compopup_set_frame ( 100, 140, 400, 120);
			//win_compopup_set_frame(100, 180, 400, 80);
			win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
			win_compopup_open_ext ( &save );
			osal_task_sleep(3000);
			win_compopup_close();
		}
		else if(chnchg_data.bStatus==1)//强制时间跳转
		{
			if(!info_showed)
			{
				BackToFullScrPlay();
				win_compopup_init ( WIN_POPUP_TYPE_SMSG );
				win_compopup_set_frame ( 100, 140, 400, 120);
				//win_compopup_set_frame(100, 180, 400, 80);
				win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
				win_compopup_open_ext ( &save );
				osal_task_sleep(3000);
				win_compopup_close();
				info_showed = TRUE;
			}
		}
		else if(chnchg_data.bStatus==2)//用户选择立即跳转
		{
			if((sys_data_get_cur_group_cur_mode_channel()==chn_idx_sel_no)
				&&(!info_changed))
			{
				return;
			}
			else
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);				
				//win_compopup_set_frame ( 100, 120, 400, 160);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, 5);
				if (sel == WIN_POP_CHOICE_NO)
				{
					chn_idx_sel_no = sys_data_get_cur_group_cur_mode_channel();
					return;//do not change
				}	
				//choice yes,so change channel
			}
		}
		else if(chnchg_data.bStatus==3)//用户选择按时间跳转
		{
			if((!info_showed)||info_changed)//没有显示过或者字符变化了
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT				
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, sec);
				choiced_yes = FALSE;
				info_showed = TRUE;
				if ((sel == WIN_POP_CHOICE_NO) || (sel == WIN_POP_CHOICE_TIMEOUT))
				{
					return;//do not change
				}	
				choiced_yes = TRUE;
			}
			else if(choiced_yes==TRUE)//用户选择yes,则继续判断是否需要跳转
			{

			}
			else
			{
				return;//提示过,不再提醒,也不换台
			}

		}

		api_play_channel(chn_idx, TRUE, TRUE, FALSE);
	}
}
Exemplo n.º 24
0
void change_fav_channel(INT32 shift)
{
	UINT16 cur_channel, max_channel;
	P_NODE p_node;
	UINT32 i, n;
	SYSTEM_DATA *sys_data;

	UINT32 fav_mask;

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

	sys_data = sys_data_get();

	max_channel = get_prog_num(VIEW_ALL | sys_data->cur_chan_mode, 0);
	if (max_channel == 0)
	{
#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
		if(get_mmi_msg_cnt()>0)
		{
			ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE);
			MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: change fav ch only one; code:%d\n",0);
			set_mmi_showed(10);
		}
#endif
#endif    	
		return ;
	}
	cur_channel = sys_data_get_cur_group_cur_mode_channel();

	n = 0;
	do
	{
		cur_channel = (cur_channel + shift + max_channel) % max_channel;
		get_prog_at(cur_channel, &p_node);
		if (shift == 0)
			shift = 1;
		n++;
	}
	while ( ( p_node.skip_flag
	          || ( ( p_node.fav_group[0] & fav_mask ) == 0 )
	          || ( sys_data->chan_sw == CHAN_SWITCH_FREE && p_node.ca_mode )
	          || ( sys_data->chan_sw == CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode ) )
	        && n != max_channel );

	if ( p_node.skip_flag
	        || ( ( p_node.fav_group[0] & fav_mask ) == 0 )
	        || ( sys_data->chan_sw == CHAN_SWITCH_FREE && p_node.ca_mode )
	        || ( sys_data->chan_sw == CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode )
	   )
	{
#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
		if(get_mmi_msg_cnt()>0)
		{
			ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE);
			MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: change fav ch invalid; code:%d\n",0);
			set_mmi_showed(10);
		}
#endif
#endif    	
		return ;
	}

#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
	/*clean msg*/
	/*clean msg*/
	clean_mmi_msg(1, TRUE);
	clean_mmi_msg(3, TRUE);
	clean_mmi_msg(4, TRUE);
	clean_mmi_msg(6, TRUE);
	if(get_mmi_showed()==1||get_mmi_showed()==6)
		win_mmipopup_close();
	if(get_mmi_showed()!=5)
		set_mmi_showed(10);
#endif
#endif

	/*  If first time show the osd and play channel,
	to avoid display incorrect channel when meet skip channel.
	 */
	if (show_and_playchannel)
	{
		sys_data_set_cur_group_channel(cur_channel);
		win_progname_redraw(TRUE);
	}

	api_play_channel(cur_channel, TRUE, TRUE, FALSE);
#ifdef AD_SANZHOU
	szxc_ad_hide_txt();
	szxc_ad_show_txt(p_node.prog_number);
	szxc_ad_hide_pic(AD_BANNER);
	szxc_ad_show_banner(p_node.prog_number,banner_pic_rt);
#endif
}
Exemplo n.º 25
0
static PRESULT info_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	POBJECT_HEAD submenu;

	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_title((POBJECT_HEAD)&win_info_con,RS_TOOLS_INFORMATION, 0);
		break;			
	case EVN_POST_OPEN:
		display_sys_infomation(0);
		break;		
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;				
		break;
	case EVN_POST_CLOSE:
		break;
	case EVN_UNKNOWN_ACTION:
        param1 &= 0xff;
		if (factorytest_check_magic_key(param1))
		{
#ifdef FACTORY_TEST_MENU
			submenu = (POBJECT_HEAD)&g_win_factory_test;
			if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_OTHER) != PROC_LEAVE)
				menu_stack_push(submenu);
#endif
		}
		else if (factorytest_check_magic_key_diag(param1))
		{
			UINT16 channel = sys_data_get_cur_group_cur_mode_channel();
            UINT16 group_idx = sys_data_get_cur_group_index();
			sys_data_change_group(group_idx);

            api_stop_play(0); //to call si_monitor_off for fixing bug 13806 --Michael 2008/2/18
			api_play_channel(channel, TRUE, FALSE, FALSE);
            ap_clear_all_menus();
			extern CONTAINER win_diag;
			ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&win_diag, TRUE);
		}
        else if(factorytest_check_hdmi_hdcp_key(param1))
        {
            extern CONTAINER g_win_hdmi_factory_test;
            submenu = (POBJECT_HEAD)&g_win_hdmi_factory_test;
            if(OSD_ObjOpen(submenu,MENU_OPEN_TYPE_OTHER) != PROC_LEAVE)
            {
                menu_stack_push(submenu);
            }
        }
        else if(factorytest_check_epg_show_logo_key(param1))
        {
            UINT8 back_saved;
            win_epg_set_show_state();
            win_compopup_init(WIN_POPUP_TYPE_SMSG);
            if(win_epg_is_show_logo())
            {
                win_compopup_set_msg("EPG Show Logo", NULL, 0);
            }
            else
            {
                win_compopup_set_msg("EPG Normal", NULL, 0);
            }
            win_compopup_open_ext(&back_saved);
            osal_task_sleep(2000);
            win_compopup_smsg_restoreback();
        }
		break;
	}
	return ret;
}
Exemplo n.º 26
0
static void newcamd_draw_progname(BOOL update)
{
	UINT8 av_mode,j;
	UINT16 cur_channel,strlen;
	P_NODE p_node;
	UINT32 ret;
	char prog_name[50];
	char string[100];
	UINT16 uni_string[100];
	
	av_mode = sys_data_get_cur_chan_mode();

    if( sys_data_get_group_num() == 0 )
    {
		sys_data_set_cur_chan_mode(av_mode==TV_CHAN? RADIO_CHAN : TV_CHAN);        
		if( sys_data_get_group_num() == 0 )
		{
		    sys_data_set_cur_chan_mode(av_mode);

			ComUniStrCopyChar((UINT8 *)uni_string, OSD_GetUnicodeString(RS_MSG_NO_CHANNELS));
			goto set_progname;
		}
    }

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

#ifndef DB_USE_UNICODE_STRING
	MEMSET(prog_name,0,sizeof(prog_name));
    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,"%d.%s",cur_channel+1,prog_name);
    else
        sprintf(string,"$%d.%s",cur_channel+1,prog_name);

	ComAscStr2Uni(string, (UINT16 *)uni_string)
#else
    if(p_node.ca_mode==0)
        sprintf(string,"%d.",cur_channel+1);
    else
        sprintf(string,"$%d.",cur_channel+1);
	
    ComAscStr2Uni(string,uni_string);
    strlen = ComUniStrLen( uni_string);

    ComUniStrCopyChar( (UINT8 *)&uni_string[strlen],p_node.service_name);
    strlen = ComUniStrLen( uni_string);

#endif 

set_progname:
	OSD_SetTextFieldContent(&newcamd_txt_chn, STRING_UNICODE, (UINT32)uni_string);

	if(update)
	{
		OSD_DrawObject((POBJECT_HEAD)&newcamd_txt_chn,C_DRAW_SIGN_EVN_FLG |C_UPDATE_ALL);
	}

}
Exemplo n.º 27
0
static PRESULT win_progdetail_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{	
	PRESULT ret = PROC_PASS;
	VACTION	unact;
	UINT32  vkey;
	static int input_num = 0;
	UINT16 curitem;
	curitem = sys_data_get_cur_group_cur_mode_channel();
	
	switch(event)
	{
	case EVN_PRE_OPEN:
	        api_inc_wnd_count();

		info_load();
#if (CC_ON==1)
		cc_vbi_show_on(FALSE);
#endif
		show_epg_detail = FALSE;
		break;
	case EVN_POST_OPEN:
		//win_minisignal_open(pObj);
		win_prog_event_display(TRUE);
		
		win_minisignal_open_ex(pObj,SIGNAL_L,SIGNAL_T);
		win_signal_refresh();
		break;
	case EVN_MSG_GOT:
		if(CTRL_MSG_SUBTYPE_STATUS_SIGNAL == param1)
			win_signal_refresh(); 
        else if(CTRL_MSG_SUBTYPE_CMD_PIDCHANGE == param1)
        {
            info_load();
            OSD_DrawObject((POBJECT_HEAD)&txt_pidinfo,C_UPDATE_ALL);
        }
		break;
	case EVN_PRE_CLOSE:
		break;
	case EVN_POST_CLOSE:
		win_minisignal_restore();
		win_signal_close();		
	        api_dec_wnd_count();
		if(show_epg_detail)
		{
			eit_event_info_t *pe=NULL;
			UINT8 *s1=NULL;
			UINT16 cur_channel;
			INT32 len;
			cur_channel = sys_data_get_cur_group_cur_mode_channel();
			pe=epg_get_cur_service_event((INT32)cur_channel, PRESENT_EVENT, NULL,NULL,NULL, /*event_update*/TRUE);
			s1=epg_get_event_name(pe, &len);
			if (s1 )				
			{
				show_current_epg_detail_win();
			}
		}
		break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16) ;
		ret = win_progdatail_unkown_act_proc(unact);		
		break;

#ifdef SFU_TEST_SUPPORT
   case EVN_UNKNOWNKEY_GOT:
        ap_hk_to_vk(0,param1,&vkey);
        //libc_printf("%s %d\n",__FUNCTION__,vkey);
        if(vkey <= V_KEY_9 && vkey >= V_KEY_0)
        {
            input_num *= 10;
            input_num += vkey;
            if(2008 == input_num)
            {
                 //#define IOBASEADDRRESS  0xB8000000
                 //#if (SYS_CHIP_MODULE == ALI_S3601)
                 //#define EXT_INT_STAT    (IOBASEADDRRESS + 0x30)
                 //#define EXT_INT_MASK    (IOBASEADDRRESS + 0x34)
                 //#elif (SYS_CHIP_MODULE == ALI_S3602)
                 //#define EXT_INT_STAT    (IOBASEADDRRESS + 0x30)
                 //#define EXT_INT_MASK    (IOBASEADDRRESS + 0x38)
                 //#else
                 //#define EXT_INT_STAT    (IOBASEADDRRESS + 0x38)
                 //#define EXT_INT_MASK    (IOBASEADDRRESS + 0x3C)
                 //#endif
                 //disable pan and ir interrupt
                 //*(volatile UINT32*)EXT_INT_MASK = (*(volatile UINT32*)EXT_INT_MASK) & (~0x10080000);
                 libc_printf("Enter SFU auto test\n");
                 input_num = 0;
                 extern struct pan_device*   g_pan_dev;
                 pan_close(g_pan_dev);
                 g_b_is_open_sfu = TRUE;
                 SFUTestInit();
                 ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_progdetail,FALSE);
            }
        }
        else
        {
            input_num = 0;
        }
        break;
#endif
	default:
		break;
	}

	return ret;
}
Exemplo n.º 28
0
static void win_prog_event_display(BOOL update)
{
    TEXT_FIELD*name = &txt_event;
    TEXT_FIELD*time = &txt_time;
    UINT16 curitem;
    UINT16 unistr[30];
    INT8 str[30],str2[30];
    INT32 len;
    eit_event_info_t* sch_event = NULL;
    UINT16* s;
    UINT16 play_per =0;
    date_time curtime,starttime,endtime;
    INT32  time_cur,time_start,time_end,time_ab,time_ab_cur;
    time_cur=time_start=time_end=time_ab=time_ab_cur=0;


    get_stream_UTC_time(&curtime);
    time_cur=curtime.hour*60+curtime.min;

    curitem = sys_data_get_cur_group_cur_mode_channel();

    if(current_hl_item.event_idx == INVALID_ID)
    {
        STRCPY(str,"");
        OSD_SetTextFieldContent(name, STRING_ANSI, (UINT32)str);
        OSD_SetTextFieldContent(time, STRING_ANSI, (UINT32)str);
        return;
    }
    sch_event=epg_get_cur_service_event(curitem, PRESENT_EVENT, NULL, NULL, NULL, TRUE);

    if(sch_event!=NULL)
    {
        //if(sch_event->event_id==current_hl_item.event_idx)
        s=epg_get_event_name(sch_event,&len);
        if (s == NULL)
        {
            STRCPY(str,"");
            OSD_SetTextFieldContent(name, STRING_ANSI, (UINT32)str);
            OSD_SetTextFieldContent(time, STRING_ANSI, (UINT32)str);
        }
        else
        {
            OSD_SetTextFieldContent(name,STRING_UNICODE,(UINT32)s);
            get_event_start_time(sch_event, &starttime);
            time_start=starttime.hour*60+starttime.min;
            epg_get_event_start_time(sch_event, str);
            len = STRLEN(str);

            STRCPY(&str[len],"~");
            len = STRLEN(str);

            get_event_end_time(sch_event, &endtime);
            time_end=endtime.hour*60+endtime.min;
            epg_get_event_end_time(sch_event, str2);

            STRCPY(&str[len],str2);

            OSD_SetTextFieldContent(time, STRING_ANSI, (UINT32)str);
            if(starttime.hour<=endtime.hour)
            {
                time_ab = time_end-time_start;
                time_ab_cur=time_cur -time_start;
            }
            else
            {
                time_ab =(24-starttime.hour +endtime.hour)*60+endtime.min-starttime.min;
                if(starttime.hour<=curtime.hour)
                {
                    time_ab_cur = (curtime.hour-starttime.hour)*60 +curtime.min-starttime.min;
                }
                else
                {

                    time_ab_cur = (24-starttime.hour +curtime.hour)*60 +curtime.min-starttime.min;
                }
            }
            if(time_ab==0)
                play_per=100;
            else
                play_per =time_ab_cur*100/time_ab;

            win_play_process_update(play_per);
        }
    }
    else
    {
        STRCPY(str,"");
        OSD_SetTextFieldContent(name, STRING_ANSI, (UINT32)str);
        OSD_SetTextFieldContent(time, STRING_ANSI, (UINT32)str);
    }
    if(update)
    {
        OSD_DrawObject((POBJECT_HEAD)&txt_event, C_UPDATE_ALL);
        OSD_DrawObject((POBJECT_HEAD)&txt_time, C_UPDATE_ALL);
    }
}