Example #1
0
static PRESULT win_an_set_unkown_act_proc(VACTION act)   //guop edit 20101014
{

    switch(act)
	{

           case VACT_SINGLE_SEARCH:
		   	single_multi_srch_flag = 0;
		  	//if(check_node_modified(TYPE_SAT_NODE) )
		   {
			UINT8	back_saved;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_SAVING_DATA);
			win_compopup_open_ext(&back_saved);
			update_data(TYPE_SAT_NODE);
			osal_task_sleep(200);
			win_compopup_smsg_restoreback();
		   }
			if(OSD_ObjOpen((POBJECT_HEAD)&g_win_sat_srchset, 0xFFFFFFFF) != PROC_LEAVE)
				menu_stack_push((POBJECT_HEAD)&g_win_sat_srchset);
			wincom_close_help();
	             break;
	      case VACT_MULTI_SEARCH:
		   	single_multi_srch_flag = 1;
		  //	if(check_node_modified(TYPE_SAT_NODE) )
		   {
			UINT8	back_saved;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_SAVING_DATA);
			win_compopup_open_ext(&back_saved);
			update_data(TYPE_SAT_NODE);
			osal_task_sleep(200);
			win_compopup_smsg_restoreback();
		   }
			if(OSD_ObjOpen((POBJECT_HEAD)&g_win_sat_srchset, 0xFFFFFFFF) != PROC_LEAVE)
				menu_stack_push((POBJECT_HEAD)&g_win_sat_srchset);
			wincom_close_help();
	             break;
				 
	      case VACT_TP_SEARCH:
		 // 	if(check_node_modified(TYPE_SAT_NODE) )
		   {
			UINT8	back_saved;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_SAVING_DATA);
			win_compopup_open_ext(&back_saved);
			update_data(TYPE_SAT_NODE);
			osal_task_sleep(200);
			win_compopup_smsg_restoreback();
		   }

			if(OSD_ObjOpen((POBJECT_HEAD)&g_win_tplist, 0xFFFFFFFF) != PROC_LEAVE)
				menu_stack_push((POBJECT_HEAD)&g_win_tplist);
	             break;
		

    }
}
Example #2
0
static void cti_PPID_detail_info_display()
{
	POBJECT_HEAD submenu;
	UINT8 PPID_id[3];
	char pin[9];
	cas_pin_t casPIN;
	int ret=0;
	UINT32 PPID=0;
	UINT8 back_saved;

	//check PIN
	if(!win_pin_open(NULL,0))
	{
		return;
	}

	win_compopup_init(WIN_POPUP_TYPE_SMSG);
	//win_compopup_set_msg("Reading PPID detail info.",NULL, 0);
	win_compopup_set_msg(NULL,NULL, RS_CTI_READING_PPID_DETAIL);
	win_compopup_open_ext(&back_saved);
	
	memcpy(PPID_id,cti_PPID_list.info[g_PPID_itemIdx-1].id,3);
	win_pin_get_input(pin, sizeof(pin));
	memcpy(casPIN.pin_code,pin,8);
	casPIN.pin_len = STRLEN(casPIN.pin_code);

	memset(&cti_PPID_detInfo,0,sizeof(cas_PPID_detailed_info_t));
	ret=cas_get_sc_PPID_detailed(PPID_id, &casPIN, &cti_PPID_detInfo);
	//osal_task_sleep(1000);
	win_compopup_smsg_restoreback();
	//soc_printf("qjzheng---PPID.id = %02x%02x%02x,pin=%s,len=%d\n",PPID_id[0],PPID_id[1],PPID_id[2],casPIN.pin_code,casPIN.pin_len);
	if(ret!=0)
	{

		//soc_printf("qjzheng--to get PPID detail info error =%d\n",ret);
		
		osal_task_sleep(500);
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		//win_compopup_set_msg("Read PPID detail info error!",NULL, 0);
		win_compopup_set_msg(NULL,NULL, RS_CTI_READ_PPID_DETAIL_ERROR);
		win_compopup_open_ext(&back_saved);
		osal_task_sleep(1000);
		win_compopup_smsg_restoreback();
		return;
	}
	
	//to enter PPID_info detail
	submenu = (POBJECT_HEAD)&g_win_cti_PPID_info;

	if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_MENU|g_PPID_curID) != PROC_LEAVE)
	{
		menu_stack_push(submenu);					
	}
}
Example #3
0
static int cti_mat_modify()
{
	cas_pin_t pin;
	UINT8 level;
	int ret=0;

	memcpy(pin.pin_code,input_pin_chars,sizeof(input_pin_chars));
	pin.pin_len = STRLEN(pin.pin_code);

	level = OSD_GetMultiselSel(&cti_mat_item_select);

	ret=cas_set_parental_rating(&pin,level);

	//soc_printf("modify pin ,statues=%d\n", ret);
	//if(ret==0)
	{
		UINT8 back_saved;
		
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		if(ret==0)
			win_compopup_set_msg(/*"Reset maturity success!"*/NULL,NULL, RS_CTI_MATURITY_SETTING_SUCCESS);
		else
			win_compopup_set_msg(/*"Reset maturity faild!"*/NULL,NULL, RS_CTI_MATURITY_SETTING_FAIL);
		win_compopup_open_ext(&back_saved);
		osal_task_sleep(1000);
		win_compopup_smsg_restoreback();
	}

	return ret;
	
}
Example #4
0
void aud_desc_show_hint(UINT32 ad_msg)
{
    char str[32];
    char lang[5];
    UINT8 back_saved;
    int ad_status = AD_MSG_STATUS(ad_msg);
    int ad_type = AD_MSG_TYPE(ad_msg);
    UINT16 ad_lang = AD_MSG_LANG(ad_msg);

    MEMSET(lang, 0, sizeof(lang));
    get_audio_lang3b((UINT8 *)&ad_lang,(UINT8 *)lang);

    if (ad_status == 0) // AD invalid
        sprintf(str, "%s AD not available", lang);
    else
    {
        if (ad_type == AD_MSG_TYPE_BOARDCASTER_MIX)
            sprintf(str, "AD Enable", lang);
        else if (ad_type == AD_MSG_TYPE_RECEIVER_MIX)
            sprintf(str, "%s AD Enable", lang);
    }

    win_compopup_init(WIN_POPUP_TYPE_SMSG);
    win_compopup_set_msg_ext(str, NULL, 0);

    win_compopup_open_ext(&back_saved);
    osal_task_sleep(1000);
    win_compopup_smsg_restoreback();
}
Example #5
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	//PRESULT ret = PROC_LEAVE;	
	VACTION unact;
	UINT8 bID,back_saved;
	win_popup_choice_t choice;
	UINT32 chunk_id, default_db_addr, default_db_len;

	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
		       ret = PROC_LEAVE;
			if(bID == BTN_NO_ID)
			{
				break;
			}
			
			//win_compopup_init(WIN_POPUP_TYPE_OKNO);
			//win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
			//win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
			//choice = win_compopup_open_ext(&back_saved);
			//if(choice == WIN_POP_CHOICE_YES)
			{
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
				win_compopup_open_ext(&back_saved);

				chunk_id = 0x03FC0100;
				api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
				set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

				sys_data_factroy_init(); 
				//sys_data_set_factory_reset(TRUE);
				sys_data_set_cur_chan_mode(TV_CHAN);
				sys_data_save(TRUE);
				sys_data_load();
				if(GetMuteState())
					SetMuteOnOff(FALSE);
				if(GetPauseState())
					SetPauseOnOff(FALSE);
				win_compopup_smsg_restoreback();
				// PRESULT ret = PROC_LEAVE;
				//ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_PALNTSC,FALSE);
			}
		
		}
		break;
	}

	return ret;
}
Example #6
0
void dispSpiderCamdMsg(char *msgDisp)
{

	UINT8 back_saved;
	
	win_compopup_init(WIN_POPUP_TYPE_SMSG);
	win_compopup_set_msg_ext(msgDisp, NULL, 0);
	win_compopup_open_ext(&back_saved);	
	osal_task_sleep(3000);
	win_compopup_smsg_restoreback();
}
Example #7
0
void win_popup_msg(char* str, char* unistr, UINT32 strID)
{
	unsigned char back_saved;
	
	win_compopup_init(WIN_POPUP_TYPE_SMSG);
	win_compopup_set_msg(str,unistr, strID);
	win_compopup_open_ext(&back_saved);
	osal_task_sleep(1000);
	win_compopup_smsg_restoreback();


	return;
}
Example #8
0
static void win_pvod_cancel()
{
#if 0
	UINT8 back_saved;
	
	win_compopup_init(WIN_POPUP_TYPE_SMSG);
	win_compopup_set_msg("use cancel !!",NULL, 0);
	win_compopup_open_ext(&back_saved);
	osal_task_sleep(1000);
	win_compopup_smsg_restoreback();
#else
#endif
}
Example #9
0
static void win_pvod_pause()
{
#if 1	
	UINT8 back_saved;
	
	win_compopup_init(WIN_POPUP_TYPE_SMSG);
	win_compopup_set_msg(NULL,NULL, RS_READ_PROGRAM_INFORMATION);
	win_compopup_open_ext(&back_saved);
	osal_task_sleep(1000);
	win_compopup_smsg_restoreback();
#else
#endif
	
}
Example #10
0
static PRESULT movefile_unkown_act_proc(VACTION act)
{
	PRESULT ret_proc = PROC_PASS;
	UINT8 bRoot;
	UINT8 back_saved;
	
	switch(act)
	{
		case VACT_UP_DIR:
			ret_proc = movefile_item_enter(0);//exit to up dir
			break;
		case VACT_COPY:
			bRoot = win_check_openroot(win_move_dirlist);
			if(bRoot)
			{
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_frame(200, 200, 200, 100);
				win_compopup_set_msg(NULL, NULL,RS_MSG_COPY_INVALID_PATH);
				win_compopup_open_ext(&back_saved);
				osal_task_sleep(1000);
				win_compopup_smsg_restoreback();
				break;
			}
			else
			{
				get_file_list_info(win_move_dirlist, &movefile_dirnum, &movefile_filenum, copyfile_dest_path);
				move_file_flag = 1;
				ret_proc = PROC_LEAVE;
			}
			break;
		case VACT_CHG_DEVL:
		case VACT_CHG_DEVR:
			if(get_stroage_device_number(STORAGE_TYPE_ALL) == 1 )
			{	
				break;
			}
			ret_proc = movefile_change_storage(act);
			break;
		case VACT_HELP:
			
			break;
		default:
			break;
	}

	return ret_proc;
}
Example #11
0
static BOOL save_lcn_sorted_prog(void)
{
    BOOL changed = FALSE;
    UINT8 back_saved = 0;
	win_popup_choice_t choice;
	SYSTEM_DATA* p_sys_data=sys_data_get();
	
    if (lcn_sorted_flag1!=lcn_sorted_flag2)
	{
		lcn_sorted_flag1=lcn_sorted_flag2;

		win_compopup_init(WIN_POPUP_TYPE_OKNO);
		win_compopup_set_msg(NULL, NULL, RS_MSG_ARE_YOU_SURE_TO_SAVE);
		choice = win_compopup_open_ext(&back_saved);
		if(choice == WIN_POP_CHOICE_YES)
		{
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_WAIT_FOR_SAVING);
			win_compopup_open_ext(&back_saved);

			update_data();

        	//win_chlst_clear_channel_del_flags();
	        sys_data_check_channel_groups();

			changed = TRUE;

			win_compopup_smsg_restoreback();
			p_sys_data->osd_set.lcn_sort=lcn_display_on_off2;
		}
		else
		{
			p_sys_data->osd_set.lcn_sort=lcn_display_on_off1;	
		}
		
	}

	return changed;
}
Example #12
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;
}
Example #13
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;
}
Example #14
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;
}
Example #15
0
static PRESULT info_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	POBJECT_HEAD submenu;

	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_title((POBJECT_HEAD)&win_info_con,RS_TOOLS_INFORMATION, 0);
		break;			
	case EVN_POST_OPEN:
		display_sys_infomation(0);
		break;		
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;				
		break;
	case EVN_POST_CLOSE:
		break;
	case EVN_UNKNOWN_ACTION:
        param1 &= 0xff;
		if (factorytest_check_magic_key(param1))
		{
#ifdef FACTORY_TEST_MENU
			submenu = (POBJECT_HEAD)&g_win_factory_test;
			if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_OTHER) != PROC_LEAVE)
				menu_stack_push(submenu);
