Ejemplo n.º 1
0
/*description	: transpoder program search update callback.*/
static UINT8 psi_callback(UINT8 progress, void *param)
{
    UINT16 pg_pos;

    if (progress>=AS_PROGRESS_NIT)
    {
	if(progress==0xF0)//psi_on_nit:param=tp  count
		return as_info->stop_scan_signal;
	else
        	return as_update_tp((TP_INFO *)param);

    }
    else if (progress!=AS_PROGRESS_NIT_VER_CHANGE)
    {
        if (param)
        {
            P_NODE *p_node = (P_NODE *)param;
            pg_pos = get_prog_pos(p_node->prog_id);
            #ifdef AS_SUPPORT_INC_PROGRAM
            if (p_node->pmt_version) 
                as_info->param.as_handler(ASM_TYPE_INC_PROGRAM, pg_pos);			
            else 
            #endif				
            as_info->param.as_handler(ASM_TYPE_ADD_PROGRAM, pg_pos);
        
        }

    if (as_info->param.as_method == AS_METHOD_TP)
        as_info->param.as_handler(ASM_TYPE_PROGRESS, progress);
    }
	return as_info->stop_scan_signal;
}
Ejemplo n.º 2
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);
}
Ejemplo n.º 3
0
static PRESULT win_findprog_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT cbRet = PROC_PASS;
	
	UINT32 i,wTop,prog_idx,nStrLen,k;

	UINT16 channel,str_len;
	UINT16 unistr[50];
	char prog_pre[20];
	P_NODE  p_node;
	OBJLIST* ol = (OBJLIST*)pObj;

	UINT16 dep,cnt;

	dep = OSD_GetObjListPage(ol);
	cnt = OSD_GetObjListCount(ol);

	if(event==EVN_PRE_DRAW)
	{		
    	wTop = OSD_GetObjListTop(ol);
    	for(i=0;i<dep && (i+wTop)<cnt;i++)
		{
			prog_idx = i + wTop;
			get_find_prog_by_pos(prog_idx,&p_node);

			sprintf(prog_pre,"%04d  %s",prog_idx + 1,(p_node.ca_mode==0)? "" :  "$");
			nStrLen = ComAscStr2Uni(prog_pre, unistr);
			ComUniStrCopy(&unistr[nStrLen], (UINT16*)p_node.service_name);

			win_comlist_set_str(i + wTop, NULL, (char*)unistr,0);
		}
	}
	else if(event==EVN_POST_CHANGE)
	{
		cbRet = PROC_LEAVE;
		select_channel_idx = win_comlist_get_selitem();
		get_find_prog_by_pos(select_channel_idx,&p_node);
		select_channel_idx = get_prog_pos(p_node.prog_id);
		
		clear_node_find_flag();

		//UIChChgPlayProg(0, select_channel_idx);

		api_play_channel(p_node.prog_id, TRUE, TRUE, TRUE);
	}

	return cbRet;
}
Ejemplo n.º 4
0
/*description	: transpoder program search update callback.*/
static UINT8 psi_callback(UINT8 progress, void *param)
{
    UINT16 pg_pos;

    //nit scan update tp
    if (progress>=AS_PROGRESS_NIT)
    {
	if(progress==AS_PROGRESS_NIT_TP_CNT)
	{
		UINT16 tp_cnt = *((UINT16 *)param);
		
		if(as_info->param.as_handler!=NULL)
			as_info->param.as_handler(ASM_TYPE_NIT_TP_CNT, tp_cnt);
		return as_info->stop_scan_signal;
	}
			
	return as_update_tp((TP_INFO *)param);
    }
    else if (progress!=AS_PROGRESS_NIT_VER_CHANGE)
    {
        if (param)
        {
            P_NODE *p_node = (P_NODE *)param;
            
            pg_pos = get_prog_pos(p_node->prog_id);
            if(as_info->param.as_handler!=NULL)
		{
			FIXED_PRINTF("psi_callback  **** search_callback ******* ASM_TYPE_ADD_PROGRAM ***sky.bi**\n");
			as_info->param.as_handler(ASM_TYPE_ADD_PROGRAM, pg_pos);
		}
        }

    		if ((as_info->param.as_method == AS_METHOD_TP) && (as_info->param.as_handler != NULL))
    		{
			FIXED_PRINTF("psi_callback  **** search_callback ******* ASM_TYPE_PROGRESS ***sky.bi**\n");
        		as_info->param.as_handler(ASM_TYPE_PROGRESS, progress);
    		}
    	}
	else if(progress==AS_PROGRESS_NIT_VER_CHANGE)
	{
		if(as_info->param.as_handler!=NULL)
			as_info->param.as_handler(ASM_TYPE_NIT_VER_CHANGE, *((UINT8 *)param));
		return as_info->stop_scan_signal;
	}

	return as_info->stop_scan_signal;
}
Ejemplo n.º 5
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;

}
Ejemplo n.º 6
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;
}
Ejemplo n.º 7
0
static PRESULT srch_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT16 title_id;
	POBJECT_HEAD mainmenu;
	UINT8 av_flag;
	UINT16 cur_chan;
	UINT8 back_saved;
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		system_state = SYS_STATE_SEARCH_PROG;
		if(win_search_param.as_method == AS_METHOD_TP
			 || win_search_param.as_method == AS_METHOD_NIT_TP) // tp scan
				title_id = RS_INSTALLATION_TP_SCAN;
		else if(win_search_param.as_method == AS_METHOD_FFT 
	        || win_search_param.as_method == AS_METHOD_MULTI_FFT)//auto scan
	        title_id = RS_INSTALLATION_AUTO_SCAN; 
		else if(win_search_param.as_method == AS_METHOD_SAT_TP
	        ||win_search_param.as_method == AS_METHOD_MULTI_TP
	        || win_search_param.as_method == AS_METHOD_NIT
	        || win_search_param.as_method == AS_METHOD_MULTI_NIT)//preset scan
			title_id = RS_INSTALLATION_PRESET_SCAN;
		else
			title_id = RS_INSTALLATION_AUTO_SCAN;		
		wincom_open_subtitle(pObj,title_id,0);
