static void othello_start(void)
{
	UINT8 back_saved;
	//    othello_init();
	othello_draw_background();
	update_status(Class, BlackPoint, WhitePoint);

	win_compopup_init(WIN_POPUP_TYPE_OKNO);
	win_compopup_set_frame(GAME_MSG_LEFT, GAME_MSG_TOP, GAME_MSG_WIDTH, GAME_MSG_HEIGHT);
	win_compopup_set_msg_ext(NULL, NULL, RS_GAME_MSG_DO_YOU_BLACK);
	if (win_compopup_open_ext(&back_saved) == WIN_POP_CHOICE_NO)
	{
		computer_side = CHESS_BLACK;
		/* computer round */
		computer_play(&chess_board, callback);

		get_chess_score(&chess_board, &WhitePoint, &BlackPoint);
		update_status(Class, BlackPoint, WhitePoint);
	}
}
Exemple #2
0
static PRESULT news_list_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 back_saved;
	SYSTEM_DATA *p_sys_data = sys_data_get();

	switch(event)
	{
		case EVN_PRE_DRAW:
			news_list_display();
			break;
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);

			if (unact == VACT_ENTER)
			{
				if (!bGetContent)
				{
				if(news==0)
					{
					news=news_download(2, p_sys_data->news_addr[news_addr_index].news_addr_url);
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg((UINT8*)"Connecting, please wait...",NULL,0);
					win_compopup_open_ext(&back_saved);
					}
				}
				else
				{	
					win_news_detail_open(OSD_GetObjListCurPoint(&ol_news_list));
				}
			}
			break;
		default:
			break;
	}

	return ret;
}
Exemple #3
0
static PRESULT satsrch_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 bID;
	VACTION unact;
	POBJECT_HEAD submenu;
	UINT8 back_saved;
		
	bID = OSD_GetObjID(pObj);

	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER && bID == START_ID)
		{
			
			if(single_multi_srch_flag && get_tuner_sat_cnt(TUNER_EITHER_SELECT) == 0)
			{
				win_compopup_init(WIN_POPUP_TYPE_OK);
				win_compopup_set_msg(NULL, NULL, RS_DISPLAY_NO_SATELLITE);
				win_compopup_open_ext(&back_saved);
				ret = PROC_LOOP;
				break;					
			}
			win_satsrch_set_search_param();
			submenu = (POBJECT_HEAD)&g_win_search;
			if(OSD_ObjOpen(submenu, 0xFFFFFFFF) != PROC_LEAVE)
				menu_stack_push(submenu);
				
			ret = PROC_LOOP;
		}
		
		break;
	}

	return ret;
}
Exemple #4
0
static VACTION time_con_keymap(POBJECT_HEAD pObj, UINT32 key)
{
    VACTION act;
    SYSTEM_DATA* p_sys_data=sys_data_get();
    date_time dt;
    INT32 hoffset, moffset;
    UINT8 save;
    INT32 ret1,ret2;

    switch(key)
    {
    case V_KEY_UP:
        act = VACT_CURSOR_UP;
        break;

    case V_KEY_DOWN:
        act = VACT_CURSOR_DOWN;
        break;

    case V_KEY_EXIT:
    case V_KEY_MENU:
        act = VACT_CLOSE;
        win_time_get_input();
        if(p_sys_data->local_time.buseGMT)
        {
            sys_data_gmtoffset_2_hmoffset(&hoffset, &moffset);
            set_STC_offset( hoffset, moffset, 0);
            get_UTC(&dt);
            set_STC_time(&dt);
            enable_time_parse();
        }
        else
        {
            ret1 = api_check_valid_date(win_time_local_time.year,win_time_local_time.month,win_time_local_time.day);
            if(ret1 != 0 || win_time_local_time.hour>23 || win_time_local_time.min>=60)
            {
                win_compopup_init(WIN_POPUP_TYPE_OKNO);
                win_compopup_set_msg(NULL,NULL,RS_MSG_INVALID_INPUT_CONTINUE);
                win_compopup_set_frame(GET_MID_L(300),GET_MID_T(100),320,100);
                if(win_compopup_open_ext(&save) == WIN_POP_CHOICE_YES)
                    act = VACT_PASS;
                else
                    act = VACT_CLOSE;
            }
            else
            {
                set_STC_offset(0,0,0);
                set_STC_time(&win_time_local_time);
                p_sys_data->local_time.GMToffset_count = 23;
                disable_time_parse();
            }
        }

        break;

    case V_KEY_ENTER:
        act = VACT_ENTER;
        break;

    default:
        act = VACT_PASS;
        break;
    }

    return act;
}
Exemple #5
0
static PRESULT map_city_list_unact_proc(VACTION act)
{
	PRESULT ret = PROC_PASS;
	OBJLIST* ol;
	UINT16 curitem;
	UINT8 back_saved;
 	SYSTEM_DATA* p_sys_data = sys_data_get();
	UINT16 uni_name[30];
	UINT8* new_name;
	
	ol = &ol_map_city;
	curitem = OSD_GetObjListNewPoint(ol);
	
	switch (act)
	{
		case VACT_MAP_CITY_EDIT:
	//		ComAscStr2Uni(p_sys_data->map_city_name[curitem], uni_name);
			MEMCPY(uni_name,(UINT16*)p_sys_data->map_city_name[curitem],(MAP_CITY_NAME_LEN + 1));
#ifndef KEYBOARD_SUPPORT
			if(win_rename_open(uni_name,&new_name,map_city_check_input_name))
#else
			if(win_keyboard_rename_open(uni_name,&new_name,map_city_check_input_name))
#endif
			{
		//		ComUniStrToAsc(new_name,p_sys_data->map_city_name[curitem]);
				ComUniStrCopyChar(p_sys_data->map_city_name[curitem], new_name);

			}
			
			OSD_TrackObject(ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			break;
		case VACT_MAP_CITY_ADD:
			if (OSD_GetObjListCount(ol) == MAP_CITY_MAX_NUM)
			{
				win_compopup_init(WIN_POPUP_TYPE_OK);
				win_compopup_set_msg(NULL,NULL,RS_LIST_IS_FULL);
				win_compopup_open_ext(&back_saved);
				break;
			}
			
			memset(uni_name, 0x0, sizeof(uni_name));
#ifndef KEYBOARD_SUPPORT
			if(win_rename_open(uni_name,&new_name, map_city_check_input_name))
#else
			if(win_keyboard_rename_open(uni_name,&new_name,map_city_check_input_name))
#endif
			{
	//				ComUniStrToAsc(new_name, p_sys_data->map_city_name[OSD_GetObjListCount(ol)]);
				ComUniStrCopyChar(p_sys_data->map_city_name[OSD_GetObjListCount(ol)],new_name);
			}
			
			map_city_list_load();
			OSD_TrackObject(ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			break;
		case VACT_MAP_CITY_DEL:
			map_city_delete(curitem);
			map_city_list_load();
			OSD_TrackObject(ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			break;			
		case VACT_MAP_CITY_DOWNLOAD:
			city_index = curitem;
			map_download(p_sys_data->map_city_name[curitem], 14);
			bMapDownloading = TRUE;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL,NULL,RS_CONNECTING_WAIT);
			win_compopup_open_ext(&back_saved);
			break;
		case VACT_MAP_SEARCH:
			memset(search_string, 0x0, sizeof(search_string));

			if (win_map_search_input_menu_open(search_string))
			{
				map_download(search_string, 14);
				bMapDownloading = FALSE;
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg(NULL,NULL,RS_CONNECTING_WAIT);
				win_compopup_open_ext(&back_saved);
			}
			break;

		default:
			break;
	}

	return ret;
}
static PRESULT atnsetm_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 bID;
	UINT8 back_saved;
	win_popup_choice_t choice;
	UINT32 i,n;
	S_NODE s_node;
	POBJECT_HEAD submenu;
	BOOL b;
	
	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			if(bID == MOTORSET_ID || bID == LIMIT_SETUP)
			{
				b = win_atnsetm_check_save_motor_antenna_setting();
				if(!b)
				{
					win_compopup_init(WIN_POPUP_TYPE_OK);
					win_compopup_set_msg(NULL, NULL, RS_MSG_OUT_RANGE);
					win_compopup_open_ext(&back_saved);
					ret = PROC_LOOP;
					break;
				}
			}
			
				
			if(bID == RESETPOS_ID)
			{
				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_msg(NULL, NULL, RS_ARE_YOU_SURE_CLEAR_SET_SATE_POSITON);
				//choice = win_compopup_open_ext(&back_saved);
				choice = win_compopup_open_enh((POBJECT_HEAD)&g_win_antenna_set_motor, 1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

				if(choice != WIN_POP_CHOICE_YES)
					break;

				/* Reset all satellite's position of current tuner to 0*/				
				n = get_sat_num(VIEW_ALL);
				recreate_sat_view(VIEW_ALL,0);
				for(i=0;i<n;i++)
				{ 
					get_sat_at(i,VIEW_ALL,&s_node);

					if( (antset_cur_tuner == 0 && s_node.position!= 0)
						|| (antset_cur_tuner == 10 && s_node.tuner2_antena.position!= 0) )
					{
						if(antset_cur_tuner == 0)
							s_node.position = 0;
						else
							s_node.tuner2_antena.position = 0;	
						modify_sat(s_node.sat_id,&s_node);							
					}
				}
				update_data();
			}
			else if(bID == MOTORSET_ID)
			{
				submenu = (POBJECT_HEAD)&g_win_motorset;
				if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_MENU | bID) != PROC_LEAVE)
					menu_stack_push(submenu);					
					
			}
			else if(bID == LIMIT_SETUP)
			{
				submenu = (POBJECT_HEAD)&g_win_motor_limitsetup;
				if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_MENU | bID) != PROC_LEAVE)
					menu_stack_push(submenu);					
			}
		}
	}

	return ret;
}
Exemple #7
0
static PRESULT map_city_list_unact_proc(VACTION act)
{
	PRESULT ret = PROC_PASS;
	OBJLIST* ol;
	UINT16 curitem;
	UINT8 back_saved;
 	SYSTEM_DATA* p_sys_data = sys_data_get();
	UINT16 uni_name[30];
	UINT8* new_name;
	char strTmp[30];
	char strTmp1[30];
	char strTmp2[30];
	
	ol = &ol_map_city;
	curitem = OSD_GetObjListNewPoint(ol);
	
	switch (act)
	{
		case VACT_MAP_CITY_EDIT:
			//ComAscStr2Uni(p_sys_data->map_city_name[curitem], uni_name);
			MEMCPY(uni_name,(UINT16*)p_sys_data->map_city_name[curitem],(MAP_CITY_NAME_LEN + 1));
			wincom_close_help();
#ifndef KEYBOARD_SUPPORT
			if(win_rename_open(uni_name,&new_name,map_city_check_input_name))
#else
#if (defined(GZ1105002)||defined(GZ1105003)||defined(GZ1105004)||defined(GZ1105005)||defined(GZ1105006))	
			if(win_rename_open(uni_name,&new_name,map_city_check_input_name))
#else
			if(win_keyboard_rename_open(uni_name,&new_name,map_city_check_input_name))
#endif				
#endif
			{
				//ComUniStrToAsc(new_name,p_sys_data->map_city_name[curitem]);
				ComUniStrCopyChar(p_sys_data->map_city_name[curitem], new_name);
			}		
			wincom_open_help_OK_list_small((POBJECT_HEAD)&g_win_map_city, map_city_helpinfo, HELP_CNT);
			OSD_TrackObject(ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			break;
		case VACT_MAP_CITY_ADD:
			if (OSD_GetObjListCount(ol) == MAP_CITY_MAX_NUM)
			{
				win_compopup_init(WIN_POPUP_TYPE_OK);
				ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_THE_LIST_IS_FULL),strTmp);
				win_compopup_set_msg((UINT8*)strTmp,NULL,0);
				win_compopup_open_ext(&back_saved);
				break;
			}
			
			memset(uni_name, 0x0, sizeof(uni_name));
			wincom_close_help();
#ifndef KEYBOARD_SUPPORT
			if(win_rename_open(uni_name,&new_name, map_city_check_input_name))
#else
#if (defined(GZ1105002)||defined(GZ1105003)||defined(GZ1105004)||defined(GZ1105005)||defined(GZ1105006))	
			if(win_rename_open(uni_name,&new_name, map_city_check_input_name))
#else
			if(win_keyboard_rename_open(uni_name,&new_name,map_city_check_input_name))
#endif
#endif
			{
				//ComUniStrToAsc(new_name, p_sys_data->map_city_name[OSD_GetObjListCount(ol)]);
				ComUniStrCopyChar(p_sys_data->map_city_name[OSD_GetObjListCount(ol)],new_name);
			}
			
			map_city_list_load();
			wincom_open_help_OK_list_small((POBJECT_HEAD)&g_win_map_city, map_city_helpinfo, HELP_CNT);
			OSD_TrackObject(ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			break;
		case VACT_MAP_CITY_DEL:
			map_city_delete(curitem);
			map_city_list_load();
			OSD_TrackObject(ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			break;			
		case VACT_MAP_CITY_DOWNLOAD:
			city_index = curitem;
			s_mapdl_handle = map_download(p_sys_data->map_city_name[curitem], 14);
			bMapDownloading = TRUE;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			//ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_CONNECTINF_WAITE),strTmp1);
			win_compopup_set_msg(/*(UINT8*)strTmp1*/NULL,NULL,RS_CONNECTINF_WAITE);
			win_compopup_open_ext(&back_saved);
			break;
		case VACT_MAP_SEARCH:
			memset(search_string, 0x0, sizeof(search_string));
			wincom_close_help();
			if (win_map_search_input_menu_open(search_string))
			{
				s_mapdl_handle = map_download(search_string, 14);
				bMapDownloading = FALSE;
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				//ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_CONNECTINF_WAITE),strTmp2);
				win_compopup_set_msg(/*(UINT8*)strTmp2*/NULL,NULL,RS_CONNECTINF_WAITE);
				win_compopup_open_ext(&back_saved);
			}
			wincom_open_help_OK_list_small((POBJECT_HEAD)&g_win_map_city, map_city_helpinfo, HELP_CNT);
			break;

		default:
			break;
	}

	return ret;
}
Exemple #8
0
/*****************************************************
Interface : void GetListChapterInfo(UINT16 top);
Function  : set each item's display content of list
Author    : Wu Jianwen
Date      : 2010.8.25
Input     : top:first item of list
Output    : NONE
Return    : NONE
******************************************************/
void GetListChapterInfo(INT16 top)
{
	UINT8 len = 0;
	UINT8 i = 0;
	INT32 hh,mm,ss;         //start time
	INT32 hh2,mm2,ss2;      //end time
	UINT8 arr_DataTemp[50];
	UINT8  back_saved;
	INT32 i_TotalChapter = 0;      //the total chapter of the video
	INT32 i_CurChapStartTime = 0;   //current chapter start time
	INT32 i_CurChapEndTime = 0;     //current chapter end time
	INT32 i_DestChapStartTime = 0;  //Dest chapter start time
	INT32 i_DestChapEndTime = 0;    //Dest chapter end time
	INT32 i_DestChapter = 0;        //dest chapter num
    INT32 i_CurChapter = 1;         //current chapter num
    INT32 i_ChapterChange = 0;
	DEC_CHAPTER_INFO t_ChapterInfo; //save chapter info of the stream
	

	MEMSET(&t_ChapterInfo,0,sizeof(DEC_CHAPTER_INFO));
	t_ChapterInfo.dst_chapter = -1;
	MpgFileGetChapterInfo(&t_ChapterInfo);   //get the current chapter info 
	i_CurChapter = t_ChapterInfo.cur_chapter;   //begin with chapter
	i_TotalChapter = t_ChapterInfo.nb_chapter;
			
	if(i_TotalChapter > 1)   //only chapter num > 1 can switch
	{
		if(top > i_TotalChapter)
		{
			top = 0;
			OSD_SetListCurPos(&g_ls_chapter,0);
			OSD_SetListTop(&g_ls_chapter,0);
		}
		i = 0;
		for(i = 0;i < CHAPTER_ITEM_NUMBER;i++)
		{
			i_ChapterChange = top + i;
			if(i_ChapterChange < i_TotalChapter)
			{
				i_DestChapter = i_ChapterChange;
				t_ChapterInfo.dst_chapter = i_DestChapter;
				MpgFileGetChapterInfo(&t_ChapterInfo);
				i_DestChapStartTime = t_ChapterInfo.dst_start_time / 1000;
				hh = i_DestChapStartTime / 3600;
				mm = (i_DestChapStartTime % 3600) / 60;
				ss = i_DestChapStartTime % 60;
				i_DestChapEndTime = t_ChapterInfo.dst_end_time / 1000;
				hh2 = i_DestChapEndTime / 3600;
				mm2 = (i_DestChapEndTime % 3600) / 60;
				ss2 = i_DestChapEndTime % 60;

				arr_DataTemp[0] = hh;
				arr_DataTemp[1] = mm;
				arr_DataTemp[2] = ss;
				arr_DataTemp[3] = hh2;
				arr_DataTemp[4] = mm2;
				arr_DataTemp[5] = ss2;
				win_com_set_idx_str2(arr_DataTemp, &Chapter_track_str[i][0],6);
				win_com_set_idx_str(top+i, Chapter_track_idx[i], 2);
			}		
			else
			{
				//memset(&Chapter_track_idx[i],0,40);
				break;
			}
		}
	}
	else
	{
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H);
        win_compopup_set_msg_ext("There is only one chapter!",NULL,0);
        win_compopup_open_ext(&back_saved);
        osal_task_sleep(1500);
        win_compopup_smsg_restoreback();
	}
}
static PRESULT sudoku_key_proc(UINT32 vkey, UINT8 key_repeat_cnt, UINT8 key_status)
{
	PRESULT ret = PROC_LOOP;
	UINT8   back_saved;
	UINT8	pos;
	UINT8 i;
	if (key_status == PAN_KEY_PRESSED)
	{
		switch (vkey)
		{
			case V_KEY_UP:
			case V_KEY_DOWN:
			case V_KEY_LEFT: 
			case V_KEY_RIGHT: 
				sudoku_draw_grid(cur_row, cur_col);
				if (vkey == V_KEY_UP)
				{
				cur_row = cur_row == 0 ? 8 : cur_row - 1;
				}
				else if (vkey == V_KEY_DOWN)
				{
				cur_row = cur_row == 8 ? 0 : cur_row + 1;
				}
				else if (vkey == V_KEY_LEFT)
				{
				cur_col = cur_col == 0 ? 8 : cur_col - 1;
				}
				else if (vkey == V_KEY_RIGHT)
				{
				cur_col = cur_col == 8 ? 0 : cur_col + 1;
				}
				sudoku_draw_cursor(cur_row, cur_col);
				break;

			case V_KEY_0:
				pos = cur_row*BOARD_COLS+cur_col;
				if(!IS_FIXED(pos))
				{
					if(pboard[pos]!=' ')
					{
						pboard[pos]=' ';
    					sudoku_draw_cursor(cur_row, cur_col);
					}
				}
				break;
				
			case V_KEY_1:	case V_KEY_2:	case V_KEY_3:
			case V_KEY_4:	case V_KEY_5:	case V_KEY_6:	case V_KEY_7:
			case V_KEY_8:	case V_KEY_9:
				pos = cur_row*BOARD_COLS+cur_col;
				if(!IS_FIXED(pos))
				{
					pboard[pos]=(vkey-V_KEY_0)+0x30;
    				sudoku_draw_cursor(cur_row, cur_col);
				}
				for (i=0;i<81 ;i++ )
					if(pboard[i]==' ')
						break;
				if(i==81)
				{
					for (i=0;i<81 ;i++ )
						if(pboard[i]!=(GET_DIGIT(solved_board[i])+0x30))
							break;
				}
	
				if(i==81)
				{
					completed=1;
					win_compopup_init(WIN_POPUP_TYPE_OK);
					win_compopup_set_frame(GAME_MSG_LEFT,   GAME_MSG_TOP, GAME_MSG_WIDTH,GAME_MSG_HEIGHT);
					win_compopup_set_msg(NULL, NULL, RS_GAME_YOU_WIN);
					if (win_compopup_open_ext(&back_saved) == WIN_POP_CHOICE_YES)
					{
                        sudoku_draw_board();
						//sudoku_draw_grid(cur_row, cur_col);
						OSD_SetAttr((POBJECT_HEAD)&txt_newgame, C_ATTR_ACTIVE);
						OSD_ChangeFocus((POBJECT_HEAD)&game_sudoku_con, 1, \
						C_UPDATE_FOCUS | C_DRAW_SIGN_EVN_FLG);
					}
				}
				break;
			case V_KEY_MENU:
			case V_KEY_EXIT:
				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_frame(GAME_MSG_LEFT,   GAME_MSG_TOP, GAME_MSG_WIDTH,GAME_MSG_HEIGHT);
				win_compopup_set_msg(NULL, NULL, RS_GAME_MSG_DO_YOU_QUIT);
				if (win_compopup_open_ext(&back_saved) == WIN_POP_CHOICE_YES)
				{
                    sudoku_draw_board();
					//sudoku_draw_grid(cur_row, cur_col);
					OSD_SetAttr((POBJECT_HEAD)&txt_newgame, C_ATTR_ACTIVE);
					OSD_ChangeFocus((POBJECT_HEAD)&game_sudoku_con, 1, \
					C_UPDATE_FOCUS | C_DRAW_SIGN_EVN_FLG);
				}
                else
                {
                    sudoku_draw_board();
					sudoku_draw_cursor(cur_row, cur_col);
                }
				break;
			default :
				ret = PROC_PASS;
				break;
		}
	}

	return ret;
}
static PRESULT othello_key_proc(UINT32 vkey, UINT8 key_repeat_cnt, UINT8 key_status)
{
	PRESULT ret = PROC_LOOP;
	UINT8 back_saved;
	if (key_status == PAN_KEY_PRESSED)
	{
		switch (vkey)
		{
			case V_KEY_UP:
			case V_KEY_DOWN:
			case V_KEY_LEFT:
			case V_KEY_RIGHT:
				draw_cursor(cur_row, cur_col, WSTL_GAME_BACKGROUND_IDX);
				if (vkey == V_KEY_UP)
				{
					cur_row = cur_row == 0 ? 7 : cur_row - 1;
				}
				else if (vkey == V_KEY_DOWN)
				{
					cur_row = cur_row == 7 ? 0 : cur_row + 1;
				}
				else if (vkey == V_KEY_LEFT)
				{
					cur_col = cur_col == 0 ? 7 : cur_col - 1;
				}
				else if (vkey == V_KEY_RIGHT)
				{
					cur_col = cur_col == 7 ? 0 : cur_col + 1;
				}
				draw_cursor(cur_row, cur_col, WSTL_GAME_CURSOR_IDX);
				break;

			case V_KEY_ENTER:
				if (do_move_chess(&chess_board, (cur_row + 1) *10+(cur_col + 1), ~computer_side &3, callback))
				{
					draw_cursor(cur_row, cur_col, WSTL_GAME_BACKGROUND_IDX);

					get_chess_score(&chess_board, &WhitePoint, &BlackPoint);
					update_status(Class, BlackPoint, WhitePoint);

					/* computer round */
					computer_play(&chess_board, callback);

					get_chess_score(&chess_board, &WhitePoint, &BlackPoint);
					update_status(Class, BlackPoint, WhitePoint);

					draw_cursor(cur_row, cur_col, WSTL_GAME_CURSOR_IDX);
				}
				break;

			case V_KEY_MENU:
			case V_KEY_EXIT:
				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_frame(GAME_MSG_LEFT, GAME_MSG_TOP, GAME_MSG_WIDTH, GAME_MSG_HEIGHT);
				win_compopup_set_msg_ext(NULL, NULL, RS_GAME_MSG_DO_YOU_QUIT);
				if (win_compopup_open_ext(&back_saved) == WIN_POP_CHOICE_YES)
				{
					othello_init();
                    OSD_ObjOpen((POBJECT_HEAD)&game_con, 0xFFFFFFFF) ;  
					/*othello_init();
					othello_draw_background();
					update_status(Class, BlackPoint, WhitePoint,TRUE);
					OSD_SetAttr((POBJECT_HEAD) &txt_start, C_ATTR_ACTIVE);
					OSD_ChangeFocus((POBJECT_HEAD) &game_con, 1,  \
						C_UPDATE_FOCUS | C_DRAW_SIGN_EVN_FLG);*/
				}
				break;
			default:
				ret = PROC_PASS;
				break;
		}
	}

	return ret;
}
Exemple #11
0
void change_channel(INT32 shift)
{
	UINT16 cur_channel,max_channel;
    P_NODE p_node;
    UINT32 n;
    SYSTEM_DATA* sys_data;
	UINT16 cur_tp_id;
    UINT8  cur_ca_mode;
	UINT8 change_enable = TRUE;
    sys_data = sys_data_get();

#if 0//def PVR_DMX_DELAY_SUPPORT          //guop edit 20110118
	if (api_pvr_is_recording())
	{
		UINT8 back_saved;
		win_compopup_init(WIN_POPUP_TYPE_OK);					   
		win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H);
		win_compopup_set_msg("Please stop record, then change channel!",NULL,0);
		win_compopup_open_ext(&back_saved);
		return;
	}