#endif
		}
		else if (factorytest_check_magic_key_diag(param1))
		{
			UINT16 channel = sys_data_get_cur_group_cur_mode_channel();
            UINT16 group_idx = sys_data_get_cur_group_index();
			sys_data_change_group(group_idx);

            api_stop_play(0); //to call si_monitor_off for fixing bug 13806 --Michael 2008/2/18
			api_play_channel(channel, TRUE, FALSE, FALSE);
            ap_clear_all_menus();
			extern CONTAINER win_diag;
			ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&win_diag, TRUE);
		}
        else if(factorytest_check_hdmi_hdcp_key(param1))
        {
            extern CONTAINER g_win_hdmi_factory_test;
            submenu = (POBJECT_HEAD)&g_win_hdmi_factory_test;
            if(OSD_ObjOpen(submenu,MENU_OPEN_TYPE_OTHER) != PROC_LEAVE)
            {
                menu_stack_push(submenu);
            }
        }
        else if(factorytest_check_epg_show_logo_key(param1))
        {
            UINT8 back_saved;
            win_epg_set_show_state();
            win_compopup_init(WIN_POPUP_TYPE_SMSG);
            if(win_epg_is_show_logo())
            {
                win_compopup_set_msg("EPG Show Logo", NULL, 0);
            }
            else
            {
                win_compopup_set_msg("EPG Normal", NULL, 0);
            }
            win_compopup_open_ext(&back_saved);
            osal_task_sleep(2000);
            win_compopup_smsg_restoreback();
        }
		break;
	}
	return ret;
}
Example #16
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;
}
Example #17
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;
}
Example #18
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;


}
Example #19
0
static PRESULT map_display_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	//UINT8	focusID = OSD_GetFocusID( pObj);
	UINT8 back_saved;
	OSD_RECT rect = {PREVIEW_L, PREVIEW_T, PREVIEW_W, PREVIEW_H};
	struct  YCbCrColor bgcolor;

	switch(event)
	{
		case EVN_PRE_OPEN:
			vdec_stop((struct vdec_device *)dev_get_by_type(NULL, HLD_DEV_TYPE_DECV), 0, 0);
			OSD_ClearScreen();//-a by wangyang 2011-09-20
			win_media_player_init_ex(mp_apcallback, 1);
			bMapDownloading = FALSE;
			zoom_level = 12;
			//api_set_preview_vpo_color(TRUE);
			bgcolor.uY = 16;
			bgcolor.uCb = 128;
			bgcolor.uCr = 128;		
			api_set_vpo_bgcolor(&bgcolor);
			image_restore_vpo_rect();//TODO
#if 0			
			vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,0), TV_4_3, NORMAL_SCALE);
