Пример #1
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	//PRESULT ret = PROC_LEAVE;	
	VACTION unact;
	UINT8 bID,back_saved;
	win_popup_choice_t choice;
	UINT32 chunk_id, default_db_addr, default_db_len;

	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
		       ret = PROC_LEAVE;
			if(bID == BTN_NO_ID)
			{
				break;
			}
			
			//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_saved);
			//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_factory_reset(TRUE);
				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();
				// PRESULT ret = PROC_LEAVE;
				//ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_PALNTSC,FALSE);
			}
		
		}
		break;
	}

	return ret;
}
Пример #2
0
static PRESULT win_volume_bar_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	PROGRESS_BAR* bar;	
	SYSTEM_DATA* sys_data;
	UINT32 vkey;

	bar = (PROGRESS_BAR*)pObj;
	
	sys_data = sys_data_get();	

	switch(event)
	{
	case EVN_PRE_CHANGE:
		break;
	case EVN_POST_CHANGE:
		sys_data->volume = OSD_GetProgressBarPos(bar);
		if(sys_data->volume > 0 && GetMuteState() )
		{
			SetMuteOnOff(TRUE);
			//added by Sharon to resolve mute clear display bug
			restore_mute_bg();
		}
		api_audio_set_volume(sys_data->volume);
		api_stop_timer(&volume_timer);		 
		volume_timer = api_start_timer(VOLUME_TIMER_NAME,VOLUME_TIMER_TIME,volume_timer_func);
		ret = PROC_LOOP;
		break;
	case EVN_UNKNOWNKEY_GOT:
		ap_hk_to_vk(0, param1, &vkey);
		if(vkey == V_KEY_NULL)
		{
			ret = PROC_LOOP;
		}
		break;
	default:
		break;
	}

	return ret;		 
}
Пример #3
0
static PRESULT mpegYT_player_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	SYSTEM_DATA* sys_data;

	sys_data = sys_data_get();
	
	switch (event)
	{
		case EVN_PRE_OPEN:
			MPEGYTBAR_TIMER_TIME = sys_data->osd_set.time_out;
			if(MPEGYTBAR_TIMER_TIME == 0 || MPEGYTBAR_TIMER_TIME>10)
				MPEGYTBAR_TIMER_TIME = 5;
			MPEGYTBAR_TIMER_TIME *= 1000;
			if (!m_mpegYT_player_working)
			{
				entry_youtube = ((yt_player_param*)param2)->ytentry_handle;
				url_youtube = ((yt_player_param*)param2)->url;
				MPEGYT_player_init();
			}
			else
			{
				ret = PROC_LOOP;
			}
			m_mpegYT_player_working = TRUE;
			break;
		case EVN_POST_OPEN:
			mpegYT_timeout_id = api_start_timer(MPEGYTBAR_TIMER_NAME, MPEGYTBAR_TIMER_TIME, mpegYT_timeout_handler);
			break;
		case EVN_POST_DRAW:
			win_mpegYT_player_draw_infor();
			break;
		case EVN_PRE_CLOSE:
			libnet_download_abort(g_strf_cur_dl_rsrc);
			mpg_cmd_stop_proc();
			api_stop_timer(&mpegYT_refresh_id);
			api_stop_timer(&mpegYT_timeout_id);
			m_mpegYT_player_working = FALSE;
			g_from_mpegYTplayer = TRUE;
			s_ytvideo_seektime = 0;
			break;
		case EVN_UNKNOWN_ACTION:
			api_stop_timer(&mpegYT_timeout_id);
			unact = (VACTION)(param1>>16);
      //add on 2011-09-28 for BUG42869
			//if(!b_vdec_support &&  !b_audio_yt_support)
			//	MPEGYTInfo.TotalTime = 0;       
			//else
//				MPEGYTInfo.TotalTime = MPGGetTotalPlayTime() + s_ytvideo_seektime;
				MPEGYTInfo.TotalTime = entry_youtube->info->duration;
			switch (unact)
			{
				case VACT_MUTE:
				{
					SetMuteOnOff(TRUE);
					ret = PROC_LOOP;
					break;
				}
				
				default :
				{
					ret = win_mpegYT_player_key_proc(pObj, (param1 & 0xFFFF), param2);
					if (ret != PROC_LEAVE)
					{
						if( ((param1 & 0xFFFF) != V_KEY_EXIT) && ((param1 & 0xFFFF) != V_KEY_MENU)
							&& ((param1 & 0xFFFF) != V_KEY_PVR_INFO) && ((param1 & 0xFFFF) != V_KEY_LEFT) && ((param1 & 0xFFFF) != V_KEY_RIGHT))
						{
							win_mpegYT_player_draw(TRUE);
						}
					}
					break;
				}
			}
			mpegYT_timeout_id = api_start_timer(MPEGYTBAR_TIMER_NAME, MPEGYTBAR_TIMER_TIME, mpegYT_timeout_handler);
			break;
		case EVN_UNKNOWNKEY_GOT:
			break;
		case EVN_MSG_GOT:
			ret = win_mpegYT_player_message_proc(pObj, param1, param2);
			break;
	}

	return ret;
}
Пример #4
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;
}
Пример #5
0
static PRESULT mpeg_player_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
    PRESULT ret = PROC_PASS;
    VACTION unact;
    SYSTEM_DATA* sys_data;

    sys_data = sys_data_get();

    switch (event)
    {
    case EVN_PRE_OPEN:
        MPEGBAR_TIMER_TIME = sys_data->osd_set.time_out;
        if(MPEGBAR_TIMER_TIME == 0 || MPEGBAR_TIMER_TIME>10)
            MPEGBAR_TIMER_TIME = 5;
        MPEGBAR_TIMER_TIME *= 1000;
        if (!m_mpeg_player_working)
        {
            MPEG_player_init();
        }
        else
        {
            ret = PROC_LOOP;
        }
        m_mpeg_player_working = TRUE;
        break;
    case EVN_POST_OPEN:
        mpeg_timeout_id = api_start_timer(MPEGBAR_TIMER_NAME, MPEGBAR_TIMER_TIME, mpeg_timeout_handler);
        break;
    case EVN_POST_DRAW:
        win_mpeg_player_draw_infor();
        break;
    case EVN_PRE_CLOSE:
        mpg_cmd_stop_proc();
        api_stop_timer(&mpeg_refresh_id);
        api_stop_timer(&mpeg_timeout_id);
        m_mpeg_player_working = FALSE;
        g_from_mpegplayer = TRUE;
        break;
    case EVN_UNKNOWN_ACTION:
        api_stop_timer(&mpeg_timeout_id);
        unact = (VACTION)(param1>>16);
        switch (unact)
        {
        case VACT_MUTE:
        {
            SetMuteOnOff(TRUE);
            ret = PROC_LOOP;
            break;
        }

        default :
        {
            ret = win_mpeg_player_key_proc(pObj, (param1 & 0xFFFF), param2);
            if (ret != PROC_LEAVE)
            {
                if( ((param1 & 0xFFFF) != V_KEY_EXIT) && ((param1 & 0xFFFF) != V_KEY_MENU)
                        && ((param1 & 0xFFFF) != V_KEY_PVR_INFO) && ((param1 & 0xFFFF) != V_KEY_INFOR)&& ((param1 & 0xFFFF) != V_KEY_LEFT) && ((param1 & 0xFFFF) != V_KEY_RIGHT))
                {
                    win_mpeg_player_draw(TRUE);
                }
            }
            break;
        }
        }
        mpeg_timeout_id = api_start_timer(MPEGBAR_TIMER_NAME, MPEGBAR_TIMER_TIME, mpeg_timeout_handler);
        break;
    case EVN_UNKNOWNKEY_GOT:
        break;
    case EVN_MSG_GOT:
        ret = win_mpeg_player_message_proc(pObj, param1, param2);
        break;
    }

    return ret;
}
Пример #6
0
static PRESULT mpvolume_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT16 vol_pos;
	SYSTEM_DATA *pSys;
	PPROGRESS_BAR  mpvol_bar;
	PPROGRESS_BAR  ban_bar;
	UINT32 msg_code; // construct virtual operation

	mpvol_bar = &mpvolume_bar;
	switch(event)
	{
	   	case EVN_PRE_OPEN:
			pSys = sys_data_get();	
			if(pSys->volume > 0 && GetMuteState() )
				SetMuteOnOff(TRUE);
			vol_pos = mp_vol_to_pos(pSys->volume);
			OSD_SetProgressBarValue(mpvol_bar,vol_pos);
			MPVOLUME_TIMER_TIME = pSys->osd_set.time_out;
			if(MPVOLUME_TIMER_TIME == 0 || MPVOLUME_TIMER_TIME>10)
				MPVOLUME_TIMER_TIME = 5;
			MPVOLUME_TIMER_TIME *= 1000;		
			break;
		case EVN_POST_OPEN:
			mpvolume_timer = api_start_timer("mpvol",MPVOLUME_TIMER_TIME,mpvolume_timer_func);
			break;
		case EVN_POST_CLOSE:
			api_stop_timer(&mpvolume_timer);		
			break;
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);
			switch(unact)
			{
			case VACT_VOL_UP:
			case VACT_VOL_DOWN:
				pSys = sys_data_get();	
				vol_pos = mp_vol_to_pos(pSys->volume);
				if(unact == VACT_VOL_DOWN)
					vol_pos--;
				else if(unact == VACT_VOL_UP)
					vol_pos++;
				OSD_SetProgressBarValue(mpvol_bar,vol_pos);
				pSys->volume = mp_pos_to_vol(OSD_GetProgressBarPos(mpvol_bar));
				if(pSys->volume > 0 && GetMuteState() )
					SetMuteOnOff(TRUE);
				api_audio_set_volume(pSys->volume);
				OSD_DrawObject((POBJECT_HEAD)mpvol_bar,C_UPDATE_ALL);	
				api_stop_timer(&mpvolume_timer);		 
				mpvolume_timer = api_start_timer("mpvol",MPVOLUME_TIMER_TIME,mpvolume_timer_func);
				break;
			case VACT_BALANCE_L:
			case VACT_BALANCE_R:
				break;
			default:
				break;
			}
			break;
		default:
			break;
	}
		
	return ret;
}
Пример #7
0
static PRESULT win_volume_bar_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	PROGRESS_BAR* bar;	
	SYSTEM_DATA* sys_data;
	UINT32 vkey;
	static int  m=0;
	VACTION unact;
	
	bar = (PROGRESS_BAR*)pObj;
	
	sys_data = sys_data_get();	

	switch(event)
	{
	case EVN_PRE_CHANGE:
		unact = (VACTION)(param1>>16);
		if(unact==VACT_DECREASE)
			volume_flag = 0;
		else if(unact==VACT_INCREASE)
			volume_flag = 1;
		if(key_cnt==1)
			i=0;
		m=sys_data->volume = OSD_GetProgressBarPos(bar);
		if(sys_data->volume > 0 && GetMuteState() )
		{
			SetMuteOnOff(TRUE);
			restore_mute_bg();
		}
		if(key_cnt > 1)
		{
			 if(volume_flag)
			 {
			   	sys_data->volume = sys_data->volume +2*(++i);
			 }
			 else 
			 {
			       
			   	m = sys_data->volume -2*(++i);
				if(m<=0)
				{
					m=0;
				}
				sys_data->volume = m;
			 }
			 
		}
		if(sys_data->volume>=100)
		{
			sys_data->volume=100;
		}
		api_audio_set_volume(sys_data->volume);
		OSD_SetProgressBarPos(bar, sys_data->volume);
		break;
	case EVN_POST_CHANGE:
		api_stop_timer(&volume_timer);		 
		volume_timer = api_start_timer(VOLUME_TIMER_NAME,VOLUME_TIMER_TIME,volume_timer_func);
		ret = PROC_LOOP;
		break;
	case EVN_UNKNOWNKEY_GOT:
		ap_hk_to_vk(0, param1, &vkey);
		if(vkey == V_KEY_NULL)
		{
			ret = PROC_LOOP;
		}
		break;
	default:
		break;
	}

	return ret;		 
}
Пример #8
0
static void reset_factory_setting()
{
	UINT8 bID, back_saved;
	win_popup_choice_t choice;
	UINT32 chunk_id, default_db_addr, default_db_len;
	
	CONTAINER *factory_msg_con;
	factory_msg_con = &fac_msg_con;
	TEXT_FIELD *factory_msg_txt;
	factory_msg_txt = &factoryset_msg;

	MULTISEL *factory_multisel;
	factory_multisel = &factory_state;
	api_stop_play(1);
	epg_reset();
	
	OSD_SetTextFieldContent(factory_msg_txt, STRING_ID, (UINT32)RS_FACTORY_RESTORING);
	OSD_DrawObject((POBJECT_HEAD)factory_msg_txt, C_UPDATE_ALL);
	OSD_DrawObject((POBJECT_HEAD)factory_msg_con, C_UPDATE_ALL);
	//老版本弹出恢复出厂信息
	//win_compopup_init(WIN_POPUP_TYPE_SMSG);
	//win_compopup_set_msg(NULL, NULL, RS_FACTORY_RESTORING);
	//win_compopup_open_ext(&back_saved);	
	
	sys_data_factroy_init();
	sys_data_set_factory_reset(TRUE);
	sys_data_set_cur_chan_mode(TV_CHAN);
	sys_data_save(TRUE);
	sys_data_load();

	chunk_id = STB_CHUNK_DEFAULT_DB_ID;
	api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
	set_default_value(DEFAULT_ALL_PROG, default_db_addr + 16);
    
	reset_search_param(); /*reset the local static param in full_band_search*/
	if (GetMuteState())
		SetMuteOnOff(FALSE);
	if (GetPauseState())
		SetPauseOnOff(FALSE);
#if(defined(MIS_AD) || defined(MIS_AD_NEW))
	MIS_SetOSDAlpha(0x00);
#endif
#ifdef MULTI_CAS
#if (CAS_TYPE == CAS_DVN)
	ap_cas_set_messageID(0);
	cas_flags_reset();
#elif(CAS_TYPE==CAS_IRDETO)
	setFirstIn(1);
#elif (CAS_TYPE == CAS_CDCA)
	api_mcas_stop_transponder();
#endif				
#endif
	setMtxt(0);
	//win_compopup_smsg_restoreback();消除完成恢复出厂设置后出现的小黑框现象---#JingJin
	
	OSD_SetTextFieldContent(factory_msg_txt, STRING_ID, (UINT32)RS_FACTORY_DONE);
	OSD_DrawObject((POBJECT_HEAD)factory_msg_txt, C_UPDATE_ALL);
	
	OSD_SetTextFieldContent(factory_msg_txt, STRING_ID, (UINT32)RS_FACTORY_USER_SURE);

	OSD_SetMultiselSel(factory_multisel, 0);
	OSD_TrackObject((POBJECT_HEAD)factory_multisel, C_DRAW_TYPE_HIGHLIGHT);
	
	//老版本弹出恢复出厂信息
	//win_compopup_init(WIN_POPUP_TYPE_SMSG);
	//win_compopup_set_msg(NULL, NULL, RS_FACTORY_DONE);
	//win_compopup_open_ext(&back_saved);	
}
Пример #9
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	//PRESULT ret = PROC_LEAVE;	
	VACTION unact;
	UINT8 bID,back_saved;
	win_popup_choice_t choice;
	UINT32 chunk_id, default_db_addr, default_db_len;

	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
		       ret = PROC_LEAVE;
			if(bID == BTN_NO_ID)
			{
				break;
			}
      
			
			//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_saved);
			//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_chunk_add_len(chunk_id, &default_db_addr, &default_db_len);
				//here may reset CI+ Service Shunning parameter, 20100803
				#ifdef CI_PLUS_SERVICESHUNNING
				ci_service_shunning_reset();
				#endif
				set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

				sys_data_factroy_init(); 
				//sys_data_set_factory_reset(TRUE);
				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();
                power_off_process(); //初始化后重新启动xiaosaifei
				power_on_process();
				// PRESULT ret = PROC_LEAVE;
				//ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_PALNTSC,FALSE);
			}

    #ifdef SHOW_WELCOME_SCREEN				
			POBJECT_HEAD submenu;
			extern void set_win_lang_as_welcome(BOOL iswelcome);
			set_win_lang_as_welcome(TRUE);
			submenu = (POBJECT_HEAD) & win_lan_con;
			if (OSD_ObjOpen(submenu, 0xFFFFFFFF) != PROC_LEAVE)
			{
				menu_stack_pop();
				menu_stack_push(submenu);
				ret = PROC_LOOP;
			}
							
    #endif
		
		
		}
		break;
	}

	return ret;
}