#endif

	//max_channel = get_node_num(TYPE_PROG_NODE, NULL);
	max_channel = get_prog_num(VIEW_ALL|sys_data->cur_chan_mode[sys_data->normal_group_idx], 0);
    if(max_channel==0)
        return ;
	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	get_prog_at(cur_channel, &p_node);
	cur_tp_id = p_node.tp_id;
    cur_ca_mode = p_node.ca_mode;
	//libc_printf("cur_tp_id = %d, cur_channel= %d\n",cur_tp_id,cur_channel);

    if( !(show_and_playchannel && shift==0) )
    {
        n = 0;
        do{
    	    cur_channel = (cur_channel + shift + max_channel) % max_channel;
            get_prog_at(cur_channel, &p_node);
            if(shift==0)
                shift = 1;
            n++;
         }while( (p_node.skip_flag  
                    || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode)
                    || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode))   
                  && n!=max_channel);
        
        if(p_node.skip_flag || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode)
                    || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode))
            return ;
    }

#if ((!defined(NEW_DEMO_FRAME)) || \
	 (defined(NEW_DEMO_FRAME) && defined(CC_USE_TSG_PLAYER)))
#ifdef DVR_PVR_SUPPORT
	if (api_pvr_is_recording())
	{
		if (p_node.tp_id == cur_tp_id)
		{
			change_enable = TRUE;

			if (cur_ca_mode && (sys_data_get_scramble_record_mode() == 1) &&
				api_pvr_is_record_active() && api_pvr_is_recording_cur_prog())
			{
				change_enable = FALSE;
			}
		}
		else
		{
			change_enable = FALSE;
		}
	}
	
	if (!change_enable)
	{
		UINT8 back_saved;
		win_compopup_init(WIN_POPUP_TYPE_OK); 					   
		win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W+100, MSG_POPUP_LAYER_H);
		win_compopup_set_msg("Please stop record, then change channel!",NULL,0);
		win_compopup_open_ext(&back_saved);
	}