#ifdef DUAL_VIDEO_OUTPUT
			vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,1), TV_4_3, NORMAL_SCALE);
#endif
			osal_task_sleep(30);
			
			if(is_cur_decoder_avc())
			{
				h264_decoder_select(0, hde_get_mode() == VIEW_MODE_PREVIEW);
			}
#endif			
//			system_state = SYS_STATE_USB_MP;
	      	  	//osal_cache_flush_all();
	      	  	image_abort();
			//map_show(rect);
			break;
       	case EVN_POST_OPEN:
			//wincom_open_subtitle(pObj,RS_MAP,0);
			wincom_open_help_trans(pObj, map_display_helpinfo, 2);
			map_show(rect, param2);
			break;
		case EVN_POST_CLOSE:
			map_download_abort(s_mapdisp_dl_handle);
			s_mapdisp_dl_handle = 0;
			media_player_release_ex();
#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|7);
#endif
			wincom_close_subtitle();
			break;
		case EVN_MSG_GOT:
			if (param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH)
			{
				bMapDownloading = FALSE;
				map_download_abort(s_mapdisp_dl_handle);
				s_mapdisp_dl_handle = 0;
				if ((int)param2 >= 0)
				{	
					win_compopup_smsg_restoreback();
					map_show(rect, param2);
				}
			}
			break;
		default:
			break;
	}

	return ret;
}
Example #20
0
static void win_miscset_save_setting(void)
{
	MULTISEL	*msel;
	SYSTEM_DATA* sys_data;
	UINT32 val;

	sys_data = sys_data_get();

#ifndef NEW_DEMO_FRAME
	struct nim_lnb_info lnb_info;
	for(i=0;i<2;i++)
	{
        lib_nimg_get_lnb_info(i+1,&lnb_info);
        if(LNB_POWER_OFF == sys_data->bLNB_power)
            lnb_info.lnb_power_off = 1;
        else
            lnb_info.lnb_power_off = 0;                      
		lib_nimg_set_lnb_info(i+1,&lnb_info);
	}
#else
	struct nim_config lnb_info;
	struct nim_device *nim;
UINT16 i;
	for(i=0;i<2;i++)
	{
        nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, i);
        dev_get_nim_config(nim,FRONTEND_TYPE,&lnb_info);
        if(LNB_POWER_OFF == sys_data->bLNB_power)
            lnb_info.antenna.antenna_enable = /*0*/1;   //Seiya fix BUG37540:
        else
            lnb_info.antenna.antenna_enable = 1;                   
	    dev_set_nim_config(nim, FRONTEND_TYPE, &lnb_info);
	}
