Exemplo n.º 1
0
static PRESULT checkdisk_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT32 i;
	BOOL subt_flag;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	static UINT8 preval;
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		preval = sys_data_get_checkdisk();
		wincom_open_title((POBJECT_HEAD)&g_win_checkdisk,RS_DVR_CHECKDISK, 0);
		win_checkdisk_set_string(preval);
		break;
	
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
		if(preval != sys_data_get_checkdisk())
		{
			sys_data_save(1);
		}
		break;

	case EVN_POST_CLOSE:
		break;
	}
	return ret;
}
Exemplo n.º 2
0
static PRESULT lan_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT32 i;
	UINT8	unact;
	BOOL subt_popup;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	SYSTEM_DATA* p_sys_data;
	UINT8 lang_code[8];
    
	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_subtitle((POBJECT_HEAD)&win_lan_con,RS_SYSTEM_LANGUAGE, 0);
		p_sys_data=sys_data_get();
		win_lan_set_menu_lan_string(p_sys_data->lang.OSD_lang);
		win_lan_set_1st_audio_lan_string(p_sys_data->lang.Audio_lang_1);
		win_lan_set_2nd_audio_lan_string(p_sys_data->lang.Audio_lang_2);
		win_lan_set_subtitle_lan_string(p_sys_data->lang.sub_lang);
		win_lan_set_teletext_lan_string(p_sys_data->lang.ttx_lang);
#ifdef SUPPORT_POP_SUBT
		subt_popup = TRUE;
#else
		subt_popup = FALSE;
#endif
		if(subt_popup)
		{
			remove_menu_item(&win_lan_con, (POBJECT_HEAD)lan_items[3], (CON_H + CON_GAP));			
		}
		break;
	
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
#ifdef EPG_MULTI_LANG		
		/*set epg language*/
		p_sys_data = sys_data_get();
		STRCPY(lang_code,stream_iso_639lang_abbr[p_sys_data->lang.OSD_lang]);
		epg_set_lang_code(lang_code);
#endif
		
#ifndef NEW_DEMO_FRAME
		UIChChgApplyAudLanguage();
#endif
		sys_data_save(1);
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		
		break;

	case EVN_POST_CLOSE:
              TTXEng_set_g0_set();
  		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		break;
	}
	return ret;
}
Exemplo n.º 3
0
void power_on_process(void)
{
	date_time dt;	//ctchen
	SYSTEM_DATA* sys_data;
	struct sf_panel_attr panel_attr;
	
	sys_data = sys_data_get();

	pan_io_control(g_pan_dev, PAN_DRIVER_GET_ATTRIBUTE, &panel_attr);

	if (panel_attr.type == SF_PANEL_TYPE_LED)
	{
		sf_panel_display_string("----", 4, TRUE);
	}
	else
	{
		sf_panel_display_string(" REBOOT ", 8, TRUE);
	}

	pan_close(g_pan_dev);

	 if(sys_data->local_time.buseGMT)
	    get_STC_time(&sys_data->sys_dt);
	else
        get_local_time(&sys_data->sys_dt);	//ctchen

    sys_data->bstandmode = 0;
	sys_data_save(1);

    sys_watchdog_reboot();    
}
Exemplo n.º 4
0
static PRESULT antcnt_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
       UINT8	focusID = OSD_GetFocusID( (POBJECT_HEAD) &g_win_mainmenu);
	switch(event)
	{
	case EVN_PRE_OPEN:
		win_antcnt_load_setting();
	//	wincom_open_title(pObj,RS_ANTENNA_CONECTION,0);
		//api_set_preview_vpo_color(TRUE);
		break;
	case EVN_POST_OPEN:
		wincom_open_subtitle(pObj,RS_ANTENNA_CONECTION,0);
		break;
	case EVN_PRE_CLOSE:
		win_antcnt_save_setting();
		sys_data_save(1);
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		break;
	}

	return ret;
}
Exemplo n.º 5
0
static PRESULT sto_set_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT32 i;
	BOOL subt_flag;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
    char new_volume[16];
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_subtitle((POBJECT_HEAD)&g_win_sto_setting,RS_STORAGE_SETTING, 0);
		m_sd_ide_statue = sys_data_get_sd_ide_statue();
		win_sto_set_sd_ide_set_string(m_sd_ide_statue,&sto_set_item_txtset1);
		OSD_SetContainerFocus(&g_win_sto_setting, 1);
		break;
	
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
        *((UINT32 *)param2) &= ~C_CLOSE_CLRBACK_FLG;
		win_pvr_sd_ide_save();
		sys_data_save(1);
		break;

	case EVN_POST_CLOSE:
		break;
    case EVN_UNKNOWN_ACTION:		
        break;
	}
	return ret;
}
Exemplo n.º 6
0
static PRESULT mlimit_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	SYSTEM_DATA * sys_data = sys_data_get();

	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_subtitle(pObj,RS_DISEQC12_LIMIT_SETUP,0);
		
		motor_move_state = 0;
/* The multi-select option should remember previous setting(VACT_SET_LIMIT valid)*/		
		LIMIT_OPT = sys_data->motor_lmt;
		
		OSD_SetContainerFocus(&g_win_motor_limitsetup, LIMITOPT_ID);
