示例#1
0
/* Get & Set current group index */
UINT8 sys_data_get_cur_group_index(void)
{
	UINT8 i, group_num;
	BOOL b, checkGroup = FALSE;
	UINT8 pre_chan_group_index;


	FIND_GROUP_IDX:

	pre_chan_group_index = CUR_CHAN_GROUP_INDEX;

	for (; CUR_CHAN_GROUP_INDEX <= (MAX_GROUP_NUM+MAX_FAVGROUP_NUM- 1); CUR_CHAN_GROUP_INDEX++)
	{
		b = get_cur_group_idx(&group_num);
		if ( b )	return group_num;
	}

	CUR_CHAN_GROUP_INDEX = pre_chan_group_index;
	while (CUR_CHAN_GROUP_INDEX > 0)
	{
		CUR_CHAN_GROUP_INDEX--;
		b = get_cur_group_idx(&group_num);
		if ( b )	return group_num;
	}
	if (!checkGroup)
	{
		sys_data_check_channel_groups();
		checkGroup = TRUE;
		goto FIND_GROUP_IDX;
	}

	SYS_PRINTF("%s: No program!!!", __FUNCTION__);

	return 0;
}
示例#2
0
static BOOL save_lcn_sorted_prog(void)
{
    BOOL changed = FALSE;
    UINT8 back_saved = 0;
	win_popup_choice_t choice;
	SYSTEM_DATA* p_sys_data=sys_data_get();
	
    if (lcn_sorted_flag1!=lcn_sorted_flag2)
	{
		lcn_sorted_flag1=lcn_sorted_flag2;

		win_compopup_init(WIN_POPUP_TYPE_OKNO);
		win_compopup_set_msg(NULL, NULL, RS_MSG_ARE_YOU_SURE_TO_SAVE);
		choice = win_compopup_open_ext(&back_saved);
		if(choice == WIN_POP_CHOICE_YES)
		{
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_WAIT_FOR_SAVING);
			win_compopup_open_ext(&back_saved);

			update_data();

        	//win_chlst_clear_channel_del_flags();
	        sys_data_check_channel_groups();

			changed = TRUE;

			win_compopup_smsg_restoreback();
			p_sys_data->osd_set.lcn_sort=lcn_display_on_off2;
		}
		else
		{
			p_sys_data->osd_set.lcn_sort=lcn_display_on_off1;	
		}
		
	}

	return changed;
}
示例#3
0
static PRESULT timerlst_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;

	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_subtitle(pObj,RS_SYSTEM_TIMER_SETTING/*RS_SYSTEM_TIMER*/,0);
		break;
	case EVN_POST_OPEN:
		break;
	case EVN_PRE_CLOSE:
		sys_data_check_channel_groups();
		reset_group();
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
               sys_data_save(1);
  		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		break;
	case EVN_PRE_DRAW:
		win_timerlist_loadsetting();
		break;
    case EVN_MSG_GOT:
        if(param1 == CTRL_MSG_SUBTYPE_CMD_UPDATE_VIEW)
        {
            OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
            ret = PROC_LOOP;
        }
        break;
	}


	return ret;
}
示例#4
0
BOOL win_timerset_open(TIMER_SET_CONTENT* settimer,TIMER_SET_CONTENT* rettimer,BOOL check_starttime)
{
	POBJECT_HEAD pObj = (POBJECT_HEAD)&g_win_timerset;
	PRESULT bResult = PROC_LOOP;
	UINT32 hkey;
	UINT8 cur_mode,mode;
	UINT8 group_idx;
	date_time dt,dt1;

    BOOL old_value = ap_enable_key_task_get_key(TRUE);
	sys_data_check_channel_groups();
	cur_mode  = sys_data_get_cur_chan_mode();
	group_idx = sys_data_get_cur_group_index();
	
	
	timer_set_ok_cancel_flag = 0;

	MEMSET(&timer_set,0,sizeof(TIMER_SET_CONTENT));

	if(settimer != NULL)
		MEMCPY(&timer_set,settimer,sizeof(TIMER_SET_CONTENT));
	
	if(timer_set.timer_mode != TIMER_MODE_OFF 
		&& timer_set.timer_service !=TIMER_SERVICE_MESSAGE) 
	{
		if(timer_set.wakeup_chan_mode>1)
			timer_set.wakeup_chan_mode = 1;
		
		mode = timer_set.wakeup_chan_mode;
	}
	else
	{
		mode = cur_mode;
		timer_set.wakeup_chan_mode = cur_mode;
	}
	if(timer_set.timer_mode == TIMER_MODE_OFF)
	{
		timer_set_modify_add_flag = TIMER_ADD;
		timer_set_check_starttime_flag = 1;
	}
	else
	{
		timer_set_modify_add_flag = TIMER_MODIFY;
		timer_set_check_starttime_flag = 1;
	}
	
	get_local_time(&dt1);

	dt1.min = dt1.min/10*10;
	dt1.sec = 0;
	convert_time_by_offset(&dt,&dt1,0,10);	
	
	if(timer_set_modify_add_flag ==  TIMER_ADD)
	{
		timer_set.wakeup_year 	= dt.year;
		timer_set.wakeup_month	= dt.month;
		timer_set.wakeup_day	= dt.day;
		timer_set.wakeup_time  = dt.hour * 60 + dt.min;
		timer_set.wakeup_state = TIMER_STATE_READY;
	}
	if(timer_set.timer_service == TIMER_SERVICE_MESSAGE)
		timer_set.wakeup_duration_time = 0;
		

	sys_data_set_cur_chan_mode(mode);
	sys_data_change_group(0);  
	
	OSD_SetContainerFocus(&g_win_timerset, TIMER_MODE_ID);
	OSD_ObjOpen(pObj, MENU_OPEN_TYPE_OTHER);

	while(bResult != PROC_LEAVE)
	{

		hkey = ap_get_key_msg();
	    if(hkey == INVALID_HK || hkey == INVALID_MSG)
	    {
	    	win_timerset_set_currenttime(TRUE);
	        continue;
	    }
		
		bResult = OSD_ObjProc(pObj, (MSG_TYPE_KEY<<16),hkey, 0);		
	}

	if(timer_set_ok_cancel_flag)
		MEMCPY(rettimer,&timer_set,sizeof(TIMER_SET_CONTENT));
	
	sys_data_set_cur_chan_mode(cur_mode);
	sys_data_change_group(group_idx);  
	sys_data_save(1);
    ap_enable_key_task_get_key(old_value);
	return timer_set_ok_cancel_flag;

}
示例#5
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;
}
示例#6
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;
	UINT32 chunk_id, default_db_addr, default_db_len;
	S_NODE  s_node;
	bID = OSD_GetObjID(pObj);
	INT16 	i,n;
	UINT8 back_saved1;
	UINT16 sat_id;//-a by wangyang 2011-11-03 for factory set del sat program
	win_popup_choice_t choice = WIN_POP_CHOICE_NO;
	
	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_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						chunk_id = 0x03FC0100;
						api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
						set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
						if(GetMuteState())
							SetMuteOnOff(FALSE);
						if(GetPauseState())
							SetPauseOnOff(FALSE);
						win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
						api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                           	 	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);
					#if defined(ORDER_GZ1010010)||defined(ORDER_GZ1011005)||defined(ORDER_GZ1104005)	
						system_config.tv_scan_mode = 0;
					#endif	

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
					break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						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();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						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();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
			        		win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
				   		api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                              	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                    			break;