#endif

	msel =&miscset_sel1;
	val = OSD_GetMultiselSel(msel);
	sys_data->chan_sw = val;
	
	msel =&miscset_sel2;
	val = OSD_GetMultiselSel(msel);
	sys_data->chchgvideo_type = val;

#ifdef CHANCHG_VIDEOTYPE_SUPPORT
#ifndef NEW_DEMO_FRAME
	UIChChgSetVideoType(sys_data->chchgvideo_type);
#endif
#endif
	
	msel =&miscset_sel3;
	val = OSD_GetMultiselSel(msel);
	sys_data->install_beep = val;

    msel =&miscset_sel4;
	val = OSD_GetMultiselSel(msel);
	sys_data->auto_standby_en= val;


#ifdef ORDER_GZ1207009
	   msel =&miscset_sel6;
	val = OSD_GetMultiselSel(msel);
	sys_data->standbymode= val;
#endif

#ifdef RAM_TMS_TEST
    msel =&miscset_sel5;
	val = OSD_GetMultiselSel(msel);

	char rec_part[16];
	char tms_part[16];

	if (sys_data->ram_tms_en != val) // detach tms part
	{
		rec_part[0] = tms_part[0] = 0;
		pvr_get_cur_mode(rec_part, tms_part);
		if (tms_part[0] != 0)
		{
			if (STRCMP(rec_part, tms_part) == 0)
				pvr_set_disk_use(PVR_REC_ONLY_DISK, rec_part);
			else
				pvr_detach_part(tms_part, PVR_TMS_ONLY_DISK);
			api_pvr_adjust_tms_space();
		}
	}
	
	if (sys_data->ram_tms_en == 0 && val == 1) // enable RAM disk timeshift
	{
		UINT32 ram_len = RAM_DISK_SIZE;	
		UINT32 ram_addr = (void *)(RAM_DISK_ADDR & 0x0fffffff | 0x80000000);

		ramdisk_create((UINT32)ram_addr, ram_len);

		struct pvr_register_info pvr_reg_info;
		MEMSET(&pvr_reg_info, 0, sizeof(struct pvr_register_info));
		STRCPY(pvr_reg_info.mount_name, "/mnt/rda1");
		pvr_reg_info.disk_usage = PVR_TMS_ONLY_DISK;
		pvr_reg_info.sync = 1;
		pvr_reg_info.init_list = 0;
		pvr_reg_info.check_speed = 0;
		pvr_register((UINT32)&pvr_reg_info, 0);
	}
	else if (sys_data->ram_tms_en == 1 && val == 0) // disable RAM disk timeshift
	{
		ramdisk_delete();
	}

	if (sys_data->ram_tms_en != val)
	{
		if (val == 0) // disable RAM disk timeshift, select PVR partition again
		{
			UINT8 back_saved;
			rec_part[0] = tms_part[0] = 0;
			pvr_select_part(rec_part, tms_part);
			if (rec_part[0] != 0 || tms_part[0] != 0)
			{
				win_compopup_init(WIN_POPUP_TYPE_SMSG); 					   
				win_compopup_set_msg_ext("Init PVR partitions, please wait...", NULL, 0);
				win_compopup_open_ext(&back_saved);
				if (STRCMP(rec_part, tms_part) == 0)
				{
					pvr_change_part(rec_part, PVR_REC_AND_TMS_DISK);
				}
				else
				{
					pvr_change_part(rec_part, PVR_REC_ONLY_DISK);
					pvr_change_part(tms_part, PVR_TMS_ONLY_DISK);
				}
				win_compopup_smsg_restoreback();
			}
		}
		
		struct dvr_HDD_info hdd_info;
		pvr_get_HDD_info(&hdd_info);
		api_pvr_check_level(&hdd_info);
		if (pvr_get_cur_mode(NULL, NULL) == PVR_DISK_INVALID)
		{
			api_pvr_clear_up_all();
		}
	}
	sys_data->ram_tms_en = val;