/*	remove "Go to reference inactive when disable limit selected" 	
		OSD_SetAttr(&mlimit_txtbtn_gotoref, (LIMIT_OPT==0)? C_ATTR_INACTIVE: C_ATTR_ACTIVE);
*/
		break;
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		sys_data_save(1);
		break;
	case EVN_POST_DRAW:
		win_mlimit_draw_info(motor_move_state);
		break;
	}

	return ret;
}
Exemplo n.º 7
0
static PRESULT win_volume_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	SYSTEM_DATA* sys_data;
	PROGRESS_BAR* bar;
	char timestr[50];

	bar = &vol_bar;

	sys_data = sys_data_get();	

	switch(event)
	{
	case EVN_PRE_OPEN:
        win_volume_switch_clrstyle();        
        api_inc_wnd_count();
		VOLUME_TIMER_TIME = sys_data->osd_set.time_out;
		if(VOLUME_TIMER_TIME == 0 || VOLUME_TIMER_TIME>10)
			VOLUME_TIMER_TIME = 5;
		VOLUME_TIMER_TIME *= 1000;		
		OSD_SetProgressBarPos(bar, sys_data->volume);
		sprintf(timestr,"vol  %d",sys_data->volume);
		OSD_SetTextFieldContent(&vol_Proc_txt, STRING_ANSI,timestr);
		break;
	case EVN_POST_OPEN:
		volume_timer = api_start_timer(VOLUME_TIMER_NAME,VOLUME_TIMER_TIME,volume_timer_func);
		break;
	case EVN_UNKNOWNKEY_GOT:
		ap_send_msg(CTRL_MSG_SUBTYPE_KEY, param1,FALSE);
		ret = PROC_LEAVE;
		break;
	case EVN_MSG_GOT:
		if(param1 ==  CTRL_MSG_SUBTYPE_CMD_EXIT)
		{
			ret = PROC_LEAVE;
		}
#ifdef USB_MP_SUPPORT
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_VIDEO_OVER)
		{
			ret = PROC_LEAVE;
			ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_VIDEO_OVER,0,TRUE);
		}
#endif
		break;
	case EVN_PRE_CLOSE:
		break;
	case EVN_POST_CLOSE:
		api_stop_timer(&volume_timer);		
        sys_data_save(1);
        api_dec_wnd_count();
		key_cnt=0;
		i=0;
		break;
	default:
		;
	}


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

	switch(event)
	{
		case EVN_PRE_OPEN:
			weathercitylst_load_list();
			wincom_open_subtitle(pObj,RS_WEATHER_CITY_LIST,0);
			break;
		case EVN_POST_OPEN:
			wincom_open_help(pObj,weathercitylist_helpinfo , HELP_CNT);
			break;
		case EVN_PRE_CLOSE:
			sys_data_save(1);
			break;
		case EVN_POST_CLOSE:
			if(weath!=-1||weath!=0)
			libnet_download_abort((unsigned long)weath);
			weath=0;
	  		wincom_close_subtitle();
			wincom_close_help();
			break;
		case EVN_MSG_GOT:		
			ret = weather_msg_proc(param1,param2);
			break;
	}

	return ret;
}
Exemplo n.º 9
0
static PRESULT ad_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
    PRESULT ret = PROC_PASS;
    CONTAINER* root = (CONTAINER*) pObj;

    switch(event)
    {
    case EVN_PRE_OPEN:
#ifdef EXIT_KEY_EXIT_ALL_MENU
        exit_key_flag =  FALSE;
#endif
#ifdef PREVIEW_SUBMENU  //-a by wangyang 
        {

            POBJECT_HEAD focusObj=OSD_GetFocusObject(pObj);

            if(param2==MENU_OPEN_TYPE_OTHER)
            {
                ad_menu_sels[focusObj->bID-1]->style.bHLIdx=SEL_SH_IDX;
                ad_menu_txts[focusObj->bID-1]->style.bHLIdx=TXT_SH_IDX;
            }
            else
            {
                ad_menu_sels[focusObj->bID-1]->style.bHLIdx=SEL_HL_IDX;
                ad_menu_txts[focusObj->bID-1]->style.bHLIdx=TXT_HL_IDX;
            }

        }
#endif
        win_ad_load_setting();
        wincom_open_subtitle(pObj, /*RS_AUDIO_DESCRIPTION_SETTING*/RS_AUDIO_DESCRIPTION, 0);
        break;
    case EVN_POST_OPEN:
        wincom_open_commen_help(pObj);//-a by wangyang
        break;
    case EVN_PRE_CLOSE:
        sys_data_save(1);
        *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; /* Make OSD not flickering */
        break;
    case EVN_POST_CLOSE:
        wincom_close_subtitle();
        OSD_ClearScreen();
#ifdef EXIT_KEY_EXIT_ALL_MENU
        if( exit_key_flag == TRUE)
        {
            exit_key_flag =FALSE;
            mm_leave_all_menu();
        }
#endif
        //OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
        break;
    case EVN_MSG_GOT:
        break;
    default:
        break;
    }

    return ret;
}
Exemplo n.º 10
0
void sys_data_set_advdata(ad_sys_data *pData)
{
	if(MEMCMP(&system_config.ad_data, pData, sizeof(ad_sys_data)))
	{
		MEMCPY(&system_config.ad_data, pData, sizeof(ad_sys_data));
		sys_data_save(1);
	}
}
Exemplo n.º 11
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;
}
Exemplo n.º 12
0
static PRESULT par_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT32 i;
	UINT8	unact;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	SYSTEM_DATA* p_sys_data;

	static UINT32 default_key_exit[] = 
	{
		V_KEY_EXIT,V_KEY_MENU,V_KEY_LEFT,V_KEY_UP,V_KEY_DOWN
	};
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		
		if(win_pwd_open(default_key_exit,ARRAY_SIZE(default_key_exit))==FALSE)
		{
			return PROC_LEAVE;
		}
		wincom_open_subtitle((POBJECT_HEAD)&win_parental_con,RS_SYSTME_PARENTAL_LOCK, 0);
		OSD_ChangeFocus((POBJECT_HEAD)&win_parental_con,MENU_PARENTAL_MENU_LOCK,0);
		p_sys_data=sys_data_get();
		win_par_set_menu_lock_string(p_sys_data->menu_lock);
		win_par_set_channel_lock_string(p_sys_data->channel_lock);
		win_par_switch_confirm(FALSE);
		g_PL_Input_Bit_Number=0;
		g_PL_Input_Status=FALSE;
		win_pl_password_value[0]=0;
		win_pl_password_value[1]=0;
		win_pl_set_password_str(0);
		win_pl_set_password_str(1);
		break;
	
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
		sys_data_save(1);
        *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;

	case EVN_POST_CLOSE:
  		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		break;
	}
	return ret;
}
Exemplo n.º 13
0
static PRESULT sp_win_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	VACTION msg_got;
	UINT8 bFocusID=OSD_GetContainerFocus((PCONTAINER)&g_win_spielercam);
	
	switch(event)
	{
		case EVN_PRE_OPEN:
			//wincom_close_help();
			nc_setting_init();

			//OSD_SetID(&sp_item_con2,2,2,2,7,3);
			OSD_SetID(&sp_item_con7,7,7,7,6,6);
			OSD_SetContainerFocus(&g_win_spielercam,7);
			if(CccamNewcamdData.spidercam_code_active!=0&&CccamNewcamdData.spidercam_code_active!=1)
			CccamNewcamdData.spidercam_code_active=0;
			sp_item_sel_active(CccamNewcamdData.spidercam_code_active, 0,TRUE);
			break;
		case EVN_POST_OPEN:
			spidercam_title_display();
			break;
		case EVN_PRE_CLOSE:
			nc_save_serinfo(0);

			sys_data_save(1);
	       	*((UINT32 *)param2) &= ~C_CLOSE_CLRBACK_FLG;

			break;
		case EVN_POST_CLOSE:
			OSD_ClearObject( (POBJECT_HEAD)&g_win_spielercam, C_UPDATE_ALL);
			//wincom_close_help();
			//OSD_TrackObject((POBJECT_HEAD)&g_win_mainmenu,C_UPDATE_ALL);
			break;

		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);
			break;
		case EVN_ITEM_POST_CHANGE:
			break;
		case EVN_MSG_GOT:
			msg_got = (VACTION)(param1>>16);
			//soc_printf("param1:0x%x vaction is 0x%x, 0x%x\n",param1,msg_got,VACT_CURSOR_LEFT);
			
			break;
	}	

	return ret;
}
Exemplo n.º 14
0
static PRESULT av_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;

	switch(event)
	{
		case EVN_PRE_OPEN:
			wincom_open_title((POBJECT_HEAD)&win_av_con,RS_SYSTEM_TV_SYSTEM, 0);
			win_av_load_setting();
			win_av_set_vcrloop_action(FALSE);
			win_av_init_items();

#ifdef SCART_RGB_UNSUPPORT
			remove_menu_item(&win_av_con, (OBJECT_HEAD *)&av_item_con3, CON_H + CON_GAP);
#endif

#ifdef HDMI_CERTIFICATION_UI
			remove_menu_item(&win_av_con, (OBJECT_HEAD *)&av_item_con3, CON_H + CON_GAP);
			remove_menu_item(&win_av_con, (OBJECT_HEAD *)&av_item_con5, CON_H + CON_GAP);
			remove_menu_item(&win_av_con, (OBJECT_HEAD *)&av_item_con6, CON_H + CON_GAP);
#else
#ifdef NEW_DEMO_FRAME
			remove_menu_item(&win_av_con, (OBJECT_HEAD *)&av_item_con5, CON_H + CON_GAP);
			remove_menu_item(&win_av_con, (OBJECT_HEAD *)&av_item_con6, CON_H + CON_GAP);
			remove_menu_item(&win_av_con, (OBJECT_HEAD *)&av_item_con7, CON_H + CON_GAP);
#endif
#endif
			break;

		case EVN_PRE_CLOSE:
			sys_data_save(1);
			/* Make OSD not flickering */
			*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
			break;
		
		case EVN_MSG_GOT:
			if(param1 ==  CTRL_MSG_SUBTYPE_CMD_TVSAT_SWITCH)
			{
				win_av_load_tv_mode_setting(TRUE);
				ret = PROC_LOOP;
			}
			break;
		
		default:
			break;
	}

	return ret;	
}
Exemplo n.º 15
0
static PRESULT av_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
    	POBJECT_HEAD submenu;

	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_subtitle((POBJECT_HEAD)&win_av_con,RS_SYSTEM_TV_SYSTEM, 0);
		win_av_load_setting();
		win_av_set_vcrloop_action(FALSE);
		win_av_init_items();