/*Remove progress bar when search type is AS_METHOD_NIT_TP/AS_METHOD_NIT/AS_METHOD_MULTI_NIT*/
		if(win_search_param.as_method == AS_METHOD_NIT_TP ||
			win_search_param.as_method == AS_METHOD_NIT||
			win_search_param.as_method == AS_METHOD_MULTI_NIT)
		{
            OSD_SetAttr(&srch_progress_txt, C_ATTR_HIDDEN);
            OSD_SetAttr(&srch_progress_bar, C_ATTR_HIDDEN);
		}
        else
        {
            OSD_SetAttr(&srch_progress_txt, C_ATTR_ACTIVE);
            OSD_SetAttr(&srch_progress_bar, C_ATTR_ACTIVE);
        }

		key_pan_display("srch", 4);
		
		epg_off();
		stop_tdt();

#ifdef AUTOSCAN_BYPASS_CI
        // Before Autoscan, DMX0 bypass CI
		if(win_search_param.as_method == AS_METHOD_FFT 
	        || win_search_param.as_method == AS_METHOD_MULTI_FFT)//auto scan
		{
            tsi_dmx_src_select(TSI_DMX_0, TSI_TS_B);
            tsi_para_src_select(TSI_SPI_1,0);
            api_set_nim_ts_type(2, 0x03);			
		}
#endif
#ifdef HW_SS830C
            tsi_dmx_src_select(TSI_DMX_0, TSI_TS_B);	
	     api_set_nim_ts_type(2, 0x03);						