#endif

    sys_data_save(1);
    
}
Example #21
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();
	}
}
Example #22
0
static PRESULT localset_item_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
    PRESULT ret = PROC_PASS;
    VACTION unact;
	UINT8 bID = OSD_GetObjID(pObj);
	
	switch( event)
	{
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1 >> 16);
	        if ((bID == IDC_LOCALSET_APPLY) && (unact == VACT_ENTER))
	        {
				char hint[64];
				UINT8 bNewFocusID = IDC_LOCALSET_APPLY, back_saved;
				LOCAL_CFG_ERR_CODE err_code = localset_cfg_save();
				switch (err_code)
				{
					case LOCAL_CFG_ERR_NONE:
						STRCPY(hint, "Apply network local setting...");
						bNewFocusID = IDC_LOCALSET_APPLY;
						break;
					case LOCAL_CFG_ERR_IP:
						STRCPY(hint, "Invalid IP address");
						bNewFocusID = IDC_LOCALSET_IP_ADDR;
						break;
					case LOCAL_CFG_ERR_SUBNET:
						STRCPY(hint, "Invalid subnet mask");
						bNewFocusID = IDC_LOCALSET_SUBNET_MASK;
						break;
					case LOCAL_CFG_ERR_IP_SUBNET:
						STRCPY(hint, "Invalid IP address or subnet mask");
						bNewFocusID = IDC_LOCALSET_IP_ADDR;
						break;
					case LOCAL_CFG_ERR_GATEWAY:
						STRCPY(hint, "Invalid gateway");
						bNewFocusID = IDC_LOCALSET_GATEWAY;
						break;
					case LOCAL_CFG_ERR_DNS_PREFER:
						STRCPY(hint, "Invalid preferred DNS");
						bNewFocusID = IDC_LOCALSET_DNS1;
						break;
					case LOCAL_CFG_ERR_DNS_ALTER:
						STRCPY(hint, "Invalid alternate DNS");
						bNewFocusID = IDC_LOCALSET_DNS2;
						break;
					default:
						err_code = LOCAL_CFG_ERR_MAX; /* don't show anything */
						break;
				}
				
				if (err_code < LOCAL_CFG_ERR_MAX)
				{
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(hint, NULL, 0);
					win_compopup_open_ext(&back_saved); 
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
					OSD_ContainerChgFocus(&g_win_localsetting, bNewFocusID,
										  C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);
				}
			TestNetStatus();
	        }
			#if 1
			else if((bID == IDC_LOCALSET_MAC) && (unact == VACT_ENTER))
			{
				extern CONTAINER win_mac_setting;
				flag=1;
				#if(!defined(GZ1110003_ON))
				if(OSD_ObjOpen((POBJECT_HEAD)&win_mac_setting, MENU_OPEN_TYPE_OTHER) != PROC_LEAVE)
				{
					menu_stack_push((POBJECT_HEAD)&win_mac_setting);
				}
				#endif
			}
			#endif
			break;
		default:
			break;
	}
    return ret;
}
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;
}
Example #24
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	VACTION unact;
	UINT8 bID,back_saved;
	UINT32 chunk_id, default_db_addr, default_db_len;
	S_NODE  s_node;
	bID = OSD_GetObjID(pObj);
	INT16 	i,n;
	UINT8 back_saved1;
	UINT16 sat_id;//-a by wangyang 2011-11-03 for factory set del sat program
	win_popup_choice_t choice = WIN_POP_CHOICE_NO;
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			switch(bID)
			{
				case IDC_CON1:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						chunk_id = 0x03FC0100;
						api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
						set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
						if(GetMuteState())
							SetMuteOnOff(FALSE);
						if(GetPauseState())
							SetPauseOnOff(FALSE);
						win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
						api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                           	 	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);
					#if defined(ORDER_GZ1010010)||defined(ORDER_GZ1011005)||defined(ORDER_GZ1104005)	
						system_config.tv_scan_mode = 0;
					#endif	

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
					break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_TV_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
 						osal_task_sleep(1500);

						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_RADIO_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
			        		win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
				   		api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                              	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                    			break;