#ifdef NEW_DEMO_FRAME
		remove_menu_item((POBJECT_HEAD)&win_av_con, (OBJECT_HEAD *)&av_item_con5, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&win_av_con, (OBJECT_HEAD *)&av_item_con6, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&win_av_con, (OBJECT_HEAD *)&av_item_con7, CON_H + CON_GAP);
#endif
		break;
	case EVN_POST_OPEN:
		  wincom_open_commen_help(pObj);
		wincom_open_help(pObj,0,0);
		break;
	case EVN_PRE_CLOSE:
		sys_data_save(1);
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
		wincom_close_subtitle();
		OSD_ClearScreen();
		if((sys_data_get_sate_group_num(sys_data_get_cur_chan_mode())==0))
		OSD_DrawObject((POBJECT_HEAD)&g_win_mainmenu,C_UPDATE_ALL);

		win_open_submenu_title(submenu,sub_menu_desc->title_id, 0);  //guop
		break;

    case EVN_MSG_GOT:
        if(param1 ==  CTRL_MSG_SUBTYPE_CMD_TVSAT_SWITCH)
		{
            win_av_load_tv_mode_setting(TRUE);
			ret = PROC_LOOP;
		}
        break;
	default:
		break;
	}

	return ret;	
}
Exemplo n.º 16
0
static PRESULT jumpstep_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT32 i;
	BOOL subt_flag;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	static UINT8 preval;
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		preval = sys_data_get_jumpstep();
		wincom_open_title((POBJECT_HEAD)&g_win_jumpstep,RS_DVR_JUMP, 0);
		win_jumpstep_set_string(preval);
		break;
	
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
        *((UINT32 *)param2) &= ~C_CLOSE_CLRBACK_FLG;
		if(preval != sys_data_get_jumpstep())
		{
			sys_data_save(1);
		}
		break;

	case EVN_POST_CLOSE:
		break;
	case EVN_MSG_GOT:
