static PRESULT movefile_list_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { UINT16 uTop,uCurpos; PRESULT ret = PROC_PASS; VACTION unact; uTop = OSD_GetObjListTop((POBJLIST)pObj); uCurpos = OSD_GetObjListCurPoint((POBJLIST)pObj); switch(event) { case EVN_PRE_DRAW: movefile_display_items(uTop); break; case EVN_POST_DRAW: break; case EVN_ITEM_PRE_CHANGE: break; case EVN_ITEM_POST_CHANGE: break; case EVN_UNKNOWN_ACTION: ret = movefile_item_enter(uCurpos); break; default: break; } return ret; }
static PRESULT mail_unknow_proc(VACTION act) { PRESULT ret = PROC_LOOP; UINT16 i,sel, cnt; OBJLIST *ol; POBJECT_HEAD temp; UINT8 back_saved; ol = &mail_ol; sel = OSD_GetObjListCurPoint(ol); cnt = OSD_GetObjListCount(ol); switch (act) { case VACT_DELETE_SINGLE: { mail_del_type = 0; //if(email_count > 0) //{ // win_compopup_init(WIN_POPUP_TYPE_OKNO); //win_compopup_set_msg(NULL, NULL, RS_MAIL_POP_DEL_CURRENT); //win_compopup_open_ext(&back_saved); mail_set_del_flag(sel); //mail_exec_delete(); //yuanlin change OSD_TrackObject((POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); //} } break; case VACT_DELETE_ALL: mail_del_type = 1; { //win_compopup_init(WIN_POPUP_TYPE_OKNO); //win_compopup_set_msg(NULL, NULL, RS_MAIL_POP_DEL_ALL); //win_compopup_open_ext(&back_saved); mail_set_del_flag(0xffff);//set all to delete //mail_exec_delete(); //yuanlin change OSD_TrackObject((POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); }; //----yuanlin break; case VACT_ENTER: if (0 == email_count) break; // ---yuanlin cur_mail_id = sel; temp = (POBJECT_HEAD)&g_win_mail_content; //进入到Win_mail_content界面 if (OSD_ObjOpen(temp, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_push(temp); if(email_head[sel].status) email_count_unread--; //MailDrawNum0(); //yuanlin 21013/02/04 } break; default: break; } return ret; }
static void win_mail_scroll_string() { POBJLIST ol = &mail_ol; UINT16 cur_point = 0; cur_point = OSD_GetObjListCurPoint(ol); cur_point -= OSD_GetObjListTop(ol); wincom_scroll_textfield((PTEXT_FIELD)mail_titles[cur_point]); }
static void win_tpsrch_set_search_param(UINT32 fta_only,UINT32 srch_chan,UINT32 nit_flag) { S_NODE s_node; T_NODE t_node; struct as_service_param param; OBJLIST* ol; UINT16 tp_idx; struct vdec_device *vdec; struct vdec_io_get_frm_para vfrm_param; UINT32 addr, len; ol = &tplst_olist; tp_idx = OSD_GetObjListCurPoint(ol); get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node); get_tp_at(s_node.sat_id,tp_idx,&t_node); #ifdef NEW_DEMO_FRAME MEMSET(¶m, 0, sizeof(struct as_service_param)); param.as_frontend_type = FRONTEND_TYPE_S; param.as_prog_attr = fta_only |srch_chan; param.as_to = 0; param.as_sat_cnt = 1; param.sat_ids[0] = s_node.sat_id; param.as_from = t_node.tp_id; #else param.as_prog_attr = fta_only |srch_chan; param.as_to = 0; param.as_sat_id = s_node.sat_id; param.as_from = t_node.tp_id; #endif param.as_method = nit_flag? AS_METHOD_NIT_TP : AS_METHOD_TP; param.as_p_add_cfg = PROG_ADD_REPLACE_OLD; // set param win_search_set_param(¶m); update_data(); #if 0 vdec = (struct vdec_device *)dev_get_by_id(HLD_DEV_TYPE_DECV, 0); vfrm_param.ufrm_mode = VDEC_UN_DISPLAY; vdec_io_control(vdec, VDEC_IO_GET_FRM, (UINT32)&vfrm_param); addr = vfrm_param.tFrmInfo.uC_Addr; len = (vfrm_param.tFrmInfo.uHeight*vfrm_param.tFrmInfo.uWidth*3)/2; #else addr = __MM_AUTOSCAN_DB_BUFFER_ADDR; addr &= 0x8fffffff; len = __MM_AUTOSCAN_DB_BUFFER_LEN; #endif db_search_init((UINT8 *)addr, len); }
static PRESULT win_detitle_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; OBJLIST* ol = &detitle_olist; UINT16 tmp, num=0; struct help_item_resource detitle_help[] = { {1,IM_EPG_COLORBUTTON_RED,RS_HELP_DELETE}, {1,IM_EPG_COLORBUTTON_GREEN,RS_DELETE_ALL}, {1,IM_HELP_ICON_TB,RS_HELP_SELECT}, }; switch(event) { case EVN_PRE_OPEN: init_detitle_flag(); tmp = detitle_get_info(&num); if (0 == tmp) { ret = PROC_LEAVE; break; } OSD_SetObjListCount(ol, num); if (num <= OSD_GetObjListCurPoint(&detitle_olist)) { OSD_SetObjListCurPoint (&detitle_olist, 0); OSD_SetObjListNewPoint (&detitle_olist, 0); OSD_SetObjListTop (&detitle_olist, 0); //OSD_SetObjListNewPoint(&detitle_olist, 0); } wincom_open_title_ext(RS_DETITLE, IM_TITLE_ICON_SYSTEM); wincom_open_help(detitle_help, 3); win_init_pstring(18); break; case EVN_POST_OPEN: break; case EVN_PRE_CLOSE: /* Make OSD not flickering */ save_detitle(); *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; break; case EVN_POST_CLOSE: //TFCAS_WriteFlash();//write to flash at once, ignore the delay break; } return ret; }
static PRESULT con_ci_info_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT8 unact; switch(event) { case EVN_UNKNOWN_ACTION: ret = PROC_LOOP; unact = (VACTION)(param1>>16) ; if(unact == VACT_ENTER) { if(ci_info.menu.is_selectable) { UINT16 menu_index = OSD_GetObjListCurPoint(&olst_ci_info); api_ci_menu_select(ci_slot, menu_index); if(!reading_dlg_shown) //reading_dlg_open("Reading data"); reading_dlg_open_strid(RS_READING_DATA); } else { if (win_ci_info_modal == WIN_CI_INFO_SHOW_AS_MODAL) { ret = PROC_LEAVE; } else { UINT32 hkey; ap_vk_to_hk(0, V_KEY_EXIT, &hkey); ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, TRUE); } } } else if (unact == VACT_SELECT) { ret = PROC_LEAVE; } break; default: break; } return ret; }
static void win_wifilist_refresh_signal_bar(BOOL force_refresh) { UINT32 quality_percent, sel, i; OBJLIST* ol; if(api_wifi_get_device_connected_status()) { AP_List[0].quality=api_wifi_get_connected_ap_signal_quality(); quality_percent = api_wifi_convert_signal_quality_to_percentage(AP_List[0].quality); DEBUG_PRINTF("[++++] Current Connected AP\n"); DEBUG_PRINTF("quality=%d/100\n", quality_percent); } else { if(AP_Num) { ol = &wifilist_olist; sel = OSD_GetObjListCurPoint(ol); DEBUG_PRINTF("[++++] Current Selected AP[%d]\n", sel); quality_percent = api_wifi_convert_signal_quality_to_percentage(AP_List[sel].quality); DEBUG_PRINTF("quality=%d/100\n", quality_percent); } else { quality_percent=0; } } if((force_refresh)||(prev_quality_percent!=quality_percent)||(g_ui_wifi_manager_state!=WIFI_UI_AP_CONNECTING)) { prev_quality_percent=quality_percent; if(api_wifi_get_device_connected_status()) { win_wifilist_update_wifi_ap_list_display(TRUE); } win_signal_set_wifi_level_quality(quality_percent, quality_percent,1); win_signal_update(); } }
INT32 mail_update_info() { UINT8 ret,i,j; UINT8 total, newmail; gycamail data; OBJLIST* ol = &mail_ol; MEMSET(email_head, 0, sizeof(gycamail_head)*GYCA_EMAIL_MAX_CNT); email_count = GYCA_EMAIL_MAX_CNT; ret = gyca_getmail_condition_from_ram(&total, &newmail); if (GYCA_OK != ret) { //cas_popup_msg(NULL, NULL, RS_CAERR_NOINFO); //email_count = 0; //return 0; total = 0; newmail = 0; email_count = 0; } email_count_unread = newmail; for(i=0,j=0; i<total; i++) { MEMSET(&data, 0, sizeof(gycamail)); if(!gyca_readmail_one_from_ram(i, &data)) { MEMCPY(email_head[j].title, data.info.m_szEmail_Title, STRLEN(data.info.m_szEmail_Title)); MEMCPY(email_head[j].create_Time, data.info.m_byEmail_Create_Time, 5); email_head[j].status = data.status; j++; } } email_count = j; OSD_SetObjListCount(ol, email_count); if (email_count <= OSD_GetObjListCurPoint(ol)) { OSD_SetObjListCurPoint(ol, 0); OSD_SetObjListNewPoint(ol, 0); OSD_SetObjListTop(ol, 0); } return 1; }
static PRESULT IPPVinfo_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT32 cnt = 0; INT32 iret; switch(event) { case EVN_PRE_OPEN: total_IPPV_number = 0; iret = IPPVinfo_got_info(); if(0 == iret) { ret = PROC_LEAVE; break; } OSD_SetObjListCount(&IPPVinfo_olist,total_IPPV_number); //for different card display if (total_IPPV_number <= OSD_GetObjListCurPoint(&IPPVinfo_olist)) { //OSD_SetObjListNewPoint(&IPPVinfo_olist, 0); OSD_SetObjListCurPoint (&IPPVinfo_olist, 0); OSD_SetObjListNewPoint (&IPPVinfo_olist, 0); OSD_SetObjListTop (&IPPVinfo_olist, 0); } wincom_open_title_ext(RS_IPPV_PROGRAM, IM_TITLE_ICON_SYSTEM); wincom_open_help(win_opinfo_help, 2); win_init_pstring(9); break; case EVN_POST_OPEN: // win_ippv_draw_title(); break; case EVN_PRE_CLOSE: /* Make OSD not flickering */ *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; break; case EVN_POST_CLOSE: break; } return ret; }
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; }
static PRESULT playlst_list_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { UINT8 bID; UINT16 uTop,uCnt,uCurpos; PRESULT ret = PROC_PASS; VACTION unact; uCnt = OSD_GetObjListCount((POBJLIST)pObj); uTop = OSD_GetObjListTop((POBJLIST)pObj); uCurpos = OSD_GetObjListCurPoint((POBJLIST)pObj); bID = uCurpos - uTop; switch(event) { case EVN_PRE_DRAW: ret = PROC_LOOP; if(param1 == C_DRAW_TYPE_HIGHLIGHT) { playlist_display_items(uTop); OSD_TrackObject(pObj, C_UPDATE_ALL); } break; case EVN_POST_DRAW: break; case EVN_ITEM_PRE_CHANGE: break; case EVN_ITEM_POST_CHANGE: break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); ret = playlist_colorkey_proc(unact); break; default: break; } return ret; }
static void win_tplist_tuner_frontend(void) { S_NODE s_node; T_NODE t_node; #ifdef NEW_DEMO_FRAME struct ft_antenna antenna; union ft_xpond xpond_info; struct nim_device *nim = NULL; #else struct cc_antenna_info antenna; struct cc_xpond_info xpond_info; #endif OBJLIST* ol; UINT32 tp_idx; UINT16 pre_sat_id,cur_sat_id; UINT8 back_saved; BOOL old_get_key; nim_io_control(g_nim_dev, NIM_DRIVER_STOP_CHANSCAN, 0); ap_set_key_notify_proc(win_tplist_key_notify_proc); old_get_key = ap_enable_key_task_get_key(TRUE); win_signal_set_level_quality(0, 0, 0); win_signal_update(); OSD_UpdateVscr(OSD_GetTaskVscr(osal_task_get_current_id())); ol = &tplst_olist; tp_idx = OSD_GetObjListCurPoint(ol); get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx,&s_node); get_tp_at(s_node.sat_id,tp_idx,&t_node); #ifdef SUPPORT_TWO_TUNER #ifdef SUPPORT_SELECT_SAME_SAT cur_tuner_idx = s_node.reserve_1; //antset_cur_tuner;//s_node.tuner1_valid? 0 : 1; #else cur_tuner_idx = s_node.tuner1_valid? 0 : 1; #endif #endif #ifndef NEW_DEMO_FRAME struct cc_antenna_info antenna; struct cc_xpond_info xpond_info; sat2antenna_ext(&s_node, &antenna,cur_tuner_idx); xpond_info.frq = t_node.frq; xpond_info.sym = t_node.sym; xpond_info.pol = t_node.pol; set_antenna(&antenna); set_xpond(&xpond_info); #else MEMSET(&antenna, 0, sizeof(struct ft_antenna)); MEMSET(&xpond_info, 0, sizeof(union ft_xpond)); sat2antenna(&s_node, &antenna); xpond_info.s_info.type = FRONTEND_TYPE_S; xpond_info.s_info.frq = t_node.frq; xpond_info.s_info.sym = t_node.sym; xpond_info.s_info.pol = t_node.pol; xpond_info.s_info.tp_id = t_node.tp_id; #ifdef SUPPORT_SELECT_SAME_SAT nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, ((s_node.reserve_1 == 0)? 0 : ((s_node.reserve_1 == 1) ? 1 : 0))); #else nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, (s_node.tuner1_valid ? 0 : (s_node.tuner2_valid ? 1 : 0))); #endif frontend_tuning(nim, &antenna, &xpond_info, 1); #endif if(pre_tp_sat_idx != cur_tp_sat_idx) { get_tuner_sat(TUNER_EITHER, pre_tp_sat_idx, &s_node); pre_sat_id = s_node.sat_id; get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node); cur_sat_id = s_node.sat_id; wincom_dish_move_popup_open(/*pre_sat_id*/0xFFFF,cur_sat_id,cur_tuner_idx,&back_saved); pre_tp_sat_idx = cur_tp_sat_idx; } ap_enable_key_task_get_key(old_get_key); ap_set_key_notify_proc(NULL); nim_io_control(g_nim_dev, NIM_DRIVER_STOP_CHANSCAN, 0); }
static PRESULT win_detitle_list_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; OBJLIST* ol; POBJECT_HEAD temp; UINT8 back_saved, deldtl; UINT16 cnt,curitem,top,ret2,i; ol = &detitle_olist; curitem = OSD_GetObjListCurPoint(ol); cnt = OSD_GetObjListCount(ol); switch(event) { case EVN_PRE_DRAW: win_detitle_list_display(); break; case EVN_POST_DRAW: break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if (unact == VACT_DEL_SINGLE_DETITLE) { if(cnt!=0) { detitle_set_del_flag(curitem); OSD_TrackObject((POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } /*win_compopup_init(WIN_POPUP_TYPE_OKNO); win_compopup_set_msg(NULL, NULL, RS_DETITLE_DELPOP_CURRENT); win_compopup_set_default_choice(WIN_POP_CHOICE_NO); ret2= win_compopup_open_ext(&back_saved); if (ret2 == WIN_POP_CHOICE_YES) { //to do deldtl = CDCASTB_DelDetitleChkNum(current_operator_ID, Detitle_Chknum[curitem]); if (FALSE == deldtl) { win_popup_msg(NULL, NULL, RS_OPERATION_ERROR); } ret = PROC_LEAVE; }*/ } else if(unact == VACT_DEL_ALL_DETITLE) { detitle_set_alldel_flag(); OSD_TrackObject((POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); /*win_compopup_init(WIN_POPUP_TYPE_OKNO); win_compopup_set_msg(NULL, NULL, RS_DETITLE_DELPOP_ALL); win_compopup_set_default_choice(WIN_POP_CHOICE_NO); ret2= win_compopup_open_ext(&back_saved); if (ret2 == WIN_POP_CHOICE_YES) { //to do deldtl = CDCASTB_DelDetitleChkNum(current_operator_ID, 0); if (FALSE == deldtl) { win_popup_msg(NULL, NULL, RS_OPERATION_ERROR); } ret = PROC_LEAVE; }*/ } break; } return ret; }
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; }
static PRESULT win_tplist_list_unkown_act_proc(VACTION act) { PRESULT ret = PROC_LOOP; UINT8 pre_sat_idx; UINT16 sel,sat_cnt; OSD_RECT rect; COM_POP_LIST_PARAM_T param; OBJLIST* ol; S_NODE s_node; T_NODE t_node; UINT32 freq,symb,pol; UINT8 back_saved; UINT32 ftaonly_VPid,srch_chan_APid,nit_PPid; UINT32 choice; POBJECT_HEAD sub_menu; INT32 iret; UINT16 pre_sat_id,cur_sat_id; sat_cnt = get_tuner_sat_cnt(TUNER_EITHER); get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node); ol = &tplst_olist; sel = OSD_GetObjListCurPoint(ol); pre_sat_idx = cur_tp_sat_idx; switch(act) { case VACT_SAT_PRE: if(cur_tp_sat_idx > 0) cur_tp_sat_idx --; else cur_tp_sat_idx = sat_cnt - 1; goto SAT_CHANGE; case VACT_SAT_NEXT: if(cur_tp_sat_idx < (sat_cnt - 1)) cur_tp_sat_idx ++; else cur_tp_sat_idx = 0; goto SAT_CHANGE; case VACT_SAT_SELECT: param.id = TUNER_EITHER; param.cur = cur_tp_sat_idx; param.selecttype = POP_LIST_SINGLESELECT; OSD_SetRect(&rect, LST_SAT_L - 20 , LST_SAT_T, LST_SAT_W + 40, 360); rect.uTop += LST_SAT_H; sel = win_com_open_sub_list(POP_LIST_TYPE_SAT,&rect,¶m); if(sel < sat_cnt) cur_tp_sat_idx = sel; goto SAT_CHANGE; SAT_CHANGE: tp_list_pos = 0; tp_list_top = 0; if(cur_tp_sat_idx != pre_sat_idx) { pre_tp_sat_idx = pre_sat_idx; get_tuner_sat(TUNER_EITHER, pre_sat_idx, &s_node); pre_sat_id = s_node.sat_id; get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node); cur_sat_id = s_node.sat_id; #ifdef SUPPORT_TWO_TUNER #ifdef SUPPORT_SELECT_SAME_SAT cur_tuner_idx = s_node.reserve_1; //s_node.tuner1_valid? 0 : 1; #else cur_tuner_idx = s_node.tuner1_valid? 0 : 1; #endif #endif if(win_tplist_check_change()) update_data(); win_tplist_load_sat(TRUE); //OSD_TrackObject( (POBJECT_HEAD)&tplst_olist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); OSD_TrackObject( (POBJECT_HEAD)&g_win_tplist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); api_stop_timer(&tpturn_timer_id); tpturn_timer_id = api_start_timer(TPTURN_TIMER_NAME, TPTURN_TIMER_TIME, win_tplist_tpturn_handler); } break; case VACT_TP_EDIT: /* If not TP, can't EDIT */ if(OSD_GetObjListCount(ol) == 0) break; get_tp_at(s_node.sat_id,sel, &t_node); choice = win_tpe_open(0, s_node.sat_id, t_node.tp_id); if( choice) { win_tpe_get_setting(&freq, &symb, &pol); if(freq != t_node.frq || symb != t_node.sym || pol != t_node.pol) { t_node.frq = freq; t_node.sym = symb; t_node.pol = pol; modify_tp(t_node.tp_id,&t_node); api_stop_timer(&tpturn_timer_id); tpturn_timer_id = api_start_timer(TPTURN_TIMER_NAME, TPTURN_TIMER_TIME, win_tplist_tpturn_handler); } } //OSD_TrackObject( (POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); OSD_TrackObject( (POBJECT_HEAD)&g_win_tplist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; case VACT_TP_ADD: if(OSD_GetObjListCount(ol) == MAX_TP_NUM) break; extern UINT32 edit_tp_exist; edit_tp_exist = 0; choice = win_tpe_open(1, s_node.sat_id, 0); if(choice) { win_tpe_get_setting(&freq, &symb, &pol); MEMSET(&t_node,0,sizeof(t_node) ); t_node.frq = freq; t_node.sym = symb; t_node.pol = pol; t_node.sat_id = s_node.sat_id; iret = add_node(TYPE_TP_NODE,s_node.sat_id,(void*)&t_node); if((iret == DBERR_MAX_LIMIT) || (iret == DBERR_FLASH_FULL)) { OSD_TrackObject( (POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_msg(NULL,NULL, RS_DISPLAY_TOO_MANY_TP); win_compopup_open_ext(&back_saved); break; } OSD_SetObjListCount(ol, OSD_GetObjListCount(ol) + 1); //OSD_TrackObject( (POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); OSD_TrackObject( (POBJECT_HEAD)&g_win_tplist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); OSD_ChangeFocus((POBJECT_HEAD)ol,OSD_GetObjListCount(ol) - 1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); api_stop_timer(&tpturn_timer_id); tpturn_timer_id = api_start_timer(TPTURN_TIMER_NAME, TPTURN_TIMER_TIME, win_tplist_tpturn_handler); } else { OSD_TrackObject( (POBJECT_HEAD)&g_win_tplist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); //OSD_TrackObject( (POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); if( edit_tp_exist > 0) { OSD_ChangeFocus((POBJECT_HEAD)ol,edit_tp_exist - 1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); edit_tp_exist = 0; } //OSD_TrackObject( (POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } break; case VACT_TP_DEL: /* If not TP, can't DEL */ if(OSD_GetObjListCount(ol) == 0) break; win_compopup_init(WIN_POPUP_TYPE_OKNO); win_compopup_set_msg(NULL, NULL,RS_DISPLAY_SURE_TO_DELETE); if(win_compopup_open_ext(&back_saved) != WIN_POP_CHOICE_YES) break; get_tp_at(s_node.sat_id,sel, &t_node); del_tp_by_id(t_node.tp_id); OSD_SetObjListCount(ol, OSD_GetObjListCount(ol) -1); OSD_TrackObject( (POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); if( OSD_GetObjListCount(ol) > 0) { if(sel == OSD_GetObjListCount(ol)) /* Delete last TP */ OSD_ChangeFocus((POBJECT_HEAD)ol,OSD_GetObjListCount(ol) - 1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); else tpturn_timer_id = api_start_timer(TPTURN_TIMER_NAME, TPTURN_TIMER_TIME, win_tplist_tpturn_handler); } break; case VACT_TP_SRCH: /* If not TP, can't SEARCH */ if(OSD_GetObjListCount(ol) == 0) break; sys_data_set_cur_satidx(cur_tp_sat_idx); tp_list_pos = OSD_GetObjListCurPoint(ol); tp_list_top = OSD_GetObjListTop(ol); choice = win_tpsrch_open(&ftaonly_VPid,&srch_chan_APid,&nit_PPid); if(choice==1) { win_tpsrch_set_search_param(ftaonly_VPid,srch_chan_APid,nit_PPid); sub_menu = (POBJECT_HEAD)&g_win_search; wincom_close_help(); if(OSD_ObjOpen(sub_menu, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_push(sub_menu); set_movedish_flag(TRUE);/*only tp search,need not moving dish when return*/ } } else if(choice==2) //pid search { tp_VPid = ftaonly_VPid; tp_APid = srch_chan_APid; tp_PPid = nit_PPid; prog_callback_register((prog_node_return)win_tplist_set_search_pid_callback); get_tp_at(s_node.sat_id,sel,&t_node); win_search_set_pid_param(t_node.tp_id, tp_VPid, tp_APid, tp_PPid); win_tpsrch_set_search_param(P_SEARCH_FTA|P_SEARCH_SCRAMBLED,P_SEARCH_TV|P_SEARCH_RADIO,0); sub_menu = (POBJECT_HEAD)&g_win_search; wincom_close_help(); if(OSD_ObjOpen(sub_menu, 0xFFFFFFFF) != PROC_LEAVE) menu_stack_push(sub_menu); } else { //OSD_TrackObject( (POBJECT_HEAD)ol, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); OSD_TrackObject( (POBJECT_HEAD)&g_win_tplist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } break; } return ret; }
static PRESULT satlst_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; switch(event) { case EVN_PRE_OPEN: win_init_pstring(30); win_satlist_check_focusID(1); win_satlist_load_sat_select(); wincom_open_subtitle(pObj,RS_SATELLITE_LIST,0); break; case EVN_POST_OPEN: wincom_open_help_1(pObj,satlist_helpinfo , HELP_CNT); break; case EVN_PRE_CLOSE: win_satlist_save_sat_select(); /* 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); sys_data_check_channel_groups(); break; case EVN_MSG_GOT: { //added by Eric.Ren, 接收control task 的消息,处理kingofsat 更新,2010.7.30 #ifdef KINGOFSAT_SUPPORT OBJLIST* ol; UINT16 sel; S_NODE s_node; INT32 kingofsat_tp_num = 0; //可更新的TP个数 UINT8 back_saved; if(param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH) { if((INT32)param2 < 0) { win_compopup_smsg_restoreback(); 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("Downloading error,Try again!", NULL, 0); win_compopup_open_ext(&back_saved); osal_task_sleep(2000); win_compopup_smsg_restoreback(); break ; } ol = &satlist_olist; sel = OSD_GetObjListCurPoint(ol); get_sat_at(sel,VIEW_ALL,&s_node); //判断是有可更新的TP 数据 kingofsat_get_tp_num(&kingofsat_tp_num); if(kingofsat_tp_num == 0) { win_compopup_smsg_restoreback(); 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("NO TP in downloading data!", NULL, 0); win_compopup_open_ext(&back_saved); osal_task_sleep(1000); win_compopup_smsg_restoreback(); break; } kingofsat_parse(); //解析下载数据 recreate_tp_view(VIEW_SINGLE_SAT, s_node.sat_id);//创建TP view kingofsat_update(s_node.sat_id); //更新数据 kingofsat_destroy(); //释放资源 OSD_TrackObject( (POBJECT_HEAD)&g_win_satlist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); recreate_sat_view(VIEW_ALL, 0); //创建SAT view } #endif break; } default: break; } return ret; }
static PRESULT win_conax_list_unkown_act_proc(VACTION act) { PRESULT ret = PROC_LOOP; OBJLIST* ol; UINT16 sel; UINT32 choice; UINT8* sat_name; UINT32 sat_orbit; UINT8 back_saved; INT32 iret; //CAS_KEYINFO *Pm = NULL; ol = &conax_olist; sel = OSD_GetObjListCurPoint(ol); //Pm = (CAS_KEYINFO *) softcam_get_keydata((u8) CAS_ID_VIACCESS1,sel); switch(act) { #if 0 case VACT_NAGRA_RSA: if(OSD_ObjOpen((POBJECT_HEAD)&g_win_nagra_rsa, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_nagra_rsa); } break; #endif case VACT_NAGRA2_RSA: #if 1 if(OSD_ObjOpen((POBJECT_HEAD)&g_win_nagra2_rsa, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_nagra2_rsa); } #endif break; case VACT_MORE: if(OSD_ObjOpen((POBJECT_HEAD)&g_win_viaccess2, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_viaccess2); } break; case VACT_CONAX: #if 0 if(OSD_ObjOpen((POBJECT_HEAD)&g_win_conax, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_conax); } #endif break; case VACT_patch_EDIT_WIN: //soc_printf("%s\n",Pm->ChanName); if(OSD_GetObjListCount(ol) == 0) break; win_patch_open(CAS_ID_CONAX, sel); OSD_TrackObject( (POBJECT_HEAD)&g_win_conax, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; default: break; } return ret; }
static PRESULT mail_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; BOOL changed; UINT8 TV_Out; UINT16 x, y, w, h; VACTION unact; UINT8 av_mode, id; UINT16 chan_idx; UINT8 rating; UINT16 rating_ret; OBJLIST* ol = &mail_ol; /*struct help_item_resource mail_help[] = { {1,IM_EPG_COLORBUTTON_RED,RS_HELP_DELETE}, {1,IM_EPG_COLORBUTTON_GREEN,RS_DELETE_ALL}, {1,IM_HELP_ICON_TB,RS_HELP_SELECT}, {0,RS_HELP_ENTER,RS_HELP_ENTER_INTO}, }; */ switch (event) { case EVN_PRE_OPEN: OSD_ClearObject((POBJECT_HEAD)&g_win_mainmenu, C_UPDATE_ALL); rating_ret = GYCA_GetParentControl(&rating); /*if ((CDCA_RC_CARD_INVALID == rating_ret)|| (CDCA_RC_POINTER_INVALID ==rating_ret)) { win_popup_msg(NULL, NULL, RS_CAERR_NOSMC); return PROC_LEAVE; } else if (CDCA_RC_OK != rating_ret) { win_popup_msg(NULL, NULL, RS_CAERR_UNKNOWN); return PROC_LEAVE; } */ MEMSET(display_strs[0], 0, sizeof(display_strs[0])*MAX_DISP_STR_ITEMS); //wincom_open_title_ext(RS_EMAIL, IM_TITLE_ICON_EMAIL); //wincom_open_help(mail_help, 4); mail_got_info(); //mail_init_str(20); //mail_clear_del_flag(); if(email_count<=100) OSD_SetObjListCount(ol, email_count); else OSD_SetObjListCount(ol, 100); if (email_count <= OSD_GetObjListCurPoint(ol)) { OSD_SetObjListCurPoint(ol, 0); OSD_SetObjListNewPoint(ol, 0); OSD_SetObjListTop(ol, 0); } //CDCASTB_RequestMaskBuffer(); break; case EVN_POST_OPEN: MailDrawNum0(); wincom_scroll_textfield_resume(); break; case EVN_PRE_CLOSE: mail_exec_delete(); if(menu_stack_get(0)==((POBJECT_HEAD)&g_win_mainmenu)) *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; else { wincom_close_title(); wincom_close_help(); *((UINT32*)param2) &= C_CLOSE_CLRBACK_FLG; } //CDCASTB_RequestUpdateBuffer(); wincom_scroll_textfield_pause(); break; case EVN_POST_CLOSE: break; case EVN_MSG_GOT: if( param1 == CTRL_MSG_SUBTYPE_STATUS_SCROLL_STRING) win_mail_scroll_string(); if(param1 == CTRL_MSG_SUBTYPE_STATUS_SIGNAL) ret = PROC_LOOP; default: break; } return ret; }
void mail_exec_delete() { BOOL flag = TRUE; UINT32 i, ret = GYCA_OK; UINT8 back_saved; win_popup_choice_t choice; UINT16 sel; OBJLIST *ol; ol = &mail_ol; sel = OSD_GetObjListCurPoint(ol); if (FALSE == mail_check_del_flag()) { return; } if(mail_del_type == 0) { mail_delete_one(sel); gyca_check_new_mail(); } else if(mail_del_type == 1) { mail_delete_all(); gyca_check_new_mail(); } else{;} #if 0 //first check if all mails need to be deleted for (i=0; i<email_count; i++) { if (FALSE == mail_get_del_flag(i)) { flag = FALSE; break; } } if ((TRUE == flag) && (TRUE == del_all_flag)) { // ret = DVTCASTB_DelEmail(-1); //libc_printf("$$MAIL DEL ALL\n"); } else { for (i=0; i<email_count; i++) { if (TRUE == mail_get_del_flag(i)) { // ret = DVTCASTB_DelEmail(email_head[i].m_dwVersion); if (ret != GYCA_OK) break; } } //libc_printf("$$MAIL DEL SINGLE\n"); } // if(ret == DVTCAERR_STB_NO_EMAIL) // { // cas_popup_msg(NULL, NULL, RS_MAIL_DEL_ERR); // } #endif mail_clear_del_flag(); }
static PRESULT win_biss_list_unkown_act_proc(VACTION act) { PRESULT ret = PROC_LOOP; OBJLIST* ol; UINT16 sel; UINT32 choice; UINT8* sat_name; UINT32 sat_orbit; UINT8 back_saved; INT32 iret; //CAS_KEYINFO *Pm = NULL; ol = &biss_olist; sel = OSD_GetObjListCurPoint(ol); //Pm = (CAS_KEYINFO *) softcam_get_keydata((u8) CAS_ID_BISS,sel); switch(act) { case VACT_BISS: #if 0 if(OSD_ObjOpen((POBJECT_HEAD)&g_win_biss2, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_biss2); } #endif break; case VACT_CRYPTOWORK: if(OSD_ObjOpen((POBJECT_HEAD)&g_win_cryptowork, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_cryptowork); } break; case VACT_MORE: if(OSD_ObjOpen((POBJECT_HEAD)&g_win_seca, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_seca); } break; case VACT_DIRECT_CW: if(OSD_ObjOpen((POBJECT_HEAD)&g_win_direct_cw, 0xFFFFFFFF) != PROC_LEAVE) { menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_direct_cw); } break; case VACT_patch_EDIT_WIN: //soc_printf("%s\n",Pm->ChanName); if(OSD_GetObjListCount(ol) == 0) break; win_patch1_open(CAS_ID_BISS, sel); OSD_TrackObject( (POBJECT_HEAD)&g_win_biss, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; default: break; } return ret; }
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; }
static PRESULT news_list_win_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT8 back_saved; INT32 news_list_num = 0; switch(event) { case EVN_PRE_OPEN: #ifdef EXIT_KEY_EXIT_ALL_MENU exit_key_flag = FALSE; #endif bGetContent = FALSE; news_list_load(param2); break; case EVN_POST_OPEN: wincom_open_subtitle(pObj,RS_NEWS,0); break; case EVN_PRE_CLOSE: news_terminate(); break; case EVN_POST_CLOSE: if(news!=1||news!=0) libnet_download_abort((unsigned long)news); news=0; wincom_close_subtitle(); #ifdef EXIT_KEY_EXIT_ALL_MENU if(( exit_key_flag == TRUE)||((sys_data_get_sate_group_num(RADIO_CHAN)==0)&&(sys_data_get_sate_group_num(TV_CHAN)==0)))//解决无节目还可以进默认页面导致死机问题 { exit_key_flag =FALSE; mm_leave_all_menu(); } #endif break; case EVN_MSG_GOT: if (param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH) { news=0; if ((int)param2 >= 0) { win_compopup_smsg_restoreback(); news_list_num = news_parse(); if (news_list_num <= 0) { win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_msg((UINT8*)"Error",NULL,0); win_compopup_open_ext(&back_saved); } else { bGetContent = TRUE; win_news_detail_open(OSD_GetObjListCurPoint(&ol_news_list)); } } else { win_compopup_smsg_restoreback(); win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_msg((UINT8*)"Error",NULL,0); win_compopup_open_ext(&back_saved); ret = PROC_LOOP; } } break; default: break; } return ret; }
/* static void win_operator_IPPV_draw(GUI_RECT* pRect,UINT16 strid) { TEXT_FIELD* txt; UINT16 *string; //index: 0 for title, 1~9 for list item txt = &IPPVinfo_title; OSD_SetRect2(&txt->head.frame,pRect); if (txt->pString != NULL) { txt->pString = NULL; } OSD_SetTextFieldContent(txt, STRING_ID, (UINT32)strid); OSD_DrawObject((POBJECT_HEAD)txt, C_UPDATE_ALL); } void win_ippv_draw_title(void) { UINT8 i; for (i=0;i<6;i++) { win_operator_IPPV_draw(&win_ippv_title_rect[i], win_ippv_title_string[i]); } } */ static void ippv_txt_info_display(UINT16 info_idx,PCONTAINER pCon) { UINT8 i,j,date[11]; UINT16 top,index, curitem,count,strid=0; PTEXT_FIELD pTxt; OBJLIST *ol = &IPPVinfo_olist; PCONTAINER ppcon; curitem = OSD_GetObjListCurPoint(ol); count = OSD_GetObjListCount(ol); top = OSD_GetObjListTop(ol); index = top +info_idx -1; //for container index is 1,2,....9 ppcon = pCon; if (count == 0) { IPPVINFO_PRINT("@@@@ippv_txt_info_display: list count is 0!\n "); } else if (index<count) { for(i = 0;i < IPPVINFO_ITEM_TXT_CNT; i++) { pTxt= IPPVinfo_listtxt[i]; OSD_SetObjRoot(pTxt,ppcon); OSD_SetContainerFocus(ppcon,1); OSD_SetObjRect(pTxt, pTxt->head.frame.uLeft, ppcon->head.frame.uTop, pTxt->head.frame.uWidth, pTxt->head.frame.uHeight); if (i==0)//operator id { OSD_SetTextFieldContent(pTxt, STRING_NUMBER, (UINT32)current_operator_ID); OSD_SetContainerNextObj(ppcon, pTxt); } if (i==1)//slot id { OSD_SetTextFieldContent(pTxt, STRING_NUMBER, (UINT32)IPPV_program_info[index].m_bySlotID); } if (i==2)//prog id { OSD_SetTextFieldContent(pTxt, STRING_NUMBER, (UINT32)IPPV_program_info[index].m_dwProductID); } if (i==3)//booking status { switch(IPPV_program_info[index].m_byBookEdFlag) { case CDCA_IPPVSTATUS_BOOKING: // 1 for booking strid = 0; break; case 2: // 2 for expired????? (how to confirm??) strid = 0; break; case CDCA_IPPVSTATUS_VIEWED: // 3 for viewed strid = RS_IPPV_STATUS_VIEWED; break; } OSD_SetTextFieldContent(pTxt, STRING_ID, (UINT32)strid); } if (i==4)//tape { OSD_SetTextFieldContent(pTxt, STRING_ANSI, (UINT32)((IPPV_program_info[index].m_bCanTape)?"Yes":"No")); } if (i==5)//price { OSD_SetTextFieldContent(pTxt, STRING_NUMBER, (UINT32)IPPV_program_info[index].m_wPrice); } if (i==6)//expired time { YMD_calculate(IPPV_program_info[index].m_wExpiredDate, date); OSD_SetTextFieldContent(pTxt, STRING_ANSI, (UINT32)date); } } if ((curitem%9) == (info_idx-1)) OSD_TrackObject((POBJECT_HEAD)ppcon, C_UPDATE_ALL); else OSD_DrawObject((POBJECT_HEAD)ppcon, C_UPDATE_ALL); } else { for(i = 0;i < IPPVINFO_ITEM_TXT_CNT; i++) { pTxt= IPPVinfo_listtxt[i]; OSD_SetObjRoot(pTxt,ppcon); OSD_SetObjRect(pTxt, pTxt->head.frame.uLeft, ppcon->head.frame.uTop, pTxt->head.frame.uWidth, pTxt->head.frame.uHeight); if (3==i) OSD_SetTextFieldContent(pTxt, STRING_ID, (UINT32)0); else OSD_SetTextFieldContent(pTxt, STRING_ANSI, (UINT32)""); } } }