#endif
#endif

	if(change_enable)
	{
	    /*  If first time show the osd and play channel,
	        to avoid display incorrect channel when meet skip channel.
	    */
		if(show_and_playchannel)
	    {
	        sys_data_set_cur_group_channel(cur_channel);
	        win_progname_redraw();
	    }


		for(n=0;n<MAX_TIMER_NUM;n++)
		{//bug30192.when timer play,if change channel,cancel timer duration.
			if((sys_data->timer_set.TimerContent[n].wakeup_state == TIMER_STATE_RUNING) 
				&& (sys_data->timer_set.TimerContent[n].wakeup_duration_time > 0)
				&& (sys_data->timer_set.TimerContent[n].timer_service == TIMER_SERVICE_CHANNEL))
				sys_data->timer_set.TimerContent[n].wakeup_duration_time = 0;
		}

		api_play_channel(cur_channel, TRUE, TRUE,FALSE);
#ifdef MULTIFEED_SUPPORT
        if(multifeed_have_feed(p_node.prog_id))
        {
            UINT32 hk;
            ap_vk_to_hk(0, V_KEY_RED, &hk);
            ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hk, TRUE);
        }
#endif
	}
}
Exemple #12
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);

	switch(event)
	{
		case EVN_PRE_OPEN:
			bMapDownloading = FALSE;
			map_city_list_load();
			break;
		case EVN_POST_OPEN:
			wincom_open_subtitle(pObj,RS_MAP,0);
			wincom_open_help(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 LOGO_IN_RAM
			api_show_Test_logo_2(internet_osd4,get_logo_h_file_size(6));
#else
			api_show_Test_logo( LOGO_ID_TYPE|0X0200|focusID);
#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();
					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);		
					win_compopup_set_msg(NULL,NULL,RS_ERROR);
					win_compopup_open_ext(&back_saved);
					ret = PROC_LOOP;
				}
			}
			break;
		default:
			break;
	}

	return ret;
}
Exemple #13
0
static PRESULT otaupg_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	INT32 btn_state;
	UINT8 back_saved;
	
	UINT8	id = OSD_GetObjID(pObj);
	

	switch(event)
	{
	case EVN_PRE_OPEN:
        system_state = SYS_STATE_OTA_UPG;
		//p_otaosd_buff = MALLOC(OSD_VSRC_MEM_MAX_SIZE);
		epg_release();
		if(win_otaupg_set_memory() != 0)
		{
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg(NULL, NULL, RS_NO_ENOUGH_MEMORY);
			win_compopup_open_ext(& back_saved);
			return PROC_LEAVE;
		}
		wincom_open_subtitle((POBJECT_HEAD)&g_win_otaupg,RS_TOOLS_SW_UPGRADE_BY_OTA, 0);
		win_otaupg_get_info();
		win_otaup_set_btn_msg_display(FALSE);
		win_otaup_set_swinfo_display(FALSE);
		win_otaupg_init();

		break;
		
	case EVN_POST_OPEN:
		break;
	
	case EVN_PRE_CLOSE:
        if(ota_proc_step == OTA_STEP_BURNFLASH && ota_proc_ret != PROC_FAILURE)
        {
            ret = PROC_LOOP;
            break;
        }
        else
        {
            //btn_state = win_otaup_get_btn_state();
            if(ota_proc_ret == 0)
            {
                ota_stop_service();
				//ota_user_stop = 1;
            }
        }
  /*          
		if(btn_state == 0)
		{
			if(!ota_user_stop)
			{
				ota_stop_service();
				ota_user_stop = 1;					
			}
		}
		
		if(btn_state != 1)
			ret = PROC_LOOP;
*/
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		
		break;

	case EVN_POST_CLOSE:
		if(p_otaosd_buff != NULL)
		{
			OSD_TaskBuffer_Free(OSAL_INVALID_ID,p_otaosd_buff);
		}
		epg_init(SIE_EIT_WHOLE_TP, (UINT8*)__MM_EPG_BUFFER_START/*buffer*/, __MM_EPG_BUFFER_LEN, ap_epg_call_back);
		system_state = SYS_STATE_NORMAL;
#ifndef _BUILD_OTA_E_
		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
#endif
		break;
    case EVN_UNKNOWN_ACTION:
        ret = PROC_LOOP;
		break;
	case EVN_MSG_GOT:
		ret = win_otaupg_message_proc(param1,param2);
		break;
	}
	return ret;
}
Exemple #14
0
static PRESULT sys_backup_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	UINT8 bID,back_saved;
	UINT16 block_idx,file_idx,popup_strid;
	INT32 vscr_idx,length,fileread_ret;
	char str_buff[20];
	void *pBuff;
	BOOL burnflash_ret;
	VACTION unact;
	PRESULT ret;
	PMULTISEL pMsel;
	lpVSCR apVscr;
	win_popup_choice_t choice;
	UINT8 tmp[4];
	UINT8 block_name[20];
	UINT8 file_extention[4];
	UINT8 file_name[24];
	UINT32 chunk_offset;
	USB_BACKUP_MODE_TYPE_E usb_backup_mode;
	
	ret = PROC_PASS;	
	bID = OSD_GetObjID(pObj);
	switch(event)
	{
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);
			if(unact == VACT_ENTER && bID == START_ID)
			{
//				start_backup =1;
				win_sys_backup_msg_clear();
				win_sys_backup_process_update(0);
				vscr_idx = osal_task_get_current_id();
				apVscr = OSD_GetTaskVscr(vscr_idx);

				popup_strid = RS_SYS_BACKUP_ALERT_NOPLUG;
				
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg(NULL,NULL, popup_strid);
				win_compopup_open_ext(&back_saved);
				osal_task_sleep(2000);
				win_compopup_smsg_restoreback();
				
				OSD_SetAttr(&sys_backup_item_con1, C_ATTR_INACTIVE);
				OSD_SetAttr(&sys_backup_item_con2, C_ATTR_INACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con1, C_UPDATE_ALL);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con2, C_UPDATE_ALL);

				pMsel = &sys_backup_sel_upgrade_type;
				usb_backup_mode = OSD_GetMultiselSel(pMsel);
				switch(usb_backup_mode)
				{
					case EM_BACKUP_MODE_TOTAL_FLASH:
						block_idx = 0;
						break;

					case EM_BACKUP_MODE_USER_DATA:
						block_idx = usbupg_get_block_index(USBUPG_USERDB);
						break;

#ifdef EANBLE_BAKUP_CCCAM_NEWCAMD_DATA					
					case EM_BACKUP_MODE_CCCAM_NEWCAMD:
						block_idx = usbupg_get_block_index(USBUPG_CCCAM_NEWCAMD);
						break;
#endif
#ifdef ENABLE_SOFT_CAM_KEY					
					case EM_BACKUP_MODE_SOFTCAM:
						block_idx = usbupg_get_block_index(USBUPG_SOFTCAM);
						break;
#endif
					
					default:
//						start_backup =0;
						ASSERT(0);
						return;
				}

				usbupg_get_blockinfo(block_idx, block_name, &chunk_offset);
				usb_backup_get_file_filter(usb_backup_mode, file_extention, tmp);
				sprintf(file_name, "%s.%s", block_name, file_extention);
				string_to_lower(file_name);
				//libc_printf("[sys_backup_item_callback]block_idx = %d, block_name = %s, file_extention = %s, file_name = %s", block_idx, block_name, file_extention, file_name);

