예제 #1
0
static int win_pvr_detach_proc()
{
	char rec_vol[16];
	
	if (system_state != SYS_STATE_USB_PVR)
	{
		return 0;
	}

	rec_vol[0] = 0;
	pvr_get_cur_mode(rec_vol, NULL);
	if (rec_vol[0] == 0)
	{
		DM_DEBUG("disk detach in PVR record manager, enter main menu\n");
		// Alert here:Clear all menus may cuase unpredictable result,must be tested
		api_osd_mode_change(OSD_NO_SHOW);
		ap_clear_all_menus(); //clear all menu & Hidden osd show
		menu_stack_pop_all();
		
		if(api_get_usb_unmount_flag()==0)	//-a by wangyang 2011-12-26
			image_restore_vpo_rect();
		api_set_usb_unmount_flag(0);	
		ap_clear_all_message();
		system_state = SYS_STATE_NORMAL;
		api_pvr_set_back2menu_flag(FALSE);
		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT,(UINT32)&g_win_mainmenu, FALSE);
	}
}
예제 #2
0
static void normal_speed(void)
{
    if (speed_up == TRUE)
    {
        osal_timer_set(GAME_CYCLIC_ID, TimeDelay[Speed - 1]);
        ap_clear_all_message();
        speed_up = FALSE;
    }
}
예제 #3
0
// TODO: implement this function in win_filelist.c
static int win_mp_detach_proc()
{
	char cur_disk_name[8];
	BOOL b_exit_win_mp = FALSE;
	int disk_type = 0, disk_idx = 0, dm_ret = 0, vol_num = 0;

	if ((mp_get_cur_disk_name(cur_disk_name, 8) == 0) &&
		(STRLEN(cur_disk_name) == 3))
	{
		disk_type = diskNamePrefix2Type(cur_disk_name);
		disk_idx = (int)cur_disk_name[2] - 'a';
		dm_ret = dm_ioctl(DM_CMD2_GET_VOL_NUM, DM_CMD_PARAM(disk_type, disk_idx, 0),
							&vol_num, sizeof(int));
		if (dm_ret != 0 || vol_num <= 0)			
			win_delete_all_filelist();
	}
	
	if (!mp_in_win_filelist())
		return 0;

	DM_DEBUG("%s() system_state: %d\n", __FUNCTION__, system_state);
	
	if (!ap_mp_is_ready()) // exit menu, if all disks are detached
	{
		b_exit_win_mp = TRUE;
	}
	else if ((mp_get_cur_disk_name(cur_disk_name, 8) == 0) &&
			 (STRLEN(cur_disk_name) == 3))
	{
		if (dm_ret != 0 || vol_num <= 0)
		{	
			b_exit_win_mp = TRUE;
		}
	}
	else
	{
		b_exit_win_mp = TRUE;
	}

	if (b_exit_win_mp)
	{
		DM_DEBUG("disk detach in Media Player, enter main menu\n");
		// Alert here:Clear all menus may cuase unpredictable result,must be tested
		api_osd_mode_change(OSD_NO_SHOW);
		ap_clear_all_menus(); //clear all menu & Hidden osd show
		menu_stack_pop_all();
	
		if(api_get_usb_unmount_flag()==0)	//-a by wangyang 2011-12-26
			image_restore_vpo_rect();
		api_set_usb_unmount_flag(0);	
		ap_clear_all_message();
		system_state = SYS_STATE_NORMAL;
		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT,(UINT32)&g_win_mainmenu, FALSE);
	}
}
예제 #4
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;
}
예제 #5
0
static void search_callback(UINT8 aue_type, UINT32 aue_value)
{
	union as_message msg;
	static UINT32 as_progress=0;
	UINT8 result = PROC_LOOP;
	UINT16 progress;
	UINT32 moving_disk_time;

	DBG_PRINTF("Enter %s....\n",__FUNCTION__);

#ifndef MULTITASK_DRAW_OSD_SUPPORT
	win_search_capture_semaphore();  
#endif

	//OSD_TaskBuffer_Init(osal_task_get_current_id(),NULL);
	if (aue_type == ASM_TYPE_PROGRESS)
	{
		if (as_progress>=aue_value)
		{
			as_progress = aue_value;

#ifndef MULTITASK_DRAW_OSD_SUPPORT
			win_search_release_semaphore();
#endif
			DBG_PRINTF("Exit %s....\n",__FUNCTION__);
			return;
		}
		/*
		 * without the following line will cause
		 * percentage inverse here.
		 */
		as_progress = aue_value;
	}

	msg.decode.asm_type = aue_type;
	msg.decode.asm_value = aue_value;

    switch(msg.decode.asm_type)
    {
        case ASM_TYPE_SATELLITE:
        	osal_task_dispatch_off();
        	if(!win_search_stop_signal)
        	{
        		cur_srch_sat ++;
        		moving_disk = 1;
        		/* !!!!!! */
        		osal_task_dispatch_on();
        		#ifndef MULTITASK_DRAW_OSD_SUPPORT
        		win_search_release_semaphore();
        		#endif
        		ap_clear_all_message();
        		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
        		moving_disk_time = 0;
            }
        	else
        	{
        		osal_task_dispatch_on();
        		#ifndef MULTITASK_DRAW_OSD_SUPPORT
        		win_search_release_semaphore();
        		#endif
            }
            while(moving_disk)
            {
        		osal_task_sleep(10);
        		moving_disk_time++ ;
            }
            as_progress = 0;
            break;
        case ASM_TYPE_PROGRESS:
            if(msg.decode.asm_value == 100 || msg.decode.asm_value == 150)
            {
                ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
            }
            else
            {
                if(win_search_param.as_method != AS_METHOD_MULTI_FFT 
                    && win_search_param.as_method != AS_METHOD_MULTI_NIT  
                    && win_search_param.as_method != AS_METHOD_MULTI_TP)
                    progress = msg.decode.asm_value;
                else
                {
#ifdef NEW_DEMO_FRAME
                progress = (100* (cur_srch_sat- 1)+ msg.decode.asm_value)/win_search_param.as_sat_cnt;
#else
                    progress = (100* (cur_srch_sat- 1)+ msg.decode.asm_value)/win_search_param.as_sat_id;
#endif
                    if(progress>= 100)
                        progress = 99;
                }
                //result = win_search_update_progress(progress);//msg.decode.asm_value);
                msg.decode.asm_value = progress;
		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);			
            }
            break;
        case ASM_TYPE_ADD_PROGRAM:
            //win_search_program_append(0xFFFFFFFF, msg.decode.asm_value);
            ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
            break;
        case ASM_TYPE_ADD_TRANSPONDER:
            //win_search_program_append(msg.decode.asm_value, INVALID_ID);
            ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
            break;
        default:
                ;
    }