#ifdef DISK_MANAGER_SUPPORT
		if (param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
		{
			// if disk used by PVR detached, exit this menu
			extern pvr_play_rec_t pvr_info;
			if (!pvr_info.hdd_valid)
			{
				ret = PROC_LEAVE;
			}
		}
#endif
		break;
	default:
		break;
	}
	return ret;
}
Exemplo n.º 17
0
static LOCAL_CFG_ERR_CODE localset_cfg_save(void)
{
	IP_LOC_CFG last_local_cfg;

	/* check address validity */
	if (net_local_cfg.dhcp_on == 0)
	{
		if ((ntohl(net_local_cfg.ip_addr) & 0xFF000000) == 0)
			return LOCAL_CFG_ERR_IP;
		
		if ((ntohl(net_local_cfg.subnet_mask) & 0xFF000000) == 0)
			return LOCAL_CFG_ERR_SUBNET;

		if (ntohl(net_local_cfg.ip_addr & (~net_local_cfg.subnet_mask)) == 0)
			return LOCAL_CFG_ERR_IP_SUBNET;

		if ((ntohl(net_local_cfg.gateway) & 0xFF000000) == 0)
			return LOCAL_CFG_ERR_GATEWAY;
		
		if ((ntohl(net_local_cfg.dns) & 0xFF000000) == 0)
			return LOCAL_CFG_ERR_DNS_PREFER;
		
		if ((ntohl(net_local_cfg.dns2) & 0xFF000000) == 0)
			return LOCAL_CFG_ERR_DNS_ALTER;
	}
	
	get_local_ip_cfg(&last_local_cfg);
    if ((last_local_cfg.dhcp_on == 0) && (net_local_cfg.dhcp_on == 1))
    {            
        libc_printf("set DHCP on!\n");
        libnet_dhcp_on();
    }
    else if ((last_local_cfg.dhcp_on == 1) && (net_local_cfg.dhcp_on == 0))
    {            
        libc_printf("set DHCP off!\n");
        libnet_dhcp_off();            
    }

    if (net_local_cfg.dhcp_on == 0)
    {
        libc_printf("set local IP\n");
        libnet_set_ipconfig(&net_local_cfg);
    }
	set_local_ip_cfg(&net_local_cfg);
    sys_data_save(1);
//	libc_printf("save dhcp: %d\n", net_local_cfg.dhcp_on);
	return LOCAL_CFG_ERR_NONE;
}
Exemplo n.º 18
0
static PRESULT win_main_freq_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	SYSTEM_DATA *pSysData = NULL;

	pSysData = sys_data_get();

	switch (event)
	{
		case EVN_PRE_OPEN:
			#if(defined(MIS_AD) || defined(MIS_AD_NEW))
            #else
			main_freq_con_item1.head.bUpID = 3;
			main_freq_con_item3.head.bDownID = 1;
			main_freq_con_item4.head.bAttr =  C_ATTR_HIDDEN;
			#endif
			win_mainFeq_load_data();
			wincom_open_title_ext(RS_CENTER_FREQ_MANAGEMENT, IM_TITLE_ICON_SYSTEM);
			wincom_open_help(win_main_freq_help, 4);
			dvbc_quickscan_set_def_val();
			dm_set_onoff(0);
			break;
		case EVN_POST_OPEN:
			//win_qs_update_param(1);
			//win_signal_open(pObj);
			break;
		case EVN_PRE_CLOSE:
			*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
			break;
		case EVN_POST_CLOSE:
			dm_set_onoff(1);
			//win_signal_close();
			win_qs_update_param(1);
			win_mainFeq_save_data();
			sys_data_save(1);
			break;
		case EVN_MSG_GOT:
			ret = main_req_message_proc(param1, param2);
			break;

	}

	return ret;
}
Exemplo n.º 19
0
static PRESULT av_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;

	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_subtitle((POBJECT_HEAD)&win_av_con,RS_SYSTEM_TV_SYSTEM, 0);
		win_av_load_setting();
		win_av_set_vcrloop_action(FALSE);
		win_av_init_items();
#ifdef NEW_DEMO_FRAME
		remove_menu_item((POBJECT_HEAD)&win_av_con, (OBJECT_HEAD *)&av_item_con5, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&win_av_con, (OBJECT_HEAD *)&av_item_con6, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&win_av_con, (OBJECT_HEAD *)&av_item_con7, CON_H + CON_GAP);
#endif
		break;
	case EVN_PRE_CLOSE:
		sys_data_save(1);
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
#ifndef _BUILD_OTA_E_
			wincom_close_subtitle();
			OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