#ifdef EANBLE_BAKUP_CCCAM_NEWCAMD_DATA
				if(EM_BACKUP_MODE_CCCAM_NEWCAMD == usb_backup_mode)
				{
					//save the cccam data and newcamd data(first 16 group data)
					ret = usbupg_dump_flash2(CccamNewcamdBackup,(64*1024),file_name, win_sys_backup_process_update);
				}
				else
#endif
#ifdef ENABLE_SOFT_CAM_KEY
				if(EM_BACKUP_MODE_SOFTCAM == usb_backup_mode)
				{
					//save the softcam data
					ret = usbupg_dump_flash2(softcam_backup, 64*1024,file_name, win_sys_backup_process_update);
				}
				else
#endif
				{
				#if 1//def WANGYANG
					ret = usbupg_dump_flash3(block_idx, file_name, win_sys_backup_process_update,win_progress_bar_draw_bmp);
				#else
					ret = usbupg_dump_flash(block_idx, file_name, win_sys_backup_process_update);
				#endif
				}

				if (ret ==RET_SUCCESS)
				{
					popup_strid = RS_MSG_BACKUP_SUCCESS;
				}
				else
				{
					popup_strid = RS_OTA_UPGRADE_FAIL;
				}

ERROR_HANDLER:
			
				OSD_SetAttr(&sys_backup_item_con1, C_ATTR_ACTIVE);
				OSD_SetAttr(&sys_backup_item_con2, C_ATTR_ACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con1, C_UPDATE_ALL);
				OSD_TrackObject( (POBJECT_HEAD)&sys_backup_item_con2, C_UPDATE_ALL);
				OSD_UpdateVscr(apVscr);