//-a by wangyang 2011-11-03 for factory set del sat program{{
				case IDC_CON5:

				if(OSD_GetMultiselCount(&factoryset_sel5)==0)
				{
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_NO_CHANNELS);
					win_compopup_open_ext(&back_saved1);
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
				}
				else
				{
					sat_id=OSD_GetMultiselSel(&factoryset_sel5);
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
					//	mm_enter_stop_mode(FALSE);
					//	api_show_menu_logo();
						if(api_is_playing_tv()  || api_is_playing_radio())
						{
							api_stop_play(1);
						}
						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_TVRADIO_MODE,0);
						//for(i=0;i<n;i++)
						{
							get_sat_at(sat_id, SET_SELECTED,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
						
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();
						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
				}
                        		break;
//-a by wangyang 2011-11-03 for factory set del sat program}}
				default:
					break;
			}
			
		}
		break;
	}

	return ret;
}
示例#7
0
static PRESULT tplst_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 back_saved;
	S_NODE s_node;
    	POBJECT_HEAD submenu;

	switch(event)
	{
	case EVN_PRE_OPEN:
		if(sys_data_get_cur_satidx() == (UINT16)(~0))
			cur_tp_sat_idx = win_load_default_satidx();
		else
			cur_tp_sat_idx = sys_data_get_cur_satidx();

		tp_list_pos = 0xffff;
        tp_list_top = 0;

		win_tplist_load_sat(FALSE);
	       pre_tp_sat_idx= cur_tp_sat_idx;
		wincom_close_help();
		wincom_open_subtitle(pObj,RS_TP_LIST,0);
		break;
	case EVN_POST_OPEN:
		//win_signal_open(pObj);
		//win_signal_open_tplist(pObj);
        win_signal_open_ex(pObj,pObj->frame.uLeft+30,pObj->frame.uTop + LIST_ITEMCNT*(ITEM_H + ITEM_GAP) + LST_SAT_H +25);
          wincom_open_commen_help(pObj);
		wincom_open_help(pObj,tplist_helpinfo , HELP_CNT);
		win_tplist_tuner_frontend();
		win_signal_refresh();
		//win_signal_update();
		get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node);
		if(!tpscan_return)
			wincom_dish_move_popup_open(0xFFFF,s_node.sat_id,cur_tuner_idx,&back_saved);
		break;
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
		if(win_tplist_check_change())
			update_data();

		api_stop_timer(&tpturn_timer_id);
		win_signal_close();
		wincom_close_help();
		sys_data_check_channel_groups();
		sys_data_set_cur_satidx((UINT16)cur_tp_sat_idx);
		#ifdef MULTIFEED_SUPPORT
	        multifeed_del_invalid_info();
		#endif
  		wincom_close_subtitle();
		OSD_ClearScreen();
		win_open_submenu_title(submenu,sub_menu_desc->title_id, 0);  //guop
      
		break;
	case EVN_MSG_GOT:
		win_tplist_message_proc(param1,param2);
		break;
	default:
		break;
	}


	return ret;
}
示例#8
0
static PRESULT satlst_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;

	switch(event)
	{
	case EVN_PRE_OPEN:
		win_init_pstring(30);
		win_satlist_check_focusID(1);
		win_satlist_load_sat_select();
		wincom_open_subtitle(pObj,RS_SATELLITE_LIST,0);
		break;
	case EVN_POST_OPEN:
		wincom_open_help_1(pObj,satlist_helpinfo , HELP_CNT);
		break;
	case EVN_PRE_CLOSE:
		win_satlist_save_sat_select();
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
		wincom_close_subtitle();
		wincom_close_help();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		sys_data_check_channel_groups();
		break;
		
	case EVN_MSG_GOT:
		{
 //added by Eric.Ren, 接收control task 的消息,处理kingofsat  更新,2010.7.30
#ifdef KINGOFSAT_SUPPORT
			OBJLIST* ol;
			UINT16 sel;
			S_NODE s_node;
			INT32 kingofsat_tp_num = 0;  //可更新的TP个数
			UINT8 back_saved;
			
			if(param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH)
			{
				if((INT32)param2 < 0)
				{
					win_compopup_smsg_restoreback();

					win_compopup_init(WIN_POPUP_TYPE_SMSG);                        
					win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H);
					win_compopup_set_msg("Downloading error,Try again!", NULL, 0);
					win_compopup_open_ext(&back_saved);			

					osal_task_sleep(2000);
					win_compopup_smsg_restoreback();
					
					break ;
				}
				ol = &satlist_olist;
				sel = OSD_GetObjListCurPoint(ol);
				get_sat_at(sel,VIEW_ALL,&s_node);

				//判断是有可更新的TP 数据
				kingofsat_get_tp_num(&kingofsat_tp_num);
				if(kingofsat_tp_num == 0)
				{
					win_compopup_smsg_restoreback();
					win_compopup_init(WIN_POPUP_TYPE_SMSG);                        
					win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H);
					win_compopup_set_msg("NO TP in downloading data!", NULL, 0);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
					
					break;
				}
				
				kingofsat_parse();		//解析下载数据
				recreate_tp_view(VIEW_SINGLE_SAT, s_node.sat_id);//创建TP view
				kingofsat_update(s_node.sat_id);	//更新数据
				kingofsat_destroy();	//释放资源

				OSD_TrackObject( (POBJECT_HEAD)&g_win_satlist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

				recreate_sat_view(VIEW_ALL, 0); //创建SAT view
			}

#endif
			break;
		}

	default:
		break;		
		
	}

	return ret;
}
示例#9
0
static void win_antcnt_save_setting(void)
{
	SYSTEM_DATA* sys_data;
	MULTISEL* msel;
	UINT32 antenna_connect_type,tuner_lnb_type[2],i,n;
	S_NODE s_node;
	UINT8 back_saved;
	win_popup_choice_t choice;
	
	sys_data = sys_data_get();

	/* Antenna connect */
	msel = antcnt_msels[0];
	antenna_connect_type = msel->nSel;
	
	/* LNB1 */
	msel = antcnt_msels[1];
	tuner_lnb_type[0] = msel->nSel;
		
	/* LNB2 */
	msel = antcnt_msels[2];
	tuner_lnb_type[1] = msel->nSel;

#if 0
	if(sys_data->antenna_connect_type != antenna_connect_type
		&& ( antenna_connect_type == ANTENNA_CONNECT_SINGLE
			|| sys_data->antenna_connect_type == ANTENNA_CONNECT_SINGLE) )
	{
		win_compopup_init(WIN_POPUP_TYPE_OKNO);
		win_compopup_set_msg("This change will delete all channels, continue?",NULL,0);
		choice = win_compopup_open_ext(&back_saved);		
		if(choice != WIN_POP_CHOICE_YES)
			return;
		
		n = get_sat_num(VIEW_ALL);
		recreate_sat_view(VIEW_ALL,0);
		for(i=0;i<n;i++)
		{ 
			get_sat_at(i,VIEW_ALL,&s_node);
			if(s_node.tuner1_valid != 0 || s_node.tuner2_valid!=0)
			{
				s_node.tuner1_valid = s_node.tuner2_valid = 0;
				modify_sat(s_node.sat_id,&s_node);
			} 		
		}
		update_data();

		recreate_prog_view(VIEW_ALL | PROG_TVRADIO_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();
	}
#endif

	sys_data->antenna_connect_type = antenna_connect_type;	
    UINT32 lnb_type,lnb_freq1,lnb_freq2;

    get_lnb_type_setting(get_universal_lnb_index(),&lnb_type,&lnb_freq1,&lnb_freq2);
    for(i=0;i<2;i++)
    {
        if(sys_data->tuner_lnb_type[i] != tuner_lnb_type[i])
        {
            sys_data->tuner_lnb_type[i] = tuner_lnb_type[i];
            sys_data->tuner_lnb_antenna[i].motor_type = LNB_MOTOR_DISEQC12;
            sys_data->tuner_lnb_antenna[i].lnb_type = lnb_type;
            sys_data->tuner_lnb_antenna[i].lnb_low  = lnb_freq1;
            sys_data->tuner_lnb_antenna[i].lnb_high = lnb_freq2;            
        }
    }

	sys_data->tuner_lnb_type[0] = tuner_lnb_type[0];
	sys_data->tuner_lnb_type[1] = tuner_lnb_type[1];	

	set_chchg_local_postion();//lib_nimng_init(antenna_connect_type);

}
示例#10
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;
}
示例#11
0
static PRESULT editchannel_con_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT8	id = OSD_GetObjID(pObj) + sub_menu_desc->list_top;
	UINT8 	back_saved;
	INT16 	i,n,parent_id;
	S_NODE  s_node;
	TIMER_SET_CONTENT* timer;
    SYSTEM_DATA* sys_data;
    
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16) ;
		if(unact == VACT_ENTER)
		{
			if(unact == VACT_ENTER)
			{
				if(id == CHLIST_DELETE_ALL_CHAN_ID)
				{
					//if(win_pwd_open(NULL,0))
					{
						win_compopup_init(WIN_POPUP_TYPE_OKNO);
						win_compopup_set_msg(NULL,NULL,RS_POPUP_WARNING_DELETE_ALL_CHANNEL);
						win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
						ret = win_compopup_open_ext(&back_saved);
						if(ret==WIN_POP_CHOICE_YES)
					 	{
#ifdef NEW_DEMO_FRAME
							si_monitor_off(0xFFFFFFFF);
#endif
							n = get_sat_num(VIEW_ALL);
							
							recreate_prog_view(VIEW_ALL | PROG_TVRADIO_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();	
                            /*turn off all timer*/
                            sys_data = sys_data_get();
                            for(i=0;i<MAX_TIMER_NUM;i++)
                            {
        	                    timer = &sys_data->timer_set.TimerContent[i];
			                    timer->timer_mode = TIMER_MODE_OFF;                                    
                            }
                            
							ret = PROC_LEAVE;

							key_pan_display("noCH", 4);
					 	}
					}
				}
				else
				{
					enter_sub_menu(editchannel_sub_menus,id - 1);
					ret = PROC_LOOP;
				}
			}
		}
	}

	return ret;
}
示例#12
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

}