#endif
		break;

    case EVN_MSG_GOT:
        if(param1 ==  CTRL_MSG_SUBTYPE_CMD_TVSAT_SWITCH)
		{
            win_av_load_tv_mode_setting(TRUE);
			ret = PROC_LOOP;
		}
        break;
	default:
		break;
	}

	return ret;	
}
Exemplo n.º 20
0
static PRESULT time_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
    PRESULT ret = PROC_PASS;
    UINT32 i;
    UINT8	unact;
    CONTAINER* cont = (CONTAINER*)pObj;
    UINT8	id = OSD_GetObjID(pObj);
    SYSTEM_DATA* p_sys_data;
    p_sys_data=sys_data_get();

    switch(event)
    {
    case EVN_PRE_OPEN:
        wincom_open_subtitle((POBJECT_HEAD)&win_time_con,RS_SYS_LOCAL_TIMER_SET/*RS_SYSTEM_TIME*/, 0);
        win_time_set_GMT_enable_string(p_sys_data->local_time.buseGMT);
        win_time_set_Summer_string(p_sys_data->local_time.SummerTime);
        win_time_set_Display_string(p_sys_data->local_time.TimeDisplay);
        win_time_set_GMT_Offset_string(p_sys_data->local_time.GMToffset_count);
        get_local_time(&win_time_local_time);
        set_time_data();
        set_time_clock();
        win_time_switch_GMT_Type(p_sys_data->local_time.buseGMT);
        win_time_set_time_zone_citys(FALSE);
        OSD_SetContainerFocus((CONTAINER*)pObj,1);
        break;

    case EVN_POST_OPEN:
        break;

    case EVN_PRE_CLOSE:
        sys_data_save(1);
        enable_summer_time(p_sys_data->local_time.buseGMT && p_sys_data->local_time.SummerTime);
        /* Make OSD not flickering */
        *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
        break;

    case EVN_POST_CLOSE:
        wincom_close_subtitle();
        OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
        break;
    }
    return ret;
}
Exemplo n.º 21
0
static PRESULT osd_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT32 i;
	BOOL subt_flag;
	CONTAINER* cont = (CONTAINER*)pObj;
	SYSTEM_DATA* p_sys_data;
	
	switch(event)
	{
	case EVN_PRE_OPEN:

		wincom_open_subtitle((POBJECT_HEAD)&win_lcn_con,RS_LCN, 0);
		win_LCN_set_string(sys_data_get_LCN());
		//p_sys_data=sys_data_get();
		
		//win_osd_set_lcn(p_sys_data->osd_set.lcn_sort);
		//lcn_sorted_flag1=p_sys_data->osd_set.lcn_sort;
		break;
	
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
		//p_sys_data=sys_data_get();
		
		sys_data_save(1);
		//save_lcn_sorted_prog();
		
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;

	case EVN_POST_CLOSE:
  		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		break;
	}
	return ret;
}
Exemplo n.º 22
0
static PRESULT win_progname_message_proc(UINT32 msg_type, UINT32 msg_code)
{
	PRESULT ret = PROC_LOOP;

	switch (msg_type)
	{
		case CTRL_MSG_SUBTYPE_CMD_EPG_PF_UPDATED:
			//	case CTRL_MSG_SUBTYPE_CMD_EPG_SCH_UPDATED:
		case CTRL_MSG_SUBTYPE_CMD_TIMEDISPLAYUPDATE:
		case CTRL_MSG_SUBTYPE_STATUS_SIGNAL:
			if (msg_type == CTRL_MSG_SUBTYPE_CMD_EPG_PF_UPDATED)
			{
				event_update = TRUE;
				win_progname_redraw(TRUE);
			}
			else
				event_update = FALSE;
			
			if (msg_type == CTRL_MSG_SUBTYPE_STATUS_SIGNAL)
				ret = PROC_PASS;
			break;
		case CTRL_MSG_SUBTYPE_CMD_EXIT:
			if (sys_data_get_cur_chan_mode() == TV_CHAN)
				ret = PROC_LEAVE;
            else if(sys_data_get_cur_chan_mode() == RADIO_CHAN)
            {
            //to avoid the temporary stop when fast change Radio program channel 
            	sys_data_save(1);  
            }

			break;
		case CTRL_MSG_SUBTYPE_STATUS_SCROLL_STRING:
			win_progname_scroll_string();
			break;
		default:
			ret = PROC_PASS;
	}

	return ret;
}
Exemplo n.º 23
0
static VACTION win_common_item_keymap(POBJECT_HEAD pObj, UINT32 key)
{
	VACTION act = VACT_PASS;

	switch (key)
	{
		case V_KEY_MENU:
			act = VACT_CLOSE;
			break;
		case V_KEY_EXIT:
			dm_set_onoff(1);
			win_qs_update_param(1);
			win_mainFeq_save_data();
			sys_data_save(1);
			BackToFullScrPlay();
			break;
		default:
			break;
	}

	return act;
}
Exemplo n.º 24
0
static PRESULT dis_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
    PRESULT ret = PROC_PASS;
    VACTION unact;

    switch(event)
    {
    case EVN_PRE_OPEN:
        wincom_open_subtitle((POBJECT_HEAD)&g_win_display_set,RS_SYSTEM_DISPLAY_SET, 0);
        win_dis_load_setting();
        win_dis_init_items();
        break;
    case EVN_PRE_CLOSE:
        sys_data_save(1);
        /* Make OSD not flickering */
        *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
        break;
    default:
        break;
    }

    return ret;
}
Exemplo n.º 25
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;
}
Exemplo n.º 26
0
static PRESULT map_city_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 back_saved;
	INT32 news_list_num = 0;
	UINT8 focusID = OSD_GetFocusID( pObj);
	char strTmp[30];

	switch(event)
	{
		case EVN_PRE_OPEN:
#ifdef EXIT_KEY_EXIT_ALL_MENU
	         exit_key_flag =  FALSE;
#endif	
			bMapDownloading = FALSE;
			map_city_list_load();
			break;
		case EVN_POST_OPEN:
			wincom_open_subtitle(pObj,RS_MAP,0);
			//wincom_open_commen_help(pObj);
			wincom_open_help_OK_list_small(pObj, map_city_helpinfo, HELP_CNT);
			memset(search_string, 0x0, sizeof(search_string));
			break;
		case EVN_PRE_CLOSE:
			map_download_abort(s_mapdl_handle);
			s_mapdl_handle = 0;
			sys_data_save(1);
			break;
		case EVN_POST_CLOSE:
			SetReplayHintState(0);
			ShowReplayHintOSDOnOff(0);
			wincom_close_subtitle();
			wincom_close_help();
#ifdef EXIT_KEY_EXIT_ALL_MENU
	        if( exit_key_flag == TRUE)
	        	{
 			 exit_key_flag =FALSE;
			mm_leave_all_menu();
		}
#endif
			break;
		case EVN_MSG_GOT:
			if (param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH)
			{
				bMapDownloading = FALSE;
				s_mapdl_handle = 0;
				if ((int)param2 >= 0)
				{
					win_compopup_smsg_restoreback();
					wincom_close_subtitle();
					wincom_close_help();
					OSD_ClearObject((POBJECT_HEAD)&g_win_map_display,0);
					if(OSD_ObjOpen(&g_win_map_display, param2) != PROC_LEAVE)
					{
						menu_stack_push(&g_win_map_display);
					}
						
				}
				else
				{
					win_compopup_smsg_restoreback();
					win_compopup_init(WIN_POPUP_TYPE_OK);
					//ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_ERROR),strTmp);
					win_compopup_set_msg(NULL,NULL,RS_ERROR);
					win_compopup_open_ext(&back_saved);
					ret = PROC_LOOP;
				}
			}
			break;
		default:
			break;
	}

	return ret;
}
Exemplo n.º 27
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;

}
Exemplo n.º 28
0
static PRESULT win_wifilist_list_unkown_act_proc(VACTION act)
{
	PRESULT ret = PROC_LOOP;
	OBJLIST* ol;
	UINT16 sel;
	UINT32 choice_confirm;
	UINT8 back_saved;

	struct wifi_ap_info	APInfo;
	UINT8	disp_buf[256];
	UINT8	msg_buf[128];
	UINT16 	uni_name[WIFI_MAX_PWD_LEN*2];
	UINT8* 	new_name;	
	BOOL	bUI_Timeout=FALSE;
	int m =0;

	DEBUG_PRINTF("----------\n");
	DEBUG_PRINTF("win_wifilist_list_unkown_act_proc(act=%d)\n", act);		

	ol = &wifilist_olist;
	sel = OSD_GetObjListCurPoint(ol);

	switch(act)
	{

		case VACT_WIFI_AP_SELECT:
			
			if(api_wifi_get_device_enabled_flag())
			{
				if(api_wifi_get_device_connected_status())
				{
					// Case: Connected AP already					
					//use temp AP_Info for user input
					memcpy(&APInfo, &AP_List[sel], sizeof(struct wifi_ap_info));

					//wincom_close_help();
					choice_confirm = win_apselect_open(&APInfo, 1);	//Disconnect

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

					win_wifilist_lib_wifi_update_ap_list_signal();
					win_wifilist_update_all_wifi_manager_menu(TRUE);
					win_wifilist_refresh_signal_bar(TRUE);

					if(choice_confirm)
					{
						//disconnect AP
						api_wifi_do_ap_disconnect();

						//update title device status
						win_wifilist_set_ui_wifi_manager_state(WIFI_UI_AP_DISCONNECTING);
						win_wifilist_update_wifi_device_status_display(TRUE);
					
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg("Disconnecting....",NULL,0);
						win_compopup_open_ext(&back_saved);

						bUI_Timeout=FALSE;
						gUI_StartTime=osal_get_time();
						while(TRUE)
						{	
							gUI_CurrentTime=osal_get_time();

							if((gUI_CurrentTime-gUI_StartTime)>UI_TIMEOUT_THRESHOLD)
							{
								bUI_Timeout=TRUE;	
								break;
							}
							
							if(api_wifi_get_device_connected_status()==FALSE)
							{
								wifi_user_close = FALSE;
								wifi_show_status_msg = TRUE;
								break;
							}
							osal_task_sleep(250);
						}
						win_compopup_smsg_restoreback();

						//reset ap list
						AP_Num=0;
						win_wifilist_update_all_wifi_manager_menu(TRUE);


						if(bUI_Timeout)
						{
							libc_printf("[WiFi]: AP_Disconnect timeout!!(%d sec)\n", UI_TIMEOUT_THRESHOLD);
						}						
						
					}
				}
				else
				{
					// Case: NOT Connected to any AP

					//use temp AP_Info for user input
					memcpy(&APInfo, &AP_List[sel], sizeof(struct wifi_ap_info));

					//wincom_close_help();
					choice_confirm = win_apselect_open(&APInfo, 0);	//connect

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

					win_wifilist_lib_wifi_update_ap_list_signal();
					win_wifilist_update_all_wifi_manager_menu(TRUE);
					win_wifilist_refresh_signal_bar(TRUE);
					
					if(choice_confirm)
					{
						IP_LOC_CFG 	local_ip_cfg;
						//Connect AP
						win_wifilist_set_ui_wifi_manager_state(WIFI_UI_AP_CONNECTING);
						win_wifilist_update_wifi_device_status_display(TRUE);

						// copy back AP_Info from user input
						memcpy(AP_List[sel].ssid, &APInfo, sizeof(struct wifi_ap_info));

						m = find_ssid(APInfo.ssid);
						//libc_printf("mmmmmmmmmmm===%d,numCharInPwd = %d\n",m,APInfo.numCharInPwd);
						move_ssid_to_end(m);
							 
						api_wifi_do_ap_connect(&APInfo);

						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg("Connecting....",NULL,0);
						win_compopup_open_ext(&back_saved);
						
						bUI_Timeout=FALSE;
						gUI_StartTime=osal_get_time();
						while(TRUE)
						{
							gUI_CurrentTime=osal_get_time();

							if((gUI_CurrentTime-gUI_StartTime)>UI_TIMEOUT_THRESHOLD)
							{
								bUI_Timeout=TRUE;
								break;
							}

							libnet_get_ipconfig(&local_ip_cfg);
							if((api_wifi_get_device_connected_status()==TRUE)&&(local_ip_cfg.ip_addr))
							{
								wifi_show_status_msg = TRUE;
								break;
							}
							osal_task_sleep(250);
						}
						win_compopup_smsg_restoreback();	

						if(bUI_Timeout)
						{
							libc_printf("[WiFi]: AP_Connect timeout!!(%d sec)\n", UI_TIMEOUT_THRESHOLD);			
							api_wifi_do_ap_disconnect();
							if(AP_Num)
							{
//								libc_printf("\n*****AP_Connect timeout*****111111111111************\n");		
								display_wifi_help_bar_flag=1;
								win_wifilist_set_ui_wifi_manager_state(WIFI_UI_AP_NOT_CONNECTED);
							}
							else
							{
								win_wifilist_set_ui_wifi_manager_state(WIFI_UI_AP_SCANNING);
							}
							win_wifilist_update_wifi_device_status_display(TRUE);

							win_compopup_init(WIN_POPUP_TYPE_OK);
							win_compopup_set_msg("[WiFi]: Timeout, unable to connect!!",NULL,0);
							win_compopup_open_ext(&back_saved);
							win_compopup_smsg_restoreback();								
						}
					}					
				}
			}
			else
			{
				win_compopup_init(WIN_POPUP_TYPE_OKNO);			
				win_compopup_set_msg("Are you sure to enable WiFi device?",NULL,0);
				choice_confirm = win_compopup_open_ext(&back_saved);
				if(choice_confirm == WIN_POP_CHOICE_YES)
				{
					api_wifi_enable_device_function(TRUE);				
					win_wifilist_update_all_wifi_manager_menu(TRUE);
				}
			}
			break;

		case VACT_WIFI_DEVICE_SWITCH:

			if(api_wifi_get_device_enabled_flag())
			{
				//Enabled
				win_compopup_init(WIN_POPUP_TYPE_OKNO);			
				win_compopup_set_msg("Are you sure to disable WiFi device?",NULL,0);
				choice_confirm = win_compopup_open_ext(&back_saved);
				if(choice_confirm == WIN_POP_CHOICE_YES)
				{
					//switch to Disabled
					api_wifi_enable_device_function(FALSE);

					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg("Waiting....",NULL,0);
					win_compopup_open_ext(&back_saved);

					gUI_StartTime=osal_get_time();
					while(TRUE)
					{	
						gUI_CurrentTime=osal_get_time();

						if((gUI_CurrentTime-gUI_StartTime) > UI_ENABLE_WAIT_TIME)
						{
							break;
						}
						osal_task_sleep(250);
					}
					win_compopup_smsg_restoreback();
					set_wifi_device_enable_flag(0);
					sys_data_save(1);

#if 0
					AP_Num=0;
					win_wifilist_update_all_wifi_manager_menu(TRUE);					
					win_wifilist_set_ui_wifi_manager_state(WIFI_UI_DEV_OFF);
					win_wifilist_update_wifi_device_status_display(TRUE);
#endif
				}	
			}
			else
			{
				//Disabled
				win_compopup_init(WIN_POPUP_TYPE_OKNO);			
				win_compopup_set_msg("Are you sure to enable WiFi device?",NULL,0);
				choice_confirm = win_compopup_open_ext(&back_saved);
				if(choice_confirm == WIN_POP_CHOICE_YES)
				{
					//switch to Enabled
					api_wifi_enable_device_function(TRUE);

					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg("Waiting....",NULL,0);
					win_compopup_open_ext(&back_saved);

					gUI_StartTime=osal_get_time();
					while(TRUE)
					{	
						gUI_CurrentTime=osal_get_time();

						if((gUI_CurrentTime-gUI_StartTime) > UI_ENABLE_WAIT_TIME)
						{
							break;
						}
						osal_task_sleep(250);
					}
					win_compopup_smsg_restoreback();
					set_wifi_device_enable_flag(1);   //guop
					sys_data_save(1);
					win_wifilist_lib_wifi_retrieve_ap_scan_list();
					win_wifilist_update_all_wifi_manager_menu(TRUE);
					win_wifilist_refresh_signal_bar(TRUE);
				}
			}

			break;
			
		case VACT_WIFI_AP_LIST_REFRESH:
			//force update latest ap list

			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg("Refreshing List...",NULL,0);
			win_compopup_open_ext(&back_saved);
			osal_task_sleep(1000);
			win_compopup_smsg_restoreback();	
			
			win_wifilist_lib_wifi_retrieve_ap_scan_list();
			//wincom_open_commen_help2((POBJECT_HEAD)&g_win_wifi_manager, wifilist_helpinfo , HELP_CNT);
			break;

		case VACT_WIFI_AP_LIST_PAGE_UP:

			if(ap_list_top>AP_LIST_PAGE_CNT)
			{
				ap_list_top 		-= AP_LIST_PAGE_CNT;
				ap_list_item_sel	-= AP_LIST_PAGE_CNT;
			}
			else
			{
				// @ first page
				ap_list_top 		= 0;
				ap_list_item_sel	= 0;
			}
    			ap_list_pos = ap_list_item_sel-ap_list_top;

			win_wifilist_update_all_wifi_manager_menu(TRUE);
			
			break;

		case VACT_WIFI_AP_LIST_PAGE_DOWN:
			if(AP_Num-ap_list_top>AP_LIST_PAGE_CNT)
			{
				ap_list_top 		+= AP_LIST_PAGE_CNT;
				ap_list_item_sel	+= AP_LIST_PAGE_CNT;
			}
			else
			{
				// @ last page
				ap_list_item_sel	= AP_Num-1;
			}
    			ap_list_pos = ap_list_item_sel-ap_list_top;

			win_wifilist_update_all_wifi_manager_menu(TRUE);
			break;

	}
	return ret;
}
Exemplo n.º 29
0
static PRESULT wifilist_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 back_saved;

	switch(event)
	{
		case EVN_PRE_OPEN:
#ifdef EXIT_KEY_EXIT_ALL_MENU
	         exit_key_flag =  FALSE;
#endif
#ifdef PREVIEW_SUBMENU 
		{
				
			if(param2==MENU_OPEN_TYPE_OTHER)
			{
				wifilist_idx0.head.style.bHLIdx=TXTI_SH_IDX;
				wifilist_ssid0.head.style.bHLIdx=TXTC_SH_IDX;
				wifilist_encrypt_mode0.head.style.bHLIdx=TXTC_SH_IDX;
				wifilist_ap_status0.head.style.bHLIdx=TXTC_SH_IDX;
			}
			else
			{
				wifilist_idx0.head.style.bHLIdx=TXTI_HL_IDX;
				wifilist_ssid0.head.style.bHLIdx=TXTC_HL_IDX;
				wifilist_encrypt_mode0.head.style.bHLIdx=TXTC_HL_IDX;
				wifilist_ap_status0.head.style.bHLIdx=TXTC_HL_IDX;
			}
		}
#endif
			display_wifi_help_bar_flag=1;
			win_signal_set_wifi_level_quality(0,0,1);
			win_wifilist_lib_wifi_sync_device_state();
			win_wifilist_lib_wifi_retrieve_ap_scan_list();
			win_wifilist_update_all_wifi_manager_menu(FALSE);
			wincom_open_subtitle(pObj,RS_WIFI_MANAGER,0);
			ap_clear_all_message();
			break;
			
		case EVN_POST_OPEN:
	        	win_minisignal_open_ex(pObj,pObj->frame.uLeft,pObj->frame.uTop + LIST_ITEMCNT*(ITEM_H + ITEM_GAP) + LST_WIFI_DEV_H +50);
			//win_minisignal_open_ex3(pObj,pObj->frame.uLeft+20,pObj->frame.uTop + 9 * (CON_H + CON_GAP) + 45);
			win_wifilist_refresh_signal_bar(TRUE);
			break;
			
		case EVN_PRE_CLOSE:
			sys_data_save(1);
			/* Make OSD not flickering */
			*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
			break;
			
		case EVN_POST_CLOSE:
			win_signal_close();
			wincom_close_help();
			ap_clear_all_message();
#ifdef EXIT_KEY_EXIT_ALL_MENU
	        if( exit_key_flag == TRUE)
	        	{
 			 exit_key_flag =FALSE;
			mm_leave_all_menu();
		}
#endif
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
			break;
			
		case EVN_MSG_GOT:
			if((param1 ==  CTRL_MSG_SUBTYPE_CMD_EXIT)||(param1 ==  CTRL_MSG_SUBTYPE_CMD_EXIT_ALL))
			{
				ret = PROC_LEAVE;
			}
			else
			{
				win_wifilist_message_proc(param1,param2);
			}
			break;
			
		default:
			break;
	}


	return ret;
}
Exemplo n.º 30
0
    static PRESULT win_progname_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT32 i;
	VACTION	unact;
	static UINT16 recall_channel =  P_INVALID_ID;
	SYSTEM_DATA* sys_data;
	
	sys_data = sys_data_get();
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		if(screen_back_state == SCREEN_BACK_MENU)
		{
			ap_clear_all_menus();
		}
		
		b_popdetail = FALSE;
		PROGNAME_TIMER_TIME = sys_data->osd_set.time_out;
		if(PROGNAME_TIMER_TIME == 0 || PROGNAME_TIMER_TIME>10)
			PROGNAME_TIMER_TIME = 5;
		PROGNAME_TIMER_TIME *= 1000;
		recall_channel = P_INVALID_ID;
		if( (param2 & MENU_OPEN_TYPE_MASK) == MENU_OPEN_TYPE_KEY)
		{
			if( (param2 & MENU_OPEN_PARAM_MASK ) == V_KEY_RECALL)
			{
				recall_channel = recall_play_channel(0);
			    if(recall_channel == P_INVALID_ID)
			        return PROC_LEAVE;
			}
		}
        api_inc_wnd_count();
			
		break;
	case EVN_POST_OPEN:
		if(show_and_playchannel)
		{
			UINT16 channel;

			show_and_playchannel = 0;

			channel = sys_data_get_cur_group_cur_mode_channel();
			api_play_channel(channel, TRUE, TRUE,FALSE);
		}
		
		if(recall_channel != P_INVALID_ID)
		{
			api_play_channel(recall_channel, TRUE, TRUE,FALSE);
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);			
		}

		progname_timer = api_start_timer(PROGNAME_TIMER_NAME,PROGNAME_TIMER_TIME,progname_timer_func);
		ShowMuteOnOff();
		ShowPauseOnOff();