#endif

		break;
	case EVN_POST_OPEN:
		win_search_init();
		break;
	case EVN_PRE_CLOSE:
        win_search_pre_close = 1;
		osal_task_dispatch_off();
		moving_disk = 0;/*Clear moving dish flag*/
		win_search_stop_signal = 1;
		osal_task_dispatch_on();
		as_service_stop();
		db_search_exit();
		//api_stop_timer(&win_search_tmr_id);
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;			

		prog_callback_unregister();
		pid_search_flg = 0;
		break;
	case EVN_POST_CLOSE:
		if((srch_ch_cnt[0] != 0x0)
			|| (srch_ch_cnt[1] != 0x0))
		{
            win_search_last_tp_ok_failed(srch_tp_cnt);

			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_WAIT_FOR_SAVING);
			//win_compopup_open();
			win_compopup_open_ext(&back_saved);
			
			update_data();

			win_compopup_smsg_restoreback();
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg("Search End", NULL, 0);
			win_compopup_open_ext(&back_saved);

			/* Change to all satellite group */
            UINT32 grp_idx = sys_data_get_cur_group_index();

			sys_data_check_channel_groups();
			sys_data_set_cur_group_index(grp_idx);

			av_flag = sys_data_get_cur_chan_mode();

			if(sys_data_get_sate_group_num(av_flag) == 0)
			{
				av_flag = (av_flag == TV_CHAN)? RADIO_CHAN : TV_CHAN;
				sys_data_set_cur_chan_mode(av_flag);
			}
			if(av_flag == RADIO_CHAN && (srch_ch_cnt[1] != 0x0))        //guop add  20101231
			{
				av_flag = TV_CHAN;
				sys_data_set_cur_chan_mode(av_flag);
			}

			sys_data_change_group(grp_idx);

			if(srch_ch_cnt[av_flag] > 0)
			{
				cur_chan = get_prog_pos(win_search_cur_prog[av_flag].prog_id);
				if(cur_chan == 0xFFFF)
				{
                    grp_idx = get_sat_pos(cur_sat_id) + 1;
        			sys_data_change_group(grp_idx);
    				cur_chan = get_prog_pos(win_search_cur_prog[av_flag].prog_id);
                    if (cur_chan == 0xFFFF)
                    {
            			sys_data_change_group(0);
        				cur_chan = get_prog_pos(win_search_cur_prog[av_flag].prog_id);
                        if (cur_chan == 0xffff)
    					    cur_chan = 0;
                    }
				}
				sys_data_set_cur_group_channel(cur_chan);
			}
			else if(sys_data_get_sate_group_num(av_flag))
				key_pan_display("noCH", 4);
			else
				key_pan_display("----", 4);
			sys_data_save(1);
			epg_reset();
		}

		OSD_ClearObject( (POBJECT_HEAD)&srch_progress_bar, C_UPDATE_ALL);
		OSD_ClearObject( (POBJECT_HEAD)&srch_progress_txt, C_UPDATE_ALL);

		mainmenu = (POBJECT_HEAD)&g_win_mainmenu;
		OSD_TrackObject(mainmenu,C_UPDATE_ALL);

#ifdef AUTOSCAN_BYPASS_CI
        // After Autoscan, DMX0 NOT bypass CI
		if(win_search_param.as_method == AS_METHOD_FFT 
	        || win_search_param.as_method == AS_METHOD_MULTI_FFT)//auto scan
		{
            tsi_dmx_src_select(TSI_DMX_0, TSI_TS_A);
            tsi_para_src_select(TSI_SPI_1,0);
		}
#endif
		start_tdt();
		system_state = SYS_STATE_NORMAL;
		
		break;
	case EVN_MSG_GOT:
		ret = win_search_message_proc(param1,param2);		
		break;

	}

	return ret;
}
Ejemplo n.º 8
0
static PRESULT favgrplst_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;

	switch(event)
	{
	case EVN_PRE_OPEN:

#ifdef EXIT_KEY_EXIT_ALL_MENU
	         exit_key_flag =  FALSE;
#endif
		
#ifdef PREVIEW_SUBMENU
#if 1//def OSD_BLACKBERRY
		api_full_screen_play();
		//mm_enter_stop_mode(FALSE);
		if(RADIO_CHAN==sys_data_get_cur_chan_mode())
		{
			//api_show_menu_logo();
			api_play_channel(get_prog_pos(play_chan_id), TRUE, TRUE/*edit_group== NOMAL_GRP*/,FALSE);
		}
#else
		api_full_screen_play();
		mm_enter_stop_mode(FALSE);
		api_show_menu_logo();
#endif
		if((param2 & MENU_OPEN_TYPE_MASK) == MENU_OPEN_TYPE_OTHER)
			preview_menu=1;
		else
			preview_menu=0;
#endif	
		
		wincom_open_subtitle(pObj,RS_FAVORITE,0);
		break;
	case EVN_POST_OPEN:
#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
		wincom_open_commen_help(pObj);
		//wincom_open_help(pObj,fav_group_helpinfo, HELP_CNT);
#else
		//wincom_open_commen_help(pObj);
		wincom_open_help(pObj,fav_group_helpinfo, HELP_CNT);
#endif
		break;
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
		sys_data_save(1);
		break;
	case EVN_POST_CLOSE:
  		wincom_close_subtitle();
		//OSD_ClearObject((POBJECT_HEAD)&g_win_favgrplst,C_UPDATE_ALL);//albert.li add
		//OSD_TrackObject( (POBJECT_HEAD) &g_win_submenu/*g_win_mainmenu*/, C_UPDATE_ALL);//albert.li

#ifdef EXIT_KEY_EXIT_ALL_MENU
	        if( exit_key_flag == TRUE)
	        	{
 			 exit_key_flag =FALSE;
			mm_leave_all_menu();
		}
#endif
		break;
	}

	return ret;
}
Ejemplo n.º 9
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;
        
}