//				start_backup =0;
				
				if(popup_strid != 0)
				{
					win_sys_backup_msg_update(popup_strid);
					
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, popup_strid);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(2000);
					win_compopup_smsg_restoreback();
				}

				return ret;
			}
			break;
	}

	return ret;
}
Exemple #15
0
static VACTION map_display_keymap(POBJECT_HEAD pObj, UINT32 key)
{
	VACTION act = VACT_PASS;
	SYSTEM_DATA *p_sys_data = sys_data_get();
	UINT8 back_saved;

	switch(key)
	{
		case V_KEY_EXIT:
		case V_KEY_MENU:
			act = VACT_CLOSE;
			break;
		case V_KEY_RED:
			if (bMapDownloading)
			{
				break;
			}
			if (zoom_level < 21)
			{
				zoom_level++;
			}
			
			libc_printf("zoom level = %d\n", zoom_level);

			if (search_string[0] == '\0')
			{
				s_mapdisp_dl_handle = map_download(p_sys_data->map_city_name[city_index], zoom_level);
			}
			else
			{
				s_mapdisp_dl_handle = map_download(search_string, zoom_level);
			}
			bMapDownloading = TRUE;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL,NULL,RS_CONNECTING_WAIT);
			win_compopup_open_ext(&back_saved);
			 osal_task_sleep(1000);
	      		win_compopup_smsg_restoreback();
			break;
		case V_KEY_GREEN:
			if (bMapDownloading)
			{
				break;
			}
			if (zoom_level != 0)
			{
				zoom_level--;
			}
			libc_printf("zoom level = %d\n", zoom_level);
			if (search_string[0] == '\0')
			{
				s_mapdisp_dl_handle = map_download(p_sys_data->map_city_name[city_index], zoom_level);
			}
			else
			{
				s_mapdisp_dl_handle = map_download(search_string, zoom_level);
			}
			bMapDownloading = TRUE;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL,NULL,RS_CONNECTING_WAIT);
			win_compopup_open_ext(&back_saved);
			 osal_task_sleep(1000);
	      		win_compopup_smsg_restoreback();
			break;
		case V_KEY_ZOOM:
			win_mpzoom_open();
			break;
		default:
			act = VACT_PASS;
			break;
	}

	return act;
}
Exemple #16
0
static PRESULT satfav_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	OBJLIST* ol= &satfav_item_list;
	UINT8 vkey = 0xFF;
	UINT8 av_flag,grp_cnt,back_saved;

	switch(event)
	{
	case EVN_PRE_OPEN:
        api_inc_wnd_count();
		if( (param2 & MENU_OPEN_TYPE_MASK) == MENU_OPEN_TYPE_KEY)
			vkey =  param2 & MENU_OPEN_PARAM_MASK;
		
		//if(vkey == V_KEY_SAT || vkey == V_KEY_FAV)
			if(vkey == V_KEY_BLUE || vkey == V_KEY_FAV)
	{
			av_flag = sys_data_get_cur_chan_mode();
			
	//		sat_fav_list_flag = (vkey == V_KEY_SAT)? 0 : 1;
			sat_fav_list_flag = (vkey == V_KEY_BLUE)? 0 : 1;
			if(sat_fav_list_flag == 0)
				grp_cnt = sys_data_get_sate_group_num(av_flag);
			else
				grp_cnt = sys_data_get_fav_group_num(av_flag);
			if(grp_cnt == 0)
			{
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg("No FAV Channels", NULL, 0);
				win_compopup_open_ext(&back_saved);
				osal_task_sleep(1000);
				win_compopup_smsg_restoreback();
				ret = PROC_LEAVE;
                api_dec_wnd_count();
				break;
			}	
		}
		else
		{
			ret = PROC_LEAVE;
            api_dec_wnd_count();
			break;
		}


		win_satfav_load_groupcount();
		
		break;	
	case EVN_POST_OPEN:
		break;		
	case EVN_PRE_CLOSE:
		break;
	case EVN_POST_CLOSE:
        api_dec_wnd_count();
		break;
	case EVN_UNKNOWN_ACTION:
		break;
		
	default:
		break;
	}

	return ret;


}
Exemple #17
0
static PRESULT win_search_update_progress(UINT8 progress_prec)
{	
	UINT8 result = PROC_LOOP;
	win_popup_choice_t popup_result=WIN_POP_CHOICE_NULL;
	UINT8 back_save;
	PROGRESS_BAR* bar;
	TEXT_FIELD* txt;
	P_NODE node;
	UINT8 str[32];

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

	BOOL is_flash_full = FALSE;
	bar = &srch_progress_bar;
	txt = &srch_progress_txt;
	if(progress_prec == 150)
	{
		progress_prec = 100;
		is_flash_full = TRUE;
	}

	OSD_SetProgressBarPos(bar, progress_prec);
	if(progress_prec< 3)
		bar->wTickFg = WSTL_NOSHOW_IDX;
	else
		bar->wTickFg = PROGRESSBAR_PROGRESS_SH_IDX;
	OSD_SetTextFieldContent(txt, STRING_NUM_PERCENT,progress_prec);
	if(win_search_param.as_method != AS_METHOD_NIT_TP &&
		win_search_param.as_method != AS_METHOD_NIT&&
		win_search_param.as_method != AS_METHOD_MULTI_NIT)
	{
		OSD_DrawObject( (POBJECT_HEAD)bar, C_UPDATE_ALL);
		OSD_DrawObject( (POBJECT_HEAD)txt, C_UPDATE_ALL);
	}/*If search mode is AS_METHOD_NIT_TP/AS_METHOD_NIT/AS_METHOD_MULTI_NIT, do not show progress bar*/	

	
	if(progress_prec == 100) // is completed ?
	{
		// stop drawave timer, at first
		//osal_timer_activate(win_search_tmr_id, FALSE);
				
		if((srch_ch_cnt[0] != 0x0)  // radio
		|| (srch_ch_cnt[1] != 0x0))// tv
		{
			//win_search_save_data(TRUE);
		}
		else // not find
		{
			if(!is_flash_full)
			{
				INT32 ret = 0;

				if(pid_search_flg)		
				{
#ifdef NEW_DEMO_FRAME
					struct dmx_device *dmx = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, 0);
					ret = as_prog_pid_search(dmx, 1, pid_search_VPid,pid_search_APid, pid_search_PPid);
#else
					ret = as_prog_pid_search(1,pid_search_VPid,pid_search_APid,pid_search_PPid);
#endif
					if(ret)
					{//add node
						MEMSET(&node,0,sizeof(node));
						node.sat_id = pid_search_tp>>NODE_ID_TP_BIT;
						node.tp_id = pid_search_tp;
						node.video_pid = pid_search_VPid;
						node.audio_count = 1;
						node.audio_pid[0] = pid_search_APid;
						node.pcr_pid = pid_search_PPid;
						node.av_flag =1;
						sprintf(str,"tp%d_%d",node.tp_id,node.video_pid);
						ComAscStr2Uni(str, (UINT16*)node.service_name);
						if(SUCCESS!= lookup_node(TYPE_PROG_NODE, &node, node.tp_id))
						{
							add_node(TYPE_PROG_NODE, node.tp_id, &node);
							update_data();
						}
					}
				}
				if(!ret)
				{
                    win_search_last_tp_ok_failed(srch_tp_cnt);

					win_compopup_init(WIN_POPUP_TYPE_OK);
					win_compopup_set_msg(NULL,NULL,RS_MSG_NO_PROGRAM_FOUND);
					win_compopup_open_ext(&back_save);
				}
			}			
		}
		
		if(is_flash_full==TRUE)
		{
            win_search_last_tp_ok_failed(srch_tp_cnt);

			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg(NULL,NULL,RS_MSG_SPACE_FULL);
			win_compopup_open_ext(&back_save);
		}
		
		result = PROC_LEAVE;
	}
static PRESULT mlimit_itembtnset_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	struct nim_device *nim_dev;
	SYSTEM_DATA * sys_data = sys_data_get();
    UINT8 back_saved;

	nim_dev= antset_cur_tuner==0? g_nim_dev : g_nim_dev2;
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);

		if(motor_move_state != 0)
			goto STOP_MOVE;

		if(unact == VACT_MOVE_WEST)
		{
			if(LIMIT_OPT==0)
				break;
			
			api_diseqc_drive_motor_west(nim_dev,0);
			motor_move_state = 1;

SET_MOVE_DISPLAY:
			win_mlimit_draw_info(motor_move_state);
			win_mlimit_limitbtn_setstr(1);
			win_mlimit_limitbtn_draw(1);
		}
		else if(unact == VACT_MOVE_EAST)
		{
			if(LIMIT_OPT==0)
				break;

			api_diseqc_drive_motor_east(nim_dev,0);
			motor_move_state = 2;
			
			goto SET_MOVE_DISPLAY;
		}
		else if(unact == VACT_SET_LIMIT)
		{
			sys_data->motor_lmt = LIMIT_OPT;
			switch(LIMIT_OPT)
			{
			case 0:
				api_diseqc_disable_limits(nim_dev,0);
				break;
			case 1:
				api_diseqc_set_west_limit(nim_dev,0);
				break;
			case 2:
				api_diseqc_set_east_limit(nim_dev,0);
				break;
			}
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		win_compopup_set_msg(NULL, NULL, limit_btn_strids[LIMIT_OPT]);
		win_compopup_open_ext(&back_saved);
		osal_task_sleep(500);
		win_compopup_smsg_restoreback();
		}
		
		break;
	case EVN_UNKNOWNKEY_GOT:
		if(motor_move_state != 0)
		{
STOP_MOVE:
			api_diseqc_halt_motor(nim_dev,0);
			motor_move_state = 0;
			win_mlimit_draw_info(motor_move_state);
			win_mlimit_limitbtn_setstr(0);
			win_mlimit_limitbtn_draw(1);
		}
		break;
	}	

	return ret;
}
Exemple #19
0
static PRESULT srch_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT16 title_id;
	POBJECT_HEAD mainmenu;
	UINT8 av_flag;
	UINT16 cur_chan;
	UINT8 back_saved;
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		system_state = SYS_STATE_SEARCH_PROG;
		if(win_search_param.as_method == AS_METHOD_TP
			 || win_search_param.as_method == AS_METHOD_NIT_TP) // tp scan
				title_id = RS_INSTALLATION_TP_SCAN;
		else if(win_search_param.as_method == AS_METHOD_FFT 
	        || win_search_param.as_method == AS_METHOD_MULTI_FFT)//auto scan
	        title_id = RS_INSTALLATION_AUTO_SCAN; 
		else if(win_search_param.as_method == AS_METHOD_SAT_TP
	        ||win_search_param.as_method == AS_METHOD_MULTI_TP
	        || win_search_param.as_method == AS_METHOD_NIT
	        || win_search_param.as_method == AS_METHOD_MULTI_NIT)//preset scan
			title_id = RS_INSTALLATION_PRESET_SCAN;
		else
			title_id = RS_INSTALLATION_AUTO_SCAN;		
		wincom_open_subtitle(pObj,title_id,0);
/*Remove progress bar when search type is AS_METHOD_NIT_TP/AS_METHOD_NIT/AS_METHOD_MULTI_NIT*/
		if(win_search_param.as_method == AS_METHOD_NIT_TP ||
			win_search_param.as_method == AS_METHOD_NIT||
			win_search_param.as_method == AS_METHOD_MULTI_NIT)
		{
            OSD_SetAttr(&srch_progress_txt, C_ATTR_HIDDEN);
            OSD_SetAttr(&srch_progress_bar, C_ATTR_HIDDEN);
		}
        else
        {
            OSD_SetAttr(&srch_progress_txt, C_ATTR_ACTIVE);
            OSD_SetAttr(&srch_progress_bar, C_ATTR_ACTIVE);
        }

		key_pan_display("srch", 4);
		
		epg_off();
		stop_tdt();

#ifdef AUTOSCAN_BYPASS_CI
        // Before Autoscan, DMX0 bypass CI
		if(win_search_param.as_method == AS_METHOD_FFT 
	        || win_search_param.as_method == AS_METHOD_MULTI_FFT)//auto scan
		{
            tsi_dmx_src_select(TSI_DMX_0, TSI_TS_B);
            tsi_para_src_select(TSI_SPI_1,0);
            api_set_nim_ts_type(2, 0x03);			
		}
#endif
#ifdef HW_SS830C
            tsi_dmx_src_select(TSI_DMX_0, TSI_TS_B);	
	     api_set_nim_ts_type(2, 0x03);						