#if 0
    //OSD_UpdateWinVscr(&win_search, FALSE);

    if(msg.decode.asm_type ==ASM_TYPE_PROGRESS && result == PROC_LEAVE)
        ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_TOP, 0,TRUE);


    if(msg.decode.asm_type != ASM_TYPE_SATELLITE)
    {
        OSD_ObjProc( (POBJECT_HEAD)&g_win_search, 0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF);

#ifndef MULTITASK_DRAW_OSD_SUPPORT
        win_search_release_semaphore();
#endif
    }
#endif
	DBG_PRINTF("Exit %s....\n",__FUNCTION__);

}
예제 #6
0
static void hddfmt_start()
{
	UINT8 back_saved;
	win_popup_choice_t choice;
	UINT8 mode;
	struct dvr_HDD_info hdd_info;
	char volume_name[48];
	char osd_name[48];
	char hint[64];
	BOOL ret;

	disk_format_mode_num = get_fsystem_installed(disk_mode, 8);
	//sprintf(temp, "%s", disk_mode[input]);

	storage_index_to_osd_string((UINT8)hddfmt_cur_volume,osd_name);	
	sprintf(hint, "Are you sure to format the %s?", osd_name);

	if(disk_format_mode_num == 1)
	{
		win_compopup_init(WIN_POPUP_TYPE_OKNO);
		win_compopup_set_btnstr_ext(0, disk_mode[0]);
		win_compopup_set_default_choice(WIN_POP_CHOICE_NO);		
	}
	else if(disk_format_mode_num == 2)
	{
		win_compopup_init(WIN_POPUP_TYPE_OKNOCANCLE);
		win_compopup_set_btnstr_ext(0, disk_mode[0]);
		win_compopup_set_btnstr_ext(1, disk_mode[1]);
		win_compopup_set_default_choice(WIN_POP_CHOICE_CANCEL);		
	}
	win_compopup_set_msg(hint, NULL, 0);
	choice = win_compopup_open_ext(&back_saved);

	if(((disk_format_mode_num == 1) && (choice == WIN_POP_CHOICE_YES)) || ((disk_format_mode_num == 2) && ((choice == WIN_POP_CHOICE_YES) || (choice == WIN_POP_CHOICE_NO))))
	{
		if(choice == WIN_POP_CHOICE_YES)
			mode = 1;
		else
			mode = 2;

		storage_index2volume((UINT8)hddfmt_cur_volume,volume_name);
		storage_add_parent_dir(volume_name);		
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		win_compopup_set_frame(GET_MID_L(286), GET_MID_T(130), 286, 130);
		win_compopup_set_msg_ext("formating wait!",NULL,0);
		win_compopup_open_ext(&back_saved);
		ret = pvr_format_multi_hdd(mode, volume_name);
		win_compopup_smsg_restoreback();

		if(!ret) 		
		{
			win_compopup_init(WIN_POPUP_TYPE_OK);
			sprintf(hint, "Format %s error?", osd_name);
			win_compopup_set_msg(hint, NULL, 0);
			win_compopup_set_default_choice(WIN_POP_CHOICE_CANCEL);		
			win_compopup_open_ext(&back_saved);
			return;
		}

		if(STRCMP((char *)pvr_get_mout_prefix(), volume_name)==0)
		{
			if(pvr_get_HDD_info(&hdd_info))
			{
				api_pvr_check_level(&hdd_info);		
				ap_clear_all_message();//or usb reflash msg maybe send fail
				pvr_evnt_callback(0, PVR_HDD_FORMATTED);
			}		
		}
		win_hddfmt_draw_disk_infor();
	}
}
예제 #7
0
static PRESULT sm_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);
	POBJECT_HEAD focusObj;

	
	switch(event)
	{
	case EVN_PRE_OPEN:
		if (!submenu_set_items(sub_menu_desc))
			return PROC_LEAVE;

		//wincom_open_title(pObj,sub_menu_desc->title_id, 0);  //guop

		
		break;
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
		
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		OSD_DrawObject((POBJECT_HEAD)&g_win_submenu,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);
		break;

	case EVN_POST_CLOSE:
		break;
	case EVN_UNKNOWN_ACTION:
        submenu_unknown_act(sub_menu_desc, (VACTION)(param1>>16));
        ret = PROC_LOOP;
		break;
    case EVN_MSG_GOT:
		if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
		{
			storage_dev_mount_hint(1);
			submenu_set_items(sub_menu_desc);
			submenu_show();
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);
#ifdef USB_MP_SUPPORT
#ifdef USB_SAFELY_REMOVE_SUPPORT
	        extern UINT8 g_show_usb_safely_removed;
	        if (g_show_usb_safely_removed)
	        {
			g_show_usb_safely_removed = 0;
			UINT8 back_saved;
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg(NULL, NULL, RS_USB_SAFELY_REMOVE_SUCCESS);
			ap_clear_all_message();
			win_compopup_open_ext(&back_saved);
	        }
#endif
#endif
			
		}
		
	default:
		;
	}

	return ret;
}
예제 #8
0
static PRESULT sm_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);
	POBJECT_HEAD focusObj;

	
	switch(event)
	{
	case EVN_PRE_OPEN:
#if 0		
		for(i=0;i<9;i++)
			ComInt2UniStr(display_strs[i], i + 1, 0);
#endif			
		if (!submenu_set_items(sub_menu_desc))
		{
			return PROC_LEAVE;
		}
 #ifdef EXIT_KEY_EXIT_ALL_MENU
		exit_key_flag =FALSE;
#endif
		//wincom_open_title(pObj,sub_menu_desc->title_id, 0);  //guop		
		
		break;

	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_DRAW:
	{

		
		UINT8 mm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_mainmenu);
		UINT8 sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
		#if ((defined(OSD_GOLDENMEDIA)) ||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
			((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=(sub_menu_desc->item_count)*43+50;	
		#else
		if((mm_focus_id==1)/*&&((sm_focus_id==1)||(sm_focus_id==2))*/)
			((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=W_H+14;
		else
			((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=W_H;	
		#endif
	}break;

	case EVN_POST_DRAW:
	{

		UINT16 str_id;
		UINT8 mm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_mainmenu);
		UINT8 sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
		
		str_id=mm_item_str_ids[mm_focus_id-1];
		OSD_SetTextFieldContent((PTEXT_FIELD)&subm_item_title,STRING_ID,str_id );
		OSD_DrawObject((POBJECT_HEAD)&subm_item_title,C_UPDATE_ALL);
		
		//item_count = sub_menu_desc->item_count;
#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
#else
	need_draw_signal_status=0;
#endif

#ifdef OSD_12
#ifdef PREVIEW_SUBMENU
		switch(mm_focus_id)
		{
			case 1: 
				//str_id=RS_MM_SERVICE; 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(editchannel_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(editchannel_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}				
				break;
				
			case 2: 
				//str_id=RS_MM_INSTALLATION;
				//if(sm_focus_id==1)
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(installation_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(installation_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}
				break;			
				
		#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			case 3: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(system_sub_menus[sm_focus_id-1]!=NULL)
					{
					/*	if(system_sub_menus[sm_focus_id-1]==(POBJECT_HEAD)&g_win_disk_operate)
							OSD_ObjOpen((POBJECT_HEAD)&g_win_disk_operate, MENU_OPEN_TYPE_OTHER );
						else*/
							OSD_ObjOpen(system_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
					}
				}
				break;			
				
			case 4: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(preference_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(preference_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;				
				
			case 13: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(network_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(network_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
				
				#if 1
			case 14: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(sm_focus_id==1)
					{
						game_othello_init();
						
					}
					else if(sm_focus_id==2)
					{
						game_sudoku_init();
					}
					if(games_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(games_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;
				#endif
				
			case 15: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(ca_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(ca_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;			
				
			case 16: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(upg_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(upg_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
		#endif
		
			default:
				break;
		}
#endif
#else
#ifdef PREVIEW_SUBMENU
		switch(mm_focus_id)
		{
			case 1: 
				//str_id=RS_MM_SERVICE; 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(editchannel_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(editchannel_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}				
				break;
				
			case 2: 
				//str_id=RS_MM_INSTALLATION;
				//if(sm_focus_id==1)
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(installation_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(installation_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}
				break;			
				
		#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			case 3: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(system_sub_menus[sm_focus_id-1]!=NULL)
					{
					/*	if(system_sub_menus[sm_focus_id-1]==(POBJECT_HEAD)&g_win_disk_operate)
							OSD_ObjOpen((POBJECT_HEAD)&g_win_disk_operate, MENU_OPEN_TYPE_OTHER );
						else*/
							OSD_ObjOpen(system_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
					}
				}
				break;			
				
			case 4: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(preference_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(preference_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;				
				
			case 9: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(network_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(network_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
				
				#if 1
			case 10: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(sm_focus_id==1)
					{
						game_othello_init();
						
					}
					else if(sm_focus_id==2)
					{
						game_sudoku_init();
					}
					if(games_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(games_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;
				#endif
				
			case 11: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(ca_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(ca_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;			
				
			case 12: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(upg_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(upg_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
		#endif
		
			default:
				break;
		}
#endif
#endif

		//if(item_count<3)
		//OSD_SetObjRect(&subm_item_bg,CON_L,CON_T,CON_W,CON_H*2);
		//else
		//OSD_SetObjRect(&subm_item_bg,CON_L,CON_T,CON_W,CON_H*item_count+2);
		//OSD_DrawObject((POBJECT_HEAD)&subm_item_bg,C_UPDATE_ALL);

	}break;

	case EVN_PRE_CLOSE:
		
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		//OSD_DrawObject((POBJECT_HEAD)&g_win_submenu,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);//albert.li del
		break;

	case EVN_POST_CLOSE:
		enter_system_flag=FALSE;
#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))/*||(defined(OSD_15))*/)
    	#ifdef EXIT_KEY_EXIT_ALL_MENU
		if(exit_key_flag)
			api_full_screen_play();
    	#endif
#else
		api_full_screen_play();
#endif

#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
#else
	need_draw_signal_status=1;
#endif

 #ifdef EXIT_KEY_EXIT_ALL_MENU
 	#ifdef MINI_INFO_BAR//wdh 2012.2.3 对此客户,进入service 的submenu项直接按推出键会出现信号条没消除掉,原因是把INFO BAR 改小以后没有刷新的这块区域
			win_progname_signal_close();
	#endif
	if(exit_key_flag ==FALSE )
	{
		exit_submenu_flag_mute =TRUE;
		exit_submenu_flag_pause =TRUE;
		exit_submenu_flag_rec =TRUE;
		ap_send_key(V_KEY_MENU, TRUE);
	}
	else
	{
	
		exit_key_flag =FALSE;
	}
#else
		ap_send_key(V_KEY_MENU, TRUE);//albert.li add
#endif
		break;
		
	case EVN_UNKNOWN_ACTION:
#ifdef PREVIEW_SUBMENU
		unact = (VACTION)(param1>>16) ;
		if((unact == VACT_FOCUS_UP)||(unact == VACT_FOCUS_DOWN))
			;
	        else
#endif	
			submenu_unknown_act(sub_menu_desc, (VACTION)(param1>>16));
	        ret = PROC_LOOP;
		break;
		
    case EVN_MSG_GOT:

		if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
		{
			#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			UINT8 sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
			#endif

			//storage_dev_mount_hint(1);
			submenu_set_items(sub_menu_desc);
			submenu_show();
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);

			// if all sub menu items are inactive, exit sub menu
			if (!submenu_active(sub_menu_desc))
			{
				UINT32 hkey;
				ap_vk_to_hk(0, V_KEY_EXIT, &hkey);
				ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);
			}

#ifdef USB_MP_SUPPORT
#ifdef USB_SAFELY_REMOVE_SUPPORT
	#ifndef DISK_MANAGER_SUPPORT
	        extern UINT8 g_show_usb_safely_removed;
	        if (g_show_usb_safely_removed)
	        {
			g_show_usb_safely_removed = 0;
			UINT8 back_saved;
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg(NULL, NULL, RS_USB_SAFELY_REMOVE_SUCCESS);
			ap_clear_all_message();
			win_compopup_open_ext(&back_saved);
	        }
	#endif
#endif
#endif

#ifdef PREVIEW_SUBMENU  //-a by wangyang 
		if(sub_menu_desc->title_id==RS_MM_SYSTEM)
		{
			if((sm_focus_id ==4)||(sm_focus_id ==5)	||(sm_focus_id ==6))
			{
				OSD_DrawFill(SUBMENU_W_L, SUBMENU_W_T, (SUBMENU_W_W), (SUBMENU_W_H), OSD_TRANSPARENT_COLOR, NULL);
				OSD_ObjOpen((POBJECT_HEAD)&win_info_con, MENU_OPEN_TYPE_OTHER );
			}
		}
		else if (sub_menu_desc->title_id==RS_MM_UPGRADE)
		{
			if((sm_focus_id ==3)||(sm_focus_id==4))
			{
				OSD_DrawFill(SUBMENU_W_L, SUBMENU_W_T, (SUBMENU_W_W), (SUBMENU_W_H), OSD_TRANSPARENT_COLOR, NULL);
				OSD_ObjOpen((POBJECT_HEAD)&win_rs232upg_con, MENU_OPEN_TYPE_OTHER );
			}

		}
#endif
		}
#ifdef PREVIEW_SUBMENU  //-a by wangyang 
{
		UINT8 sm_focus_id;
		sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
			
#if !defined (MAIN_CHIP_M3601S) && !defined (M3606_NON_NETWORK)
		if (sub_menu_desc->title_id==RS_MM_NETWORK)
		{
			if((sm_focus_id ==1))
			{
				TestNetStatus();
			}

		}
#endif
		
}
#endif

#ifdef NETWORK_SUPPORT
#ifdef WIFI_SUPPORT
		if(param1 == CTRL_MSG_SUBTYPE_CMD_WIFI_CTRL_MSG && (param2 == WIFI_MSG_DEVICE_PLUG_IN||param2 == WIFI_MSG_DEVICE_PLUG_OUT))
		{
			//storage_dev_mount_hint(1);
			submenu_set_items(sub_menu_desc);
			submenu_show();
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);

			// if all sub menu items are inactive, exit sub menu
			if (!submenu_active(sub_menu_desc))
			{
				UINT32 hkey;
				ap_vk_to_hk(0, V_KEY_EXIT, &hkey);
				ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);
			}
	}
#endif
#endif
		
	default:
		break;
	}

	return ret;
}