#ifdef DVR_PVR_SUPPORT
		ShowRecHintOSDOnOff(GetRecHintState());		
#endif
		break;
	case EVN_PRE_CLOSE:
		break;
	case EVN_POST_CLOSE:
		api_stop_timer(&progname_timer);
        sys_data_save(1);
        api_dec_wnd_count();
		if(b_popdetail)
		{
#if 0//def DVR_PVR_SUPPORT
			if(pvr_info.hdd_valid && (ap_pvr_set_state() != PVR_STATE_IDEL))
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_pvr_ctrl, TRUE);
			else
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_progdetail, TRUE);				
#else
			ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_progdetail, TRUE);
#endif
		}
		break;
	case EVN_PRE_DRAW:
		break;
	case EVN_POST_DRAW:
#ifdef MODIFY_FOR_EGYPT_CUSTOMER
		win_progname_draw_bmp();
#endif
		win_progname_draw_infor();
		break;
	case EVN_UNKNOWNKEY_GOT:
		ap_send_msg(CTRL_MSG_SUBTYPE_KEY, param1, FALSE);
		ret = PROC_LEAVE;
		break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16) ;
		ret = win_progname_unkown_act_proc(unact);		
		break;
	case EVN_MSG_GOT:
		ret = win_progname_message_proc(param1,param2);
	       
		break;		
	default:
		break;		
	}

	return ret;	
}