#endif

		break;
	case EVN_POST_OPEN:
		win_search_init();
		break;
	case EVN_PRE_CLOSE:
        win_search_pre_close = 1;
		osal_task_dispatch_off();
		moving_disk = 0;/*Clear moving dish flag*/
		win_search_stop_signal = 1;
		osal_task_dispatch_on();
		as_service_stop();
		db_search_exit();
		//api_stop_timer(&win_search_tmr_id);
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;			

		prog_callback_unregister();
		pid_search_flg = 0;
		break;
	case EVN_POST_CLOSE:
		if((srch_ch_cnt[0] != 0x0)
			|| (srch_ch_cnt[1] != 0x0))
		{
            win_search_last_tp_ok_failed(srch_tp_cnt);

			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_WAIT_FOR_SAVING);
			//win_compopup_open();
			win_compopup_open_ext(&back_saved);
			
			update_data();

			win_compopup_smsg_restoreback();
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg("Search End", NULL, 0);
			win_compopup_open_ext(&back_saved);

			/* Change to all satellite group */
            UINT32 grp_idx = sys_data_get_cur_group_index();

			sys_data_check_channel_groups();
			sys_data_set_cur_group_index(grp_idx);

			av_flag = sys_data_get_cur_chan_mode();

			if(sys_data_get_sate_group_num(av_flag) == 0)
			{
				av_flag = (av_flag == TV_CHAN)? RADIO_CHAN : TV_CHAN;
				sys_data_set_cur_chan_mode(av_flag);
			}
			if(av_flag == RADIO_CHAN && (srch_ch_cnt[1] != 0x0))        //guop add  20101231
			{
				av_flag = TV_CHAN;
				sys_data_set_cur_chan_mode(av_flag);
			}

			sys_data_change_group(grp_idx);

			if(srch_ch_cnt[av_flag] > 0)
			{
				cur_chan = get_prog_pos(win_search_cur_prog[av_flag].prog_id);
				if(cur_chan == 0xFFFF)
				{
                    grp_idx = get_sat_pos(cur_sat_id) + 1;
        			sys_data_change_group(grp_idx);
    				cur_chan = get_prog_pos(win_search_cur_prog[av_flag].prog_id);
                    if (cur_chan == 0xFFFF)
                    {
            			sys_data_change_group(0);
        				cur_chan = get_prog_pos(win_search_cur_prog[av_flag].prog_id);
                        if (cur_chan == 0xffff)
    					    cur_chan = 0;
                    }
				}
				sys_data_set_cur_group_channel(cur_chan);
			}
			else if(sys_data_get_sate_group_num(av_flag))
				key_pan_display("noCH", 4);
			else
				key_pan_display("----", 4);
			sys_data_save(1);
			epg_reset();
		}

		OSD_ClearObject( (POBJECT_HEAD)&srch_progress_bar, C_UPDATE_ALL);
		OSD_ClearObject( (POBJECT_HEAD)&srch_progress_txt, C_UPDATE_ALL);

		mainmenu = (POBJECT_HEAD)&g_win_mainmenu;
		OSD_TrackObject(mainmenu,C_UPDATE_ALL);

#ifdef AUTOSCAN_BYPASS_CI
        // After Autoscan, DMX0 NOT bypass CI
		if(win_search_param.as_method == AS_METHOD_FFT 
	        || win_search_param.as_method == AS_METHOD_MULTI_FFT)//auto scan
		{
            tsi_dmx_src_select(TSI_DMX_0, TSI_TS_A);
            tsi_para_src_select(TSI_SPI_1,0);
		}
#endif
		start_tdt();
		system_state = SYS_STATE_NORMAL;
		
		break;
	case EVN_MSG_GOT:
		ret = win_search_message_proc(param1,param2);		
		break;

	}

	return ret;
}
Exemple #20
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);

	switch(event)
	{
		case EVN_PRE_OPEN:
			bMapDownloading = FALSE;
			map_city_list_load();
			break;
		case EVN_POST_OPEN:
			wincom_open_subtitle(pObj,RS_MAP,0);
			wincom_open_help(pObj, map_city_helpinfo, HELP_CNT);
			memset(search_string, 0x0, sizeof(search_string));
			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();
			wincom_close_help();
			OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
#ifdef LOGO_IN_RAM
#ifdef MAINMENU_TYPE_ONE
			api_show_Test_logo_2(MM_game3,get_logo_h_file_size(4));
#else
			api_show_Test_logo_2(MM_games,get_logo_h_file_size(4));
#endif
#else
			api_show_Test_logo( LOGO_ID_TYPE|0X0200|7);
#endif
			break;
		case EVN_MSG_GOT:
			if (param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH)
			{
				bMapDownloading = FALSE;
				if ((int)param2 >= 0)
				{
					win_compopup_smsg_restoreback();
					wincom_close_subtitle();
					wincom_close_help();
					if(OSD_ObjOpen(&g_win_map_display, 0) != PROC_LEAVE)
						menu_stack_push(&g_win_map_display);
				}
				else
				{
					win_compopup_smsg_restoreback();
					win_compopup_init(WIN_POPUP_TYPE_OK);		
					win_compopup_set_msg(NULL,NULL,RS_ERROR);
					win_compopup_open_ext(&back_saved);
					ret = PROC_LOOP;
				}
			}
			break;
		default:
			break;
	}

	return ret;
}
Exemple #21
0
static PRESULT win_progname_unkown_act_proc(VACTION act)
{
	PRESULT ret = PROC_LOOP;
	
	INT32 shift;
	UINT8 av_mode,back_saved;
	UINT16  channel;
	UINT16 strID;

#ifdef DVR_PVR_SUPPORT
	if(api_pvr_is_recording())
	{
		if( act != VACT_CH_UP && act != VACT_CH_DOWN)
		{
			return ret;
		}
	}
#endif

	api_stop_timer(&progname_timer);

	shift = -1;
	switch(act)
	{	
	case VACT_CH_UP:
		shift = 1;
	case VACT_CH_DOWN:
		change_channel(shift);
		break;
	case VACT_GRP_UP:
		shift = 1;
	case VACT_GRP_DOWN:
		change_group(shift);
		break;
	case VACT_FCH_UP:
		shift = 1;
	case VACT_FCH_DOWN:
		change_fav_channel(shift);
		break;		
	case VACT_TV_RADIO_SW:
		av_mode = sys_data_get_cur_chan_mode();
		av_mode = (av_mode==TV_CHAN)? RADIO_CHAN : TV_CHAN; 				
		sys_data_get_cur_group_channel(&channel, av_mode);
		if(channel==P_INVALID_ID) /* If the opposite mode has no channel */
		{
			if(av_mode==RADIO_CHAN)
                strID = RS_MSG_NO_RADIO_CHANNEL;
            else
                strID = RS_MSG_NO_TV_CHANNEL;            
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		win_compopup_set_msg(NULL, NULL,strID);
		win_compopup_open_ext(&back_saved);
		osal_task_sleep(500);
		win_compopup_smsg_restoreback();
		}
		else
		{
#ifndef NEW_DEMO_FRAME
            UIChChgStopProg(TRUE);
#endif
			sys_data_set_cur_chan_mode(av_mode);
			change_group(0);
		}
		break;
	case VACT_RECALL:
		channel = recall_play_channel(0);
		if(channel != P_INVALID_ID)
			api_play_channel(channel, TRUE, TRUE,FALSE);	
		break;
	case VACT_POP_DETAIL:
		b_popdetail = TRUE;
		ret  = PROC_LEAVE;
		break;
	default:
		break;
	}

	win_progname_redraw();

	progname_timer = api_start_timer(PROGNAME_TIMER_NAME,PROGNAME_TIMER_TIME,progname_timer_func);

	return ret;
}
Exemple #22
0
static BOOL GoDown(INT16 *x, INT16 *y, INT8 *CurrentShape, INT8 *Status)
{
    INT8 AllAreOne = 1, removed_lines = 0;
    INT8 i, j, r, l, rr, ll;
    UINT8   back_saved;

    
    if (Possible(*x, (*y) + 1, *CurrentShape, *Status))
    {
        hide(*x, *y, *CurrentShape, *Status);
        (*y)++;
        show(*x, *y, *CurrentShape, *Status, BLOCK_ACTIVE);
        return TRUE;
    }

    normal_speed();

    for (i = 0; i < 4; i++)
    {
        for (j = 0; j < 4; j++)
        {
            back[i + *y][j + *x] += shape[*CurrentShape][*Status][i][j];
        }
    }

    for (r = 1; r < MAXY; r++)//20
    {
        for (l = 2; l < 2 + MAXX; l++)//13
        {
            if (back[r][l] == 0)
            {
                AllAreOne = 0;
            }
        }

        if (AllAreOne == 1)
        {
            for (rr = r; rr > 0; rr--)
            {
                for (ll = 2; ll < 2 + MAXX; ll++)
                {
                    back[rr][ll] = back[rr - 1][ll];
                }
            }

		for (ll = 2; ll < 2 + MAXX; ll++)
		{
			back[0][ll] = 0;
		}//the upper line will be all zero which represented the line is blank

            Erasered++;
            if((!(Erasered % 30)) && (Speed < 10))
            {
                Speed++;
                osal_timer_set(GAME_CYCLIC_ID, TimeDelay[Speed - 1]);
            }
            
            removed_lines++;
        }

        AllAreOne = 1;
    }

    show(*x, *y, *CurrentShape, *Status, BLOCK_INACTIVE); //sunk the button

    CreateNewShape(x, y, CurrentShape, Status);

    if (!Possible(*x, *y, *CurrentShape, *Status))
    {
        playing = FALSE;

        osal_timer_activate(GAME_CYCLIC_ID, FALSE);

        win_compopup_init(WIN_POPUP_TYPE_OK);
        win_compopup_set_frame(GET_MID_L(250), GET_MID_T(130), 250, 130);
        win_compopup_set_msg(NULL, NULL, RS_GAME_SORRY_YOU_LOST);
        win_compopup_open_ext(&back_saved);

	tetris_init();
	update_status(Speed, Erasered, TotalMark);
	tetris_redraw_main();
	tetris_redraw_preview();

        OSD_SetAttr((POBJECT_HEAD)&txt_start, C_ATTR_ACTIVE);
        OSD_ChangeFocus((POBJECT_HEAD)&game_con, 1, \
              C_UPDATE_FOCUS | C_DRAW_SIGN_EVN_FLG);
    }

    TotalMark += (Speed + 1) * (10 + removed_lines - 1) * removed_lines;
    update_status(Speed, Erasered, TotalMark);

    if (removed_lines > 0)
    {
        tetris_redraw_main();
    }

    if (playing == TRUE)
    {
        show(*x, *y, *CurrentShape, *Status, BLOCK_ACTIVE);
    }

    return FALSE;
}
Exemple #23
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;
}
Exemple #24
0
static PRESULT tetris_key_proc(UINT32 vkey, UINT8 key_repeat_cnt, UINT8 key_status)
{
    	UINT8   back_saved;
	PRESULT ret = PROC_LOOP;
	if (key_status == PAN_KEY_PRESSED)
	{
		switch (vkey)
		{
			case V_KEY_UP:
				ChangeShape(&x, &y, &CurrentShape, &Status);
				break;

			case V_KEY_DOWN:
				GoDown(&x, &y, &CurrentShape, &Status);
				if (key_repeat_cnt == 0)
				{
				/* speed up drop speed */
				osal_timer_set(GAME_CYCLIC_ID, 100);
				speed_up = TRUE;
				}
				break;

			case V_KEY_LEFT: 
				GoLeft(&x, &y, &CurrentShape, &Status);
				break;

			case V_KEY_RIGHT: 
				GoRight(&x, &y, &CurrentShape, &Status);
				break;

			case V_KEY_ENTER:
				if (playing == TRUE)
				{
					osal_timer_activate(GAME_CYCLIC_ID, FALSE);

					win_compopup_init(WIN_POPUP_TYPE_OK);
					win_compopup_set_frame(GET_MID_L(170), GET_MID_T(130), 170, 130);                    
					win_compopup_set_msg(NULL, NULL, RS_PAUSE);
					win_compopup_open_ext(&back_saved);

					osal_timer_activate(GAME_CYCLIC_ID, TRUE);
				}
				break;

			case V_KEY_MENU:
			case V_KEY_EXIT:
				if (playing == TRUE)
				{
					osal_timer_activate(GAME_CYCLIC_ID, FALSE);

					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					//win_compopup_set_frame(GET_MID_L(250), GET_MID_T(130), 250, 130);
					win_compopup_set_frame(GET_MID_L(250), GET_MID_T(130), 320, 130);
					win_compopup_set_msg(NULL, NULL, RS_GAME_MSG_DO_YOU_QUIT);
					if (win_compopup_open_ext(&back_saved) == WIN_POP_CHOICE_YES)
					{
						playing = FALSE;

						tetris_init();
 						update_status(Speed, Erasered, TotalMark);
 						tetris_redraw_main();
 						tetris_redraw_preview();

						OSD_SetAttr((POBJECT_HEAD)&txt_start, C_ATTR_ACTIVE);
						OSD_ChangeFocus((POBJECT_HEAD)&game_con, 1, \
						C_UPDATE_FOCUS | C_DRAW_SIGN_EVN_FLG);
					}
					else
					{
						osal_timer_activate(GAME_CYCLIC_ID, TRUE);
					}
				}
				break;
			default:
				ret = PROC_PASS;
		}
	}
	else if (key_status == PAN_KEY_RELEASE)
	{
		normal_speed();
	}

	return ret;
}
static PRESULT atnsetm_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT32 sel;
	UINT8 bID;
 	char str[10];
    UINT16 * Uni_str;
    UINT8* pstr;
	SYSTEM_DATA* sys_data;
	POBJECT_HEAD other_antset_menu;
	VACTION unact;
	COM_POP_LIST_TYPE_T list_type;
	OSD_RECT rect;
	COM_POP_LIST_PARAM_T param;
	UINT16 cur_idx;
	BOOL b;
	UINT8 back_saved;

	sys_data = sys_data_get();

	bID = OSD_GetObjID(pObj);

	switch(event)
	{
	case EVN_PRE_CHANGE:
		sel = *((UINT32*)param1);
		if(bID == TUNER_ID)
		{
			if(TUNER_CNT < 2)
			{
				ret = PROC_LOOP;
				break;
			}

			b = win_atnsetm_check_save_motor_antenna_setting();
			if(!b)
			{
				win_compopup_init(WIN_POPUP_TYPE_OK);
				win_compopup_set_msg(NULL, NULL, RS_MSG_OUT_RANGE);
				win_compopup_open_ext(&back_saved);
				ret = PROC_LOOP;
				break;
			}

			/* Check tuner : sel has selected satellite or not.*/
			if(get_tuner_sat_cnt(sel)  == 0)
			{
				UINT8 back_saved;
				win_compopup_init(WIN_POPUP_TYPE_OK);
				win_compopup_set_msg(NULL,NULL, RS_TUNER_HAS_NO_SATE_SEL);
				win_compopup_open_ext(&back_saved);
				antset_cur_tuner = (sel == 0)? 1: 0;
				ret = PROC_LOOP;
			}
			else
				cur_tuner_idx = antset_cur_tuner = sel;
			
		}
		break;
	case EVN_POST_CHANGE:
		sel = param1;
		if(bID == TUNER_ID)
		{
			
			if(sys_data->tuner_lnb_type[sel] != LNB_MOTOR)
			{
				/* Need to change : Fixed antenna setting menu. */
				other_antset_menu = (POBJECT_HEAD)&g_win_antenna_set_fixed;
				if(OSD_ObjOpen(other_antset_menu, MENU_OPEN_TYPE_MENU + bID) != PROC_LEAVE)
				{
					menu_stack_pop();
					menu_stack_push(other_antset_menu);
				}
				ret  = PROC_LOOP;
			}
			else
			{
				//win_atnsetm_load_sat_cnt(TRUE);
				win_atnsetm_load_motor_antenna_setting(TRUE);
			}
		}
		else if(bID == MOTOR_ID)
		{
			win_atnsetm_load_local_action(TRUE);		
		}
#ifdef SUPPORT_UNICABLE
		else if(bID == LNB_ID)
		{
			if(win_unicable_setting_open(LNB_IDX))
				OSD_TrackObject((POBJECT_HEAD)&g_win_antenna_set_motor, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
		}
#endif
		break;		
	case EVN_REQUEST_STRING:
		sel = param1;
		Uni_str= (UINT16*)param2;
		get_lnb_name(sel,Uni_str);
		break;
		
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			OSD_SetRect2(&rect,&pObj->frame);
			/*Patch: For solve pop-up windows show bugs,for example: Universal(5150-10600) can not be all show*/
			OSD_SetRect(&rect, rect.uLeft, rect.uTop, (rect.uWidth + 10), rect.uHeight);
			param.selecttype = POP_LIST_SINGLESELECT;
			switch(bID)
			{
			case LNB_ID:
				list_type = POP_LIST_TYPE_LNB;
				rect.uHeight = 330;
				param.cur = LNB_IDX;
				break;
			default:
				list_type = 0xFF;
				break;
			}

			if(list_type == 0xFF)
				break;

			cur_idx = win_com_open_sub_list(list_type,&rect,&param);
			if(cur_idx == LIST_INVALID_SEL_IDX || cur_idx == param.cur)
				break;		

			if(bID == LNB_ID)
			{
				LNB_IDX = cur_idx;
				OSD_TrackObject((POBJECT_HEAD)anesetm_items[LNB_ID - 1], C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);	
#ifdef SUPPORT_UNICABLE
				if(win_unicable_setting_open(LNB_IDX))
					OSD_TrackObject((POBJECT_HEAD)&g_win_antenna_set_motor, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
#endif
			}
			
		}		
		break;
	}

	return ret;
}
Exemple #26
0
static PRESULT tms_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_timeshift,RS_DVR_CONFIGURATION, 0);
		win_tms_set_string(sys_data_get_tms(),&tms_item_txtset1);
		win_tms_set_string(sys_data_get_tms2rec(),&tms_item_txtset2);		
        win_set_rec_type_string(sys_data_get_rec_type(),&tms_item_txtset3);        
