示例#1
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);	
	}
}
示例#2
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
}
示例#3
0
void change_group(INT32 shift)
{
	UINT8 cur_group,max_group;
	UINT16 cur_channel,max_channel;
	UINT8 group_type, group_pos;
	S_NODE s_node;
    P_NODE p_node;
    UINT32 n;
    SYSTEM_DATA* sys_data;
	UINT8 cur_chan_mode;

    sys_data = sys_data_get();
	
	max_group	= sys_data_get_group_num();
	cur_group = sys_data_get_cur_group_index();
	cur_group = (cur_group + shift + max_group) % max_group;
	sys_data_set_cur_group_index(cur_group);
	sys_data_get_cur_mode_group_infor(cur_group, &group_type, &group_pos,&cur_channel);
	
	cur_chan_mode = sys_data_get_cur_chan_mode();
	if(group_type==ALL_SATE_GROUP_TYPE)
	{
		PRINTF("========Change to ALL_SATE_GROUP_TYPE\n");
		recreate_prog_view(VIEW_ALL|cur_chan_mode,0);
	}
	else if(group_type==SATE_GROUP_TYPE)
	{
		get_sat_at(group_pos,VIEW_ALL,&s_node);
		recreate_prog_view(VIEW_SINGLE_SAT|cur_chan_mode,s_node.sat_id);
		PRINTF("========Change to SATE_GROUP_TYPE(%d,%s)\n",group_pos,s_node.sat_name);
	}
	else
	{
		PRINTF("========Change to FAV_GROUP_TYPE(%d)\n",group_pos);
		recreate_prog_view(VIEW_FAV_GROUP|cur_chan_mode,group_pos);
	}

    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++;
    };
    
	
	api_play_channel(cur_channel, TRUE, TRUE,FALSE);

}
示例#4
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);
}
示例#5
0
static INT32 as_scan(UINT16 sat_id, S_NODE *sat, INT32 method, BOOL cached)
{
    INT32 ret=0;
    UINT8 prog_mode;

    if((as_info->param.as_method==AS_METHOD_NVOD)
            ||(as_info->param.as_method==AS_METHOD_NVOD_MULTI_TP))
        prog_mode = PROG_NVOD_MODE;
    else if(as_info->param.as_method==AS_METHOD_DATA)
        prog_mode = PROG_DATA_MODE;
    else
        prog_mode = PROG_ALL_MODE;

    db_search_create_pg_view(TYPE_SAT_NODE,sat_id, prog_mode);
	
#ifdef KAON_SAVE_USE
	prog_num = get_prog_num(VIEW_SINGLE_SAT|PROG_TVRADIO_MODE, sat_id);
#endif
#if (SYS_PROJECT_FE == PROJECT_FE_DVBS||SYS_PROJECT_FE == PROJECT_FE_DVBS2)
    sat2antenna(&as_info->cur_sat, &as_info->antenna);
    antenna_2_snode(&as_info->cur_sat, &as_info->antenna);
    as_info->dual_LNB = (as_info->cur_sat.lnb_high>0)&&(as_info->cur_sat.lnb_low>0)
        &&(as_info->cur_sat.lnb_high != as_info->cur_sat.lnb_low);
    as_info->voltage_ctrl = (as_info->cur_sat.pol == LNB_POL_H)||(as_info->cur_sat.pol == LNB_POL_V);
//>>> Unicable begin
    if(as_info->antenna.lnb_type == LNB_CTRL_UNICABLE)
    {
	    as_info->nim_para.unicable = 1;
	    as_info->nim_para.Fub = as_info->antenna.unicable_freq;
    } 
    else
	    as_info->nim_para.unicable = 0; 
//<<< Unicable end
#endif

    if (AS_METHOD_FFT == method)
    {
    #if (SYS_PROJECT_FE == PROJECT_FE_DVBS||SYS_PROJECT_FE == PROJECT_FE_DVBS2)		
        ret = as_blind_scan();
    #else
        ret = as_enum_scan(sat_id, ATP_TYPE_STEP);
    #endif
    }
    else
    {
        ret = as_enum_scan(sat_id, ATP_TYPE_DBASE);
    }

    if (1== ret)
        as_info->param.as_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_STOFULL);

    return ret;
}
示例#6
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);
}
示例#7
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;
示例#8
0
void win_timerset_timerserviceinfo_change(BOOL update,UINT16 sel)
{
	MULTISEL	*msel;
	TIMER_SET_CONTENT* settimer;
	P_NODE p_node;
	UINT16 ch_idx,ch_cnt;

    
	settimer = &timer_set;
	msel = &timer_msel_serviceinfo;

    if(TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE)
    {
		OSD_SetMultiselSelType(msel,STRING_ID);
		OSD_SetMultiselCount(msel,3);
		OSD_SetMultiselSelTable(msel, (void*)WakeupMessageStr_id);
        if(sel >=3)
            sel = 0;
          settimer->wakeup_message = sel;            
		OSD_SetMultiselSel(msel,settimer->wakeup_message);		
    }
    else
    {
        if(get_prog_at(sel,&p_node) == DB_SUCCES)
            ch_idx = sel;
        else
        {
            ch_idx = sel = 0;
            get_prog_at(sel,&p_node);
        }
        settimer->wakeup_channel = p_node.prog_id; 
        
		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);			
     }
	if(update)
		OSD_DrawObject((POBJECT_HEAD)&timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG |C_UPDATE_ALL);
}
示例#9
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;
}
示例#10
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
	}
}
示例#11
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;
}
示例#12
0
/* Sync group information with database  */
void sys_data_check_channel_groups(void)
{
	UINT8 i, j;
	BOOL b;
	UINT16 total_v_prog_num, total_a_prog_num;
	SYSTEM_DATA *p_sys_data;
	group_channel_t *p_grp;
	UINT16 sat_v_prog_num[1];
	UINT16 sat_a_prog_num[1];

	UINT16 fav_v_prog_num[MAX_FAVGROUP_NUM];
	UINT16 fav_a_prog_num[MAX_FAVGROUP_NUM];
	UINT16 prog_num=0;

	p_sys_data = sys_data_get();


	total_v_prog_num = 0;
	total_a_prog_num = 0;
	for (i = 0; i < 1; i++)
	{
		sat_v_prog_num[i] = 0;
		sat_a_prog_num[i] = 0;
	}
	for (i = 0; i < MAX_FAVGROUP_NUM; i++)
	{
		fav_v_prog_num[i] = 0;
		fav_a_prog_num[i] = 0;
	}


	recreate_prog_view(VIEW_ALL | TV_CHAN, 0);
	total_v_prog_num = get_prog_num(VIEW_ALL | TV_CHAN, 0);

	recreate_prog_view(VIEW_ALL |RADIO_CHAN, 0);
	total_a_prog_num = get_prog_num(VIEW_ALL | RADIO_CHAN, 0);

//	if(!total_v_prog_num && !total_a_prog_num)
//		goto INIT_GROUP;
	
	/* For all  group */
	p_grp = &p_sys_data->cur_chan_group[0];
	if (total_v_prog_num == 0)
		p_grp->tv_channel = P_INVALID_ID;
	else if (p_grp->tv_channel >= total_v_prog_num)
		p_grp->tv_channel = total_v_prog_num - 1;

	if (total_a_prog_num == 0)
		p_grp->radio_channel = P_INVALID_ID;
	else if (p_grp->radio_channel >= total_a_prog_num)
		p_grp->radio_channel = total_a_prog_num - 1;

	/*nvod & data wil be ignored*/
	recreate_prog_view(VIEW_ALL|PROG_DATA_MODE, 0);
	prog_num = get_prog_num(VIEW_ALL | PROG_DATA_MODE, 0);
	p_grp = &p_sys_data->cur_chan_group[DATA_GROUP_TYPE];
	set_special_group_channel(p_grp,prog_num);

	recreate_prog_view(VIEW_ALL|PROG_NVOD_MODE, 0);
	prog_num = get_prog_num(VIEW_ALL | PROG_NVOD_MODE, 0);
	p_grp = &p_sys_data->cur_chan_group[NVOD_GROUP_TYPE];
	set_special_group_channel(p_grp,prog_num);

	
	/*local group in BAT*/
	for(i=0;i<MAX_LOCAL_GROUP_NUM;i++)
	{
		p_grp = &p_sys_data->cur_chan_group[LOCAL_GROUP_TYPE+i];
		prog_num = 0;
		if(p_sys_data->local_group_id[i])
		{
			recreate_prog_view(VIEW_BOUQUIT_ID|PROG_ALL_MODE,p_sys_data->local_group_id[i]);
			prog_num = get_prog_num(VIEW_ALL|PROG_TV_MODE, 0);
			if(prog_num==0)
				p_grp->tv_channel = P_INVALID_ID;
			else
				//p_grp->tv_channel = prog_num - 1;
				p_grp->tv_channel = 0;
			
			prog_num = get_prog_num(VIEW_ALL|PROG_RADIO_MODE, 0);
			if(prog_num==0)
				p_grp->radio_channel = P_INVALID_ID;
			else
				//p_grp->radio_channel = prog_num - 1;
                p_grp->radio_channel = 0;
		}
		else
		{
			p_grp->tv_channel = P_INVALID_ID;
			p_grp->radio_channel = P_INVALID_ID;
		}
	}
	
	/*fav group*/
	get_specific_prog_num ( SAT_PROG_NUM | FAV_PROG_NUM,
	                        sat_v_prog_num, sat_a_prog_num, fav_v_prog_num, fav_a_prog_num );

	for (i = 0; i < MAX_FAVGROUP_NUM; i++)
	{
		p_grp = &p_sys_data->cur_chan_group[MAX_GROUP_NUM+i];

		if (fav_v_prog_num[i] == 0)
			p_grp->tv_channel = P_INVALID_ID;
		else if (p_grp->tv_channel >= fav_v_prog_num[i])
			//p_grp->tv_channel = fav_v_prog_num[i] - 1;
			p_grp->tv_channel = 0;

		if (fav_a_prog_num[i] == 0)
			p_grp->radio_channel = P_INVALID_ID;
		else if (p_grp->radio_channel >= fav_a_prog_num[i])
			//p_grp->radio_channel = fav_a_prog_num[i] - 1;
			p_grp->radio_channel = 0;
		if (fav_v_prog_num[i] > 0 || fav_a_prog_num[i] > 0)
			SYS_PRINTF("fav=%d,v_prog_num=%d,a_prog_num=%d\n", i, fav_v_prog_num[i], fav_a_prog_num[i]);
	}

	SYS_PRINTF("All Sate %d,total_v_prog_num=%d,total_a_prog_num=%d\n", i, total_v_prog_num, total_a_prog_num);

}
示例#13
0
void sys_data_load(void)
{
	AV_Set *av_set;
	//	tDspMode 			aspect_mode;
	BOOL create_view, grp_exst;
	S_NODE s_node;
	UINT8 group_idx, group_type, group_pos;
	UINT16 channel;
	UINT16 langclass;
	INT32 hoffset, moffset;
	UINT8 GMTOffset;
	date_time dt;
	enum TVSystem eTVSys;
	prog_id_t *prog_id;
	UINT8 av_mode;
	UINT8 pre_chan_mode, boot_chan_node;
	UINT16 chan_idx[2], boot_group_idx;

	
	/* Load data here */
	if(load_tmp_data((UINT8*)&system_config,sizeof(system_config))!=SUCCESS)
	{
		osal_task_sleep(50);
		if(load_tmp_data((UINT8*)&system_config,sizeof(system_config))!=SUCCESS)
		{
			osal_task_sleep(50);
			erase_tmp_sector();
			//if load tmp data fail, set to default 
			sys_data_factroy_init();
			save_tmp_data((UINT8*)&system_config,sizeof(system_config));
		}
	}

#ifdef NVOD_FEATURE
	nvod_release();
	nvod_init(system_config.main_frequency, system_config.main_symbol, system_config.main_qam);
#endif
	//SetNvodScanOverFlag(FALSE);
  
	if (CUR_CHAN_MODE > TV_CHAN)
		CUR_CHAN_MODE = TV_CHAN;

	if (get_prog_num(VIEW_ALL | CUR_CHAN_MODE, 0) != 0)
		create_view = TRUE;
	else
		create_view = FALSE;

	if (system_config.startup_switch && system_config.startup_mode <= 2)
	{
		boot_chan_node = pre_chan_mode = CUR_CHAN_MODE;
		if (system_config.startup_mode == RADIO_CHAN)
		{
			CUR_CHAN_MODE = RADIO_CHAN;
			pre_chan_mode = CUR_CHAN_MODE;
		}
		else if (system_config.startup_mode == TV_CHAN)
		{
			CUR_CHAN_MODE = TV_CHAN;
			pre_chan_mode = CUR_CHAN_MODE;
		}
		
		if (CUR_CHAN_GROUP_INDEX >= MAX_GROUP_NUM+MAX_FAVGROUP_NUM)
			CUR_CHAN_GROUP_INDEX = 0;
		boot_group_idx = CUR_CHAN_GROUP_INDEX;

		CUR_CHAN_GROUP_INDEX = 0;/* Force to all sate group*/

		if ( system_config.startup_mode == RADIO_CHAN
		        || system_config.startup_mode == 2 ) //both
		{

			sys_data_set_cur_chan_mode(RADIO_CHAN);
			recreate_prog_view(VIEW_ALL | RADIO_CHAN, 0);
			prog_id = &system_config.statup_chsid[0];
			//chan_idx[0] = get_prog_pos_ext(prog_id->sat_id,prog_id->tp_id,prog_id->prog_number);
			if (get_prog_num(VIEW_ALL | RADIO_CHAN, 0) > 0)
				chan_idx[0] = 0;
			else
				chan_idx[0] = 0xFFFF;
			if (chan_idx[0] != P_INVALID_ID)
				system_config.cur_chan_group[CUR_CHAN_GROUP_INDEX].radio_channel = chan_idx[0];
		}

		if ( system_config.startup_mode == TV_CHAN
		        || system_config.startup_mode == 2 ) //both

		{
			sys_data_set_cur_chan_mode(TV_CHAN);
			recreate_prog_view(VIEW_ALL | TV_CHAN, 0);
			prog_id = &system_config.statup_chsid[1];
			//chan_idx[1]  = get_prog_pos_ext(prog_id->sat_id,prog_id->tp_id,prog_id->prog_number);
			if (get_prog_num(VIEW_ALL | TV_CHAN, 0) > 0)
				chan_idx[0] = 0;
			else
				chan_idx[0] = 0xFFFF;
			if (chan_idx[1] != P_INVALID_ID)
				system_config.cur_chan_group[CUR_CHAN_GROUP_INDEX].tv_channel = chan_idx[1];
		}

		if (chan_idx[pre_chan_mode] != P_INVALID_ID)
		{
			sys_data_set_cur_chan_mode(pre_chan_mode);
			//recreate_prog_view(CREATE_VIEW_ALL_SAT,0);
			create_view = TRUE;
		}
		else
		{
			CUR_CHAN_GROUP_INDEX = boot_group_idx;
			sys_data_set_cur_chan_mode(boot_chan_node);
			system_config.startup_switch = 0;
		}

	}

	api_feed_power_onoff(system_config.feed_power);

	sys_data_set_cur_chan_mode(CUR_CHAN_MODE);

	if (CUR_CHAN_GROUP_INDEX >= MAX_GROUP_NUM+MAX_FAVGROUP_NUM)
		CUR_CHAN_GROUP_INDEX = 0;

	sys_data_check_channel_groups();

	group_idx = sys_data_get_cur_group_index();
	if (group_idx >= sys_data_get_group_num()&&group_idx<MAX_GROUP_NUM)//当group_idx为fav的时候不需要重新设置为0
		sys_data_set_cur_group_index(0);

	if (sys_data_get_group_num() > 0)
		create_view = TRUE;

	if (create_view)
	{
		group_idx = sys_data_get_cur_group_index();

		grp_exst = sys_data_get_cur_mode_group_infor(group_idx, &group_type, &group_pos, &channel);

		if (!grp_exst)
		{
			CUR_CHAN_GROUP_INDEX = 0;
			group_type = ALL_GROUP_TYPE;
		}

		if (group_type == ALL_GROUP_TYPE)
		{
			recreate_prog_view(VIEW_ALL | CUR_CHAN_MODE, 0);
		}
/*
		else if (group_type == SATE_GROUP_TYPE)
		{
			get_sat_at(group_pos, VIEW_ALL, &s_node);
			recreate_prog_view(VIEW_SINGLE_SAT | CUR_CHAN_MODE, s_node.sat_id);
		}
*/
		else
		{
			recreate_prog_view(VIEW_FAV_GROUP | CUR_CHAN_MODE, group_pos);
		}

	}

	MEMCPY(&system_config_bak, &system_config, sizeof(system_config));

    /*display effect setting*/
    sys_data_load_display_effect(TRUE);
	
	/* Load system time*/
	dt = system_config.sys_dt;
	if ( dt.year < 1900 || dt.year > 2100 || dt.month < 1 || dt.month > 12 || dt.day < 1 || dt.day > 31
	        || dt.hour > 23 || dt.min > 59 || dt.sec > 59 )
	{
		/* If system is invalid,set system to initial time*/
		dt.year = DEFAULT_YEAR;
		dt.month = DEFAULT_MONTH;
		dt.day = DEFAULT_DAY;
		dt.hour = 0;
		dt.min = 0;
		dt.sec = 0;
	}
	set_STC_time(&dt);
	init_UTC(&dt);

	if (system_config.local_time.buseGMT)
	{
		sys_data_gmtoffset_2_hmoffset(&hoffset, &moffset);
		set_STC_offset(hoffset, moffset, 0);
		enable_summer_time(system_config.local_time.SummerTime);
	}
	else
	{

		disable_time_parse();
	}

	/* Video Setting */
	av_set = &system_config.avset;
	//	if ( !firsttime )
	api_video_set_tvout(av_set->tv_mode);

	sys_data_set_display_mode(av_set);
    #if(SYS_DEFINE_NULL != SYS_RFM_MODULE)
	sys_data_set_rf(av_set->rf_mode, av_set->rf_channel);
    #endif


	/* Audio Setting */
	api_audio_set_volume(system_config.volume);


	OSD_SetLangEnvironment(system_config.lang.OSD_lang);
	sys_data_select_audio_language(system_config.lang.Audio_lang_1, system_config.lang.Audio_lang_2);

	sys_data_set_palette(0);

	if (system_config.rcupos > MAX_RCU_POSNUM)
		system_config.rcupos = 0;


#ifdef CHANCHG_VIDEOTYPE_SUPPORT
	UIChChgSetVideoType(system_config.chchgvideo_type);
#endif

}
示例#14
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
}
示例#15
0
int ipanel_get_service_ByPID(Service_Info *service)
{
    int i=0;
    short prog_cnt = 0;
    P_NODE prog;
    T_NODE tp;

    prog_cnt = get_prog_num(VIEW_ALL|PROG_ALL_MODE, 0);
    for(i = 0; i < prog_cnt; i++)
    {
        if(SUCCESS!=get_prog_at(i, &prog))
            return -1;
        ipanel_porting_dprintf("-->[ipanel_get_service_ByPID] service_id=%d,service_type=%d,.\n",
                                prog.prog_number,prog.service_type); 
         if(service->service_type!=prog.service_type)
		 	continue;
         if(service->video_pid != 0x0)
         {
            //use video_pid cross frq and do something
            if((service->video_pid == prog.video_pid)&&(service->audio_pid== (UINT32)prog.audio_pid[0])&&(service->pcr_pid==prog.pcr_pid))
             {
			 	progpos=get_prog_pos(prog.prog_id);
                if(SUCCESS != get_tp_by_id(prog.tp_id, &tp))
                {
                    ipanel_porting_dprintf("[ipanel_get_service_ByPID]  get_tp_by_id failed \n");
                    return -1;
                }
                service->ts_id = tp.t_s_id;
				service->net_id = tp.network_id;
                service->frequency = tp.frq;
                service->symbol_rate = tp.sym;
                service->modulation = tp.FEC_inner;
                service->service_type = prog.service_type;
                service->pcr_pid = prog.pcr_pid;
                service->video_pid = prog.video_pid;
                service->audio_pid = (UINT32)prog.audio_pid[0];
				service->service_id=prog.prog_number;
                return 0;
             }
         }
         else if(service->audio_pid != 0x0)
         {
             //use audio_pid cross frq and do something
            // if(service->audio_pid == (UINT32)prog.audio_pid[0])
             if((service->video_pid == prog.video_pid)&&(service->audio_pid== (UINT32)prog.audio_pid[0])&&(service->pcr_pid==prog.pcr_pid))
             {      
			 	 progpos=get_prog_pos(prog.prog_id);
                if(SUCCESS != get_tp_by_id(prog.tp_id, &tp))
                {
                    ipanel_porting_dprintf("[ipanel_get_service_ByPID]  get_tp_by_id failed \n");
                    return -1;
                }
                service->ts_id = tp.t_s_id;
				service->net_id = tp.network_id;
                service->frequency = tp.frq;
                service->symbol_rate = tp.sym;
                service->modulation = tp.FEC_inner;
                service->service_type = prog.service_type;
                service->pcr_pid = prog.pcr_pid;
                service->video_pid = prog.video_pid;
                service->audio_pid = (UINT32)prog.audio_pid[0];
				service->service_id=prog.prog_number;
                return 0;
             }
         }
    }
    ipanel_porting_dprintf("[ipanel_get_service_ByPID] no found  failed \n");
    return -1;
        
}