コード例 #1
0
ファイル: win_factory_set.c プロジェクト: alkap007/ali3606
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;
}
コード例 #2
0
ファイル: win_multi_delete.c プロジェクト: alkap007/ali3606
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;
}
コード例 #3
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;
}
コード例 #4
0
ファイル: power.c プロジェクト: Janesak1977/ali3602
void power_off_process(void)
{
	struct  YCbCrColor bgcolor;
	extern struct rfm_device*   g_rfm_dev;
	extern struct scart_device* g_scart_dev;

#ifdef DVR_PVR_SUPPORT
	api_pvr_clear_up_all();
#endif	

	// SE: Mute before scart power off to avoid noise
	api_audio_set_mute(TRUE);

#if defined(HW_SS830C)||defined(HW_SS830C2)
	//Wirte GPIO#5 to high to avoid noise (used on SS830C)
	HAL_GPIO_BIT_DIR_SET(5, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(5, 1);
#endif

	api_Scart_TVSAT_Switch(0);
	api_Scart_Power_OnOff(0);
	api_Scart_RGB_OnOff(0);/*CVBS mode*/
#ifdef VDAC_USE_SVIDEO_TYPE
	api_Svideo_OnOff(0);
#endif
	api_Scart_OutPut_Switch(0);
	SetLNBShortDetect(0);
	Set12VShortDetect(0);
	api_LNB_power(0);
#if(SYS_12V_SWITCH == SYS_FUNC_ON)
	 api_diseqc_set_12v(g_nim_dev, 0);
#endif    

#ifdef USB_MP_SUPPORT
	if(system_state == SYS_STATE_USB_MP)
	{
		ap_udisk_close();
	}
#endif

#ifndef NEW_DEMO_FRAME
	if(hde_get_mode() != VIEW_MODE_MULTI)
	    UIChChgStopProg(TRUE);    
#endif

#if	(TTX_ON == 1)
	ttx_enable(FALSE);
#endif
#if (SUBTITLE_ON == 1)
	subt_enable(FALSE);
#endif
	sie_close();

	OSD_ShowOnOff(OSDDRV_OFF);
#ifdef NEW_DEMO_FRAME
	sim_close_monitor(0);
#else
	si_monitor_off(0xFFFFFFFF);
#endif
	stop_tdt();
	epg_off();
	vpo_win_onoff(g_vpo_dev, FALSE);
#ifdef DUAL_VIDEO_OUTPUT
	if(g_sd_vpo_dev != NULL)
		vpo_win_onoff(g_sd_vpo_dev,TRUE);
#endif
	dm_set_onoff(0);

	bgcolor.uY = 16;
	bgcolor.uCb = 128;
	bgcolor.uCr = 128;		
	vpo_ioctl(g_vpo_dev,VPO_IO_SET_BG_COLOR,(UINT32)&bgcolor);

	//close drivers	
	dmx_stop( g_dmx_dev);
	dmx_close( g_dmx_dev);
    if (g_dmx_dev2)
    {
    	dmx_stop(g_dmx_dev2);
	    dmx_close(g_dmx_dev2);
    }
	deca_stop(g_deca_dev,0,ADEC_STOP_IMM);
	deca_close(g_deca_dev);
	vdec_close(g_decv_dev);

// Power HDMI phy at standby mode.
#ifdef HDTV_SUPPORT
	struct hdmi_device *hdmi_dev;
	hdmi_dev = (struct hdmi_device *)dev_get_by_id(HLD_DEV_TYPE_HDMI, 0);
	if (hdmi_dev != NULL)
	{
		if (SUCCESS != hdmi_dev->close(hdmi_dev))
		{
			PRINTF("hdmi_close failed!!\n");
			ASSERT(0);
		}
	}
#endif
	
	vpo_close(g_vpo_dev);
#ifdef DUAL_VIDEO_OUTPUT
	if(RET_SUCCESS!=vpo_close((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 1)))
		ASSERT(0);
#endif
    snd_close(g_snd_dev);
	nim_close(g_nim_dev);
	if(g_nim_dev2)
		nim_close(g_nim_dev2);
	if(g_rfm_dev)
		rfm_close(g_rfm_dev);
#if (SYS_MAIN_BOARD == BOARD_M3329E_DEMO01V01 || SYS_MAIN_BOARD == BOARD_DB_M3602_02V01 || SYS_MAIN_BOARD == BOARD_DB_M3602_04V01)
	if(g_scart_dev)
		scart_close(g_scart_dev);
#endif
	led_display_flag = 0;
#if (SYS_MAIN_BOARD == BOARD_S3602_DEMO)
	// Power off
	HAL_GPIO_BIT_DIR_SET(25, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(25, 0);
#elif (SYS_MAIN_BOARD == BOARD_DB_M3602_02V01 || SYS_MAIN_BOARD == BOARD_DB_M3602_04V01)
	// Power off
/*alfred.wu 不允许ali的power off*/	
/*	
	HAL_GPIO_BIT_DIR_SET(61, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(61, 1);
	
	// Tuner LNB power off
	HAL_GPIO_BIT_DIR_SET(73, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(73, 1);
*//*end*/
#endif
}
コード例 #5
0
ファイル: ipanel_av.c プロジェクト: jinfeng-geeya/3202C
void ipanel_porting_av_stop(void)
{
	RET_CODE ret_code;

	if(video_status == 1)
	{
		if(audioPid)
		{
			ret_code = deca_stop(g_deca_dev,0,ADEC_STOP_IMM);
			if (ret_code != RET_SUCCESS)
			{
				dprintf("[ipanel_porting_av_stop]  cc2: deca_stop() fail..\n");
			}	
			else
            		{
				dprintf("[ipanel_porting_av_stop]  cc2: deca_stop() ok..\n");
				audioPid = 0;
			}
		}
		
		if(videoPid)
		{
			ret_code = vdec_stop(g_decv_dev,TRUE,TRUE);

			if (ret_code == RET_BUSY)
			{
				ret_code = vdec_stop(g_decv_dev,TRUE,TRUE);
			}
			if (ret_code != RET_SUCCESS)
			{
				dprintf("[ipanel_porting_av_stop]  cc2: Vdec_Stop() fail \n");
            		}		
			else
            		{
				dprintf("[ipanel_porting_av_stop]  cc2: Vdec_Stop() ok \n");
				videoPid = 0;
			}
		}

		pcrPid = 0;
		ret_code = dmx_io_control(g_dmx_dev,IO_STREAM_DISABLE,(UINT32)&io_parameter);
		if (ret_code != RET_SUCCESS)
        	{
			dprintf("[ipanel_porting_av_stop]  cc2: Dmx disable stream fail \n");
			return;
		}
		else
		{
			dprintf("[ipanel_porting_av_stop]  cc2: Dmx disable stream OK \n");
        	}		
		ret_code = dmx_io_control(g_dmx_dev,IO_DELETE_AV_STREAM,(UINT32)&io_parameter);
		if(ret_code != RET_SUCCESS)
        	{
			dprintf("[ipanel_porting_av_stop] dmx delete stream fail..\n");
		}
		else
		{
			dprintf("[ipanel_porting_av_stop] dmx delete stream ok..\n");
        	}

		video_status = 0;

		if(  progpos!=0xffff)
		{
			api_mcas_stop_transponder();
			api_mcas_stop_service();
			si_monitor_off(progpos);
			progpos=0xffff;
			
		}

	}
}