#if (defined(MULTI_PARTITION_SUPPORT) && !defined(DISK_MANAGER_SUPPORT))		
		win_pvr_vol_init();
        win_set_vol_string(&tms_item_txtset4);
#endif
		tms_set_tms2rec_item_active(FALSE);
#ifdef NEW_DEMO_FRAME
		OSD_SetContainerFocus(&g_win_timeshift, 4);
		remove_menu_item((POBJECT_HEAD)&g_win_timeshift, (OBJECT_HEAD *)&tms_item_con1, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&g_win_timeshift, (OBJECT_HEAD *)&tms_item_con2, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&g_win_timeshift, (OBJECT_HEAD *)&tms_item_con3, CON_H + CON_GAP);
#else
		OSD_SetContainerFocus(&g_win_timeshift, 1);
#endif
		break;
	
	case EVN_POST_OPEN:
#if(defined(MULTI_PARTITION_SUPPORT) && !defined(DISK_MANAGER_SUPPORT))
		win_pvr_vol_invalid_msg();
#endif
		break;
		
	case EVN_PRE_CLOSE:
        *((UINT32 *)param2) &= ~C_CLOSE_CLRBACK_FLG;
#if (defined(MULTI_PARTITION_SUPPORT) && !defined(DISK_MANAGER_SUPPORT))
		win_pvr_vol_save();