//-a by wangyang 2011-11-03 for factory set del sat program{{
				case IDC_CON5:

				if(OSD_GetMultiselCount(&factoryset_sel5)==0)
				{
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_NO_CHANNELS);
					win_compopup_open_ext(&back_saved1);
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
				}
				else
				{
					sat_id=OSD_GetMultiselSel(&factoryset_sel5);
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
					//	mm_enter_stop_mode(FALSE);
					//	api_show_menu_logo();
						if(api_is_playing_tv()  || api_is_playing_radio())
						{
							api_stop_play(1);
						}
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						//n = get_sat_num(VIEW_ALL);
						
						recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE,0);
						//for(i=0;i<n;i++)
						{
							get_sat_at(sat_id, SET_SELECTED,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
						
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();
						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
				}
                        		break;
//-a by wangyang 2011-11-03 for factory set del sat program}}
				default:
					break;
			}
			
		}
		break;
	}

	return ret;
}
Example #25
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;
}
Example #26
0
static PRESULT movefile_item_enter(UINT16 uIdx)
{
	PRESULT ret = PROC_LOOP;
	BOOL bRoot;
	char str_name[FULL_PATH_SIZE],str_txt[FULL_PATH_SIZE];
	FileInfo file_node;
	POBJLIST pOl;
	TEXT_FIELD *pTxt;
	UINT8 back_saved;

	bRoot = win_check_openroot(win_move_dirlist);
	if((uIdx == 0) && (bRoot == FALSE))
	{//TODO:Exit to up dir		

		get_file_list_info(win_move_dirlist, &movefile_dirnum, &movefile_filenum, str_name);
		win_get_parent_dirname(str_txt, str_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);
		read_folder_to_file_list(win_move_dirlist, str_txt);
		win_compopup_smsg_restoreback();
		bRoot = win_check_openroot(win_move_dirlist);
		if(bRoot)
		{
			file_list_change_device(win_move_dirlist, movefile_cur_device);
		}
		movefile_curidx = win_get_file_idx(win_move_dirlist, str_name);
		if(movefile_curidx == (UINT16)(~0))
			movefile_curidx = 0;
		
		get_file_list_info(win_move_dirlist, &movefile_dirnum, &movefile_filenum, str_name);
		pTxt = &mpmove_dir_txt;
		win_get_display_dirname(str_txt, str_name);//get dirname to show
		OSD_SetTextFieldContent(pTxt,STRING_UTF8,(UINT32)str_txt);
		OSD_DrawObject((POBJECT_HEAD)pTxt,C_UPDATE_ALL);

		pOl  = &ol_mpmove;
		movefile_curidx = movefile_curidx + (bRoot?0:1);
		OSD_SetObjListCurPoint(pOl, movefile_curidx);
		OSD_SetObjListNewPoint(pOl, movefile_curidx);
		OSD_SetObjListTop(pOl, movefile_curidx);
		if(bRoot == TRUE)
			OSD_SetObjListCount(pOl, (movefile_dirnum + movefile_filenum));//to show it's child dir
		else
			OSD_SetObjListCount(pOl, (movefile_dirnum + movefile_filenum + 1));//to show it's child dir
		if(OSD_GetObjListCount(pOl) <= MV_ITEM_CNT)
			OSD_SetObjListTop(pOl, 0);
		OSD_TrackObject((POBJECT_HEAD)pOl, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
		return ret;
	}

	if(!bRoot)
	{
		uIdx--;
	}
	
	get_file_from_file_list(win_move_dirlist, uIdx+1, &file_node);
	if(file_node.filetype == F_DIR)
	{
		//TODO: Enter child directory & retrive items,set not_root flag
		win_get_fullname(str_name, file_node.path, file_node.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);
		read_folder_to_file_list(win_move_dirlist, str_name);
		win_compopup_smsg_restoreback();

		get_file_list_info(win_move_dirlist, &movefile_dirnum, &movefile_filenum, str_name);

		pTxt = &mpmove_dir_txt;
		win_get_display_dirname(str_txt, str_name);//get dirname to show
		OSD_SetTextFieldContent(pTxt,STRING_UTF8,(UINT32)str_txt);
		OSD_DrawObject((POBJECT_HEAD)pTxt,C_UPDATE_ALL);

		movefile_curidx = 0;
		pOl  = &ol_mpmove;
		OSD_SetObjListCount(pOl, (movefile_dirnum + movefile_filenum + 1));//to show it's child dir
		OSD_SetObjListCurPoint(pOl, movefile_curidx);
		OSD_SetObjListNewPoint(pOl, movefile_curidx);
		OSD_SetObjListTop(pOl, movefile_curidx);
		OSD_TrackObject((POBJECT_HEAD)pOl, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
	}
	else
	{
		//TODO:soc_printf("not dir!!\n");
	}

	return ret;
}
Example #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;
}
Example #28
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;
}
Example #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;
}
Example #30
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();
	}
}