#endif
		sys_data_save(1);
		break;

	case EVN_POST_CLOSE:
		break;
    case EVN_UNKNOWN_ACTION:
        if (api_pvr_is_record_active())
            break;
        if (sys_data_get_tms() == 0)
        {
            win_popup_choice_t choice;
            UINT8 back_saved;

            win_compopup_init(WIN_POPUP_TYPE_OKNO);
            win_compopup_set_msg(NULL, NULL, RS_ARE_YOU_SURE_TO_ENTER_RECORD_TP_MODE);
            if (pvr_r_get_record_all())
                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
            else
                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
            choice = win_compopup_open_ext(&back_saved);
            if(choice == WIN_POP_CHOICE_YES)
            {
                pvr_r_set_record_all(TRUE);
            }   
            else if (choice == WIN_POP_CHOICE_NO)
            {
                pvr_r_set_record_all(FALSE);
            }

        }
		else
		{
#ifdef PVR3_SUPPORT
            win_popup_choice_t choice;
            UINT8 back_saved;

            win_compopup_init(WIN_POPUP_TYPE_OKNO);
            win_compopup_set_msg(NULL, NULL, RS_CONTINUE_TMS_SUPPORT);
            if (pvr_r_get_record_all())
                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
            else
                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
            choice = win_compopup_open_ext(&back_saved);
            if(choice == WIN_POP_CHOICE_YES)
            {
                pvr_info.continue_tms = 1;
            }   
            else
            {
                pvr_info.continue_tms = 0;
            }
#endif
		}
       {
            win_popup_choice_t choice;
            UINT8 back_saved;

            win_compopup_init(WIN_POPUP_TYPE_OKNO);
            win_compopup_set_msg(NULL, NULL, RS_RECORD_CA_PROGRAM_IN_DESCRAMBLED_FORMAT);
            if (sys_data_get_scramble_record_mode())
                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
            else
                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
            choice = win_compopup_open_ext(&back_saved);
            if (choice == WIN_POP_CHOICE_YES)
            {
                sys_data_set_scramble_record_mode(0);
            }
            else if (choice == WIN_POP_CHOICE_NO)
            {
                sys_data_set_scramble_record_mode(1);
                pvr_r_set_scramble();
            }
        }
        break;
	}
	return ret;
}
Exemple #27
0
RET_CODE win_set_imageplay_param(PlayListHandle *pplaylist, UINT32 idx, UINT8 folder_flag)
{
	UINT8 back_saved;
	RET_CODE retcode = RET_SUCCESS;
	FileInfo filenode;
	char image_name[FULL_PATH_SIZE];
	int playlist_idx;

	image_folderloop_flag = folder_flag;
	if(image_folderloop_flag == 1)
	{
		if(*pplaylist != NULL)
		{
			if(RET_SUCCESS != delete_play_list(*pplaylist))
			{
				return RET_FAILURE;
			}
		}
		*pplaylist = create_play_list(IMAGE_PLAY_LIST, "folder_image");
		if(*pplaylist == NULL)
		{
			return RET_FAILURE;
		}
		
		get_file_from_file_list(cur_filelist, idx, &filenode);
		win_get_fullname(image_name, filenode.path, filenode.name);
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		win_compopup_set_frame(200, 200, 200, 100);
		win_compopup_set_msg(NULL, NULL,RS_DISPLAY_PLEASE_WAIT);
		win_compopup_open_ext(&back_saved);
		retcode = add_all_file_list_items_to_play_list(*pplaylist, cur_filelist);
		osal_task_sleep(500);
		win_compopup_smsg_restoreback();
		if(retcode != RET_SUCCESS)
		{
			return RET_FAILURE;
		}
		if((filenode.filetype == F_JPG) || (filenode.filetype == F_BMP))
		{
			playlist_idx = get_play_list_index_by_name(*pplaylist, image_name);
		}
		else
		{
			playlist_idx = 1;
		}
		if(playlist_idx == -1)
		{
			return RET_FAILURE;
		}
		cur_playlist_image = *pplaylist;
		cur_image_idx = playlist_idx;
	}
	else
	{
		cur_playlist_image = *pplaylist;
		cur_image_idx = idx;
	}
	set_play_list_info(cur_playlist_image, &cur_image_idx, NULL);

	return RET_SUCCESS;
}
Exemple #28
0
void cti_chnchg_function()
{
	UINT16 chn_idx=0xffff;
	date_time local_time;
	CTI_CHN_CHG_CONTENT chnchg_data;
	UINT8 save;
	BOOL need_change = TRUE,info_changed = FALSE;
	win_popup_choice_t sel;
	UINT16 string[CHANNEL_JUMP_STR_LEN_MAX/2+1];

	INT sec = 0;
	if(pre_channel_index!=sys_data_get_cur_group_cur_mode_channel())//换台了
	{
		cti_chnchg_para_reset();
	}

	if(!get_cti_chnchg_flg())
	{
		return;
	}

	MEMSET(&local_time,0,sizeof(date_time));
	get_local_time(&local_time);

	MEMSET(&chnchg_data,0,sizeof(CTI_CHN_CHG_CONTENT));
	get_cti_chnchg_data(&chnchg_data);

	//显示内容有没有变化
	if(MEMCMP(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString))==0)
	{
		info_changed = FALSE;
	}
	else
	{
		info_changed = TRUE;
	}

	chn_idx=GetPlayChannelID(chnchg_data.bType,chnchg_data.wPart1,
							chnchg_data.wPart2,chnchg_data.wPart3,chnchg_data.wPart4);

	if((chnchg_data.bStatus==0)
		||(chnchg_data.bStatus==2))//立即跳转
	{
		set_cti_chnchg_flg(FALSE);
	}
	else//时间跳转
	{
		if(api_compare_day_time_ext(&(chnchg_data.stStartTime),&local_time)>=0)	//跳转时间没有到
		{
			need_change = FALSE;
		}
		else if(api_compare_day_time_ext(&(chnchg_data.stEndTime),&local_time)>=0)	//正常跳转
		{
			sec = cti_mktime(&(chnchg_data.stEndTime),&local_time);
		}
		else//控制时间已过
		{
			need_change = FALSE;
			set_cti_chnchg_flg(FALSE);
			return;
		}
	}

	if((chn_idx!=0xffff)
		&&(chn_idx!=sys_data_get_cur_group_cur_mode_channel())
		&&need_change)
	{

		if(chnchg_data.bStatus==0)//强制立即跳转
		{
			BackToFullScrPlay();
			win_compopup_init ( WIN_POPUP_TYPE_SMSG );
			win_compopup_set_frame ( 100, 140, 400, 120);
			//win_compopup_set_frame(100, 180, 400, 80);
			win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
			win_compopup_open_ext ( &save );
			osal_task_sleep(3000);
			win_compopup_close();
		}
		else if(chnchg_data.bStatus==1)//强制时间跳转
		{
			if(!info_showed)
			{
				BackToFullScrPlay();
				win_compopup_init ( WIN_POPUP_TYPE_SMSG );
				win_compopup_set_frame ( 100, 140, 400, 120);
				//win_compopup_set_frame(100, 180, 400, 80);
				win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
				win_compopup_open_ext ( &save );
				osal_task_sleep(3000);
				win_compopup_close();
				info_showed = TRUE;
			}
		}
		else if(chnchg_data.bStatus==2)//用户选择立即跳转
		{
			if((sys_data_get_cur_group_cur_mode_channel()==chn_idx_sel_no)
				&&(!info_changed))
			{
				return;
			}
			else
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);				
				//win_compopup_set_frame ( 100, 120, 400, 160);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, 5);
				if (sel == WIN_POP_CHOICE_NO)
				{
					chn_idx_sel_no = sys_data_get_cur_group_cur_mode_channel();
					return;//do not change
				}	
				//choice yes,so change channel
			}
		}
		else if(chnchg_data.bStatus==3)//用户选择按时间跳转
		{
			if((!info_showed)||info_changed)//没有显示过或者字符变化了
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT				
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, sec);
				choiced_yes = FALSE;
				info_showed = TRUE;
				if ((sel == WIN_POP_CHOICE_NO) || (sel == WIN_POP_CHOICE_TIMEOUT))
				{
					return;//do not change
				}	
				choiced_yes = TRUE;
			}
			else if(choiced_yes==TRUE)//用户选择yes,则继续判断是否需要跳转
			{

			}
			else
			{
				return;//提示过,不再提醒,也不换台
			}

		}

		api_play_channel(chn_idx, TRUE, TRUE, FALSE);
	}
}
Exemple #29
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;
}
Exemple #30
0
static PRESULT playlist_colorkey_proc(VACTION unact)
{
	UINT16 curPos;
	PRESULT ret_proc = PROC_PASS;
	POBJLIST pOl;
	POBJECT_HEAD top_win;
	UINT8 back_saved;
	win_popup_choice_t choice;
	UINT32 file_num;
	
	pOl = &ol_playlist;
	curPos = OSD_GetObjListCurPoint(pOl);
	switch(unact)
	{
		case VACT_PLAY:
			top_win = (POBJECT_HEAD)(&g_win_usb_filelist);
			if(cur_playlist_type == PL_MUSIC)
			{
				win_set_musicplay_param(&cur_display_playlist,curPos+1,0);
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_PLAYMUSIC,(UINT32)top_win,TRUE);
			}
			else
			{
				win_set_imageplay_param(&cur_display_playlist, curPos+1,0);
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_PLAYIMAGE,(UINT32)top_win,TRUE);
			}
			ret_proc = PROC_LEAVE;
			break;
		case VACT_MOVE:
			if(moving_flag == 0)
			{
				moving_flag = 1;
				move_file_idx = curPos;
			}
			else
			{
				moving_flag = 0;
				//move file
				move_file_in_play_list(cur_display_playlist, move_file_idx+1, curPos+1);
				move_file_idx = INVALID_IDX;
			}
   			OSD_TrackObject((POBJECT_HEAD)pOl, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
			break;
		case VACT_DELETE:
			if(moving_flag == 1)
			{
				moving_flag = 0;
				//move file
				move_file_in_play_list(cur_display_playlist, move_file_idx+1, curPos+1);
				move_file_idx = INVALID_IDX;
			}
			delete_play_list_item(cur_display_playlist, curPos+1);

			if(cur_playlist_type == PL_MUSIC)
			{
				musiclist_changed = TRUE;
			}
			else
			{
				imagelist_changed = TRUE;
			}
			get_play_list_info(cur_display_playlist,&file_num, NULL);
			OSD_SetObjListCount(pOl, file_num);
   			if(file_num == 0)//all items have been deleted
   			{
 				delete_play_list(win_play_list[cur_playlist_type]);
				win_play_list[cur_playlist_type] = NULL;
  				ret_proc = PROC_LEAVE;
   				break;
   			}
   			if(curPos >= file_num)
   			{
   				OSD_SetObjListCurPoint(pOl, 0);
   				OSD_SetObjListNewPoint(pOl, 0);
   				OSD_SetObjListTop(pOl, 0);
   			}
   			OSD_TrackObject((POBJECT_HEAD)pOl, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
			break;
		case VACT_DELETE_ALL:
 			win_compopup_init(WIN_POPUP_TYPE_OKNO);
 			win_compopup_set_msg(NULL,NULL,RS_MP_DELETE_PLAYLIST);
 			choice = win_compopup_open_ext(&back_saved);		
 			if(choice == WIN_POP_CHOICE_YES)
 			{
				delete_play_list(win_play_list[cur_playlist_type]);
				win_play_list[cur_playlist_type] = NULL;
				if(cur_playlist_type == PL_MUSIC)
				{
					musiclist_changed = TRUE;
				}
				else
				{
					imagelist_changed = TRUE;
				}
	   			ret_proc = PROC_LEAVE;
 			}
			break;
		default:
			break;
	}

	return ret_proc;
}