static UINT16 get_sat_idx_in_selected_sats2(UINT16 sat_cnt_selected) { S_NODE s_node; UINT16 sat_id; INT16 ant_set_sat_id=get_ant_set_sat_idx(); UINT16 i,sat_idx; get_tuner_sat(antset_cur_tuner, ant_set_sat_id,&s_node); sat_id=s_node.sat_id; for(i=0;i<sat_cnt_selected;i++) { get_sat_at(i/*sel*/,SET_SELECTED,&s_node); if(s_node.sat_id==sat_id) break; } sat_idx=i; if(sat_idx >= sat_cnt_selected) sat_idx = 0; return sat_idx; #if 0 #ifdef SUPPORT_TWO_TUNER { UINT16 Uni_str[50]; S_NODE s_node; for(i=0;i<sat_cnt;i++) { get_tuner_sat_name(2,i,Uni_str); get_sat_at(i/*sel*/,SET_SELECTED,&s_node); #ifdef SUPPORT_SELECT_SAME_SAT //OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, ((s_node.reserve_1 == 0) ? RS_LNB1 : RS_LNB2)); if(s_node.reserve_1==antset_cur_tuner) break; #else //OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, (s_node.tuner1_valid ? RS_LNB1 : RS_LNB2)); if(((s_node.tuner1_valid)&&(antset_cur_tuner==0)) ||((s_node.tuner2_valid)&&(antset_cur_tuner==1))) break; #endif } } sat_idx=i; #endif #endif }
static PRESULT satsrch_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT32 sel; UINT8 bID; char str[10]; UINT16 * Uni_str; UINT8* pstr; UINT16 cur_idx; COM_POP_LIST_TYPE_T list_type; OSD_RECT rect; COM_POP_LIST_PARAM_T param; UINT16 i,n = 0; S_NODE s_node; UINT32 flag; bID = OSD_GetObjID(pObj); switch(event) { case EVN_PRE_CHANGE: sel = *((UINT32*)param1); break; case EVN_POST_CHANGE: sel = param1; if(bID == MODE_ID) win_satsrch_set_nitactive(TRUE); if(bID == SAT_ID) { get_sat_at(sel,SET_SELECTED,&s_node); #ifdef SUPPORT_TWO_TUNER //guop modify #ifdef SUPPORT_SELECT_SAME_SAT OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, ((s_node.reserve_1 == 0) ? RS_LNB1 : RS_LNB2)); #else OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, (s_node.tuner1_valid ? RS_LNB1 : RS_LNB2)); #endif OSD_DrawObject((POBJECT_HEAD)&satsrch_txt6_note, C_UPDATE_ALL); #endif } break; case EVN_REQUEST_STRING: sel = param1; Uni_str= (UINT16*)param2; if(bID == SAT_ID) { get_tuner_sat_name(2,sel,Uni_str); sys_data_set_cur_satidx(sel); } break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_POP_UP) { OSD_SetRect2(&rect,&pObj->frame); switch(bID) { case SAT_ID: rect.uLeft -= 80; rect.uWidth += 80; list_type = POP_LIST_TYPE_SAT; rect.uHeight = 300; param.id = TUNER_EITHER; param.cur = SATSRCH_SAT_IDX; if(single_multi_srch_flag == 0) param.selecttype = POP_LIST_SINGLESELECT; else { MEMSET(sat_select,0,sizeof(sat_select)); n = get_tuner_sat_cnt(TUNER_EITHER); if(n == 0) { list_type = 0xFF; break; } for(i=0;i<n;i++) { get_tuner_sat(TUNER_EITHER,i,&s_node); if(s_node.selected_flag) sat_select[i] = 1; } #if (defined(SUPPORT_TWO_TUNER) || !defined(SELECT_SAT_ONLY)) param.selecttype = POP_LIST_MULTISELECT; #else param.selecttype = POP_LIST_SINGLESELECT; #endif param.select_array = sat_select; } break; default: list_type = 0xFF; } if(list_type == 0xFF) break; cur_idx = win_com_open_sub_list(list_type,&rect,¶m); if(single_multi_srch_flag == 0) { if(cur_idx == LIST_INVALID_SEL_IDX || cur_idx == param.cur) break; } else { /* Check the select satellite */ #if (defined(SUPPORT_TWO_TUNER) || !defined(SELECT_SAT_ONLY)) for(i=0;i<n;i++) { if(win_comlist_ext_check_item_sel(i)) flag = 1; else flag = 0; get_tuner_sat(TUNER_EITHER,i,&s_node); if(s_node.selected_flag != flag) { s_node.selected_flag = flag; modify_sat(s_node.sat_id, &s_node); } } update_data(TYPE_SAT_NODE); #endif } if(single_multi_srch_flag == 0) SATSRCH_SAT_IDX = cur_idx; get_sat_at(cur_idx,SET_SELECTED,&s_node); #ifdef SUPPORT_SELECT_SAME_SAT OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, ((s_node.reserve_1 == 0) ? RS_LNB1 : RS_LNB2)); #else OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, (s_node.tuner1_valid ? RS_LNB1 : RS_LNB2)); #endif OSD_DrawObject((POBJECT_HEAD)&satsrch_txt6_note, C_UPDATE_ALL); OSD_TrackObject((POBJECT_HEAD)&satsrch_item1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); if(single_multi_srch_flag) { /* TODO : Draw the select satellites name */ win_satsrch_set_drawselectsats(); } } break; } return ret; }
static PRESULT otaset_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT8 bID; UINT32 sel; UINT16 * Uni_str; S_NODE s_node; VACTION unact; COM_POP_LIST_TYPE_T list_type; OSD_RECT rect; COM_POP_LIST_PARAM_T param; UINT16 cur_idx; bID = OSD_GetObjID(pObj); switch(event) { case EVN_REQUEST_STRING: sel = param1; Uni_str= (UINT16*)param2; if(bID == EDIT_TP_SATE_ID) { #ifdef _BUILD_OTA_E_ ComAscStr2Uni("Fixed Sat", Uni_str); #else get_tuner_sat_name(OTA_TUNER_IDX,sel,Uni_str); #endif } else if(bID == EDIT_TP_TPIDX_ID) { get_tuner_sat(cur_tuner_idx,SAT_POS,&s_node); #ifdef _BUILD_OTA_E_ ComAscStr2Uni("Fixed TP", Uni_str); #else get_tp_name(s_node.sat_id,sel,Uni_str); #endif } break; case EVN_POST_CHANGE: sel = param1; if(bID == EDIT_TP_SATE_ID) win_otaset_load_sat_setting(sel,TRUE); else if(bID == EDIT_TP_TPIDX_ID) win_otaset_load_tp_setting(sel,TRUE); win_otaset_turn_frntend(); break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_POP_UP) { ret = PROC_LOOP; OSD_SetRect2(&rect,&pObj->frame); param.selecttype = POP_LIST_SINGLESELECT; switch(bID) { case EDIT_TP_SATE_ID: rect.uLeft -= 40; rect.uWidth += 40; list_type = POP_LIST_TYPE_SAT; rect.uHeight = 300;//230; param.id = OTA_TUNER_IDX; param.cur = SAT_POS; break; case EDIT_TP_TPIDX_ID: list_type = POP_LIST_TYPE_TP; rect.uHeight = 300;//230; get_tuner_sat(OTA_TUNER_IDX,SAT_POS,&s_node); param.id = s_node.sat_id; param.cur = TP_POS; break; default: list_type = 0xFF; break; } if(list_type == 0xFF) break; cur_idx = win_com_open_sub_list(list_type,&rect,¶m); if(cur_idx == LIST_INVALID_SEL_IDX || cur_idx == param.cur) break; if(bID == EDIT_TP_SATE_ID) { SAT_POS = cur_idx; OSD_TrackObject((POBJECT_HEAD)&wota_con0, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); win_otaset_load_sat_setting((UINT32)cur_idx, TRUE); } else if(bID == EDIT_TP_TPIDX_ID) { TP_POS = cur_idx; OSD_TrackObject((POBJECT_HEAD)&wota_con1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); win_otaset_load_tp_setting((UINT32)cur_idx,TRUE); } win_otaset_turn_frntend(); } } return ret; }
static PRESULT motorset_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT32 sel; UINT16* Uni_str; UINT8 bID; COM_POP_LIST_TYPE_T list_type; OSD_RECT rect; COM_POP_LIST_PARAM_T param; S_NODE s_node; UINT16 cur_idx; UINT8 back_saved; bID = OSD_GetObjID(pObj); switch(event) { case EVN_REQUEST_STRING: sel = param1; Uni_str= (UINT16*)param2; if(bID == SAT_ID) get_tuner_sat_name(antset_cur_tuner,sel,Uni_str); else //TP_ID { get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node); get_tp_name(s_node.sat_id,sel,Uni_str); } break; case EVN_POST_CHANGE: sel = param1; SAT_TP_CHANGED: /* Need to turn SAT/TP here*/ if(bID == SAT_ID) { win_motorset_load_sat(SAT_IDX,TRUE); win_motorset_set_frontend(); get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node); wincom_dish_move_popup_open(0xFFFF,s_node.sat_id,antset_cur_tuner,&back_saved); } else { win_motorset_turn_tp(); } break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_ENTER) { param.selecttype = POP_LIST_SINGLESELECT; OSD_SetRect2(&rect,&pObj->frame); rect.uLeft -= 40; rect.uWidth += 40; if(bID == SAT_ID) { list_type = POP_LIST_TYPE_SAT; list_type = POP_LIST_TYPE_SAT; rect.uHeight = 300; param.id = antset_cur_tuner; param.cur = SAT_IDX; } else// if(bID == TP_ID) { list_type = POP_LIST_TYPE_TP; list_type = POP_LIST_TYPE_TP; rect.uHeight = 300; get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node); param.id = s_node.sat_id; param.cur = TP_IDX; } cur_idx = win_com_open_sub_list(list_type,&rect,¶m); if(cur_idx == LIST_INVALID_SEL_IDX || cur_idx == param.cur) break; if(bID == SAT_ID) SAT_IDX = cur_idx; else TP_IDX = cur_idx; OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); sel = cur_idx; goto SAT_TP_CHANGED; } break; } return ret; }
static PRESULT atnsetf_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT32 sel; UINT8 bID; char str[30]; UINT16 * Uni_str; UINT8* pstr; SYSTEM_DATA* sys_data; POBJECT_HEAD other_antset_menu,item; S_NODE s_node; UINT16 cur_idx; COM_POP_LIST_TYPE_T list_type; OSD_RECT rect; COM_POP_LIST_PARAM_T param; MULTISEL* msel; sys_data = sys_data_get(); bID = OSD_GetObjID(pObj); switch(event) { case EVN_PRE_CHANGE: sel = *((UINT32*)param1); if(bID == TUNER_ID) { if(TUNER_CNT < 2) break; /* Check tuner : sel has selected satellite or not.*/ if(get_tuner_sat_cnt(sel) == 0) { UINT8 back_saved; win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_msg(NULL,NULL, RS_TUNER_HAS_NO_SATE_SEL); win_compopup_open_ext(&back_saved); antset_cur_tuner = (sel == 0)? 1: 0; win_atnsetf_load_sat_cnt(FALSE); ret = PROC_LOOP; } else { antset_cur_tuner = sel; cur_tuner_idx = antset_cur_tuner; } } break; case EVN_POST_CHANGE: sel = param1; if(bID == LNB_ID) { win_atnsetf_load_22k_action(TRUE); #ifdef SUPPORT_UNICABLE if(win_unicable_setting_open(LNB_IDX)) OSD_TrackObject((POBJECT_HEAD)&g_win_antenna_set_fixed, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); #endif } if(bID == TUNER_ID) { if(sys_data->tuner_lnb_type[sel] != LNB_FIXED) { /* Need to change : Motor antenna setting menu. */ other_antset_menu = (POBJECT_HEAD)&g_win_antenna_set_motor; if(OSD_ObjOpen(other_antset_menu, MENU_OPEN_TYPE_MENU + bID) != PROC_LEAVE) { win_signal_close(); menu_stack_pop(); menu_stack_push(other_antset_menu); } ret = PROC_LOOP; } else { win_atnsetf_load_sat_cnt(TRUE); win_atnsetf_load_sat_setting(0,TRUE); } } else if(bID == SAT_ID) win_atnsetf_load_sat_setting(sel,TRUE); else if(bID != TP_ID) { win_atnsetf_modify_sat_setting(SAT_IDX); } if(ret != PROC_LOOP) { api_stop_timer(&set_frontend); set_frontend = api_start_timer("SETANT",600,(OSAL_T_TIMER_FUNC_PTR)atnsetf_set_frontend_handler); } break; case EVN_REQUEST_STRING: sel = param1; Uni_str= (UINT16*)param2; if(bID == SAT_ID) { get_tuner_sat_name(antset_cur_tuner,sel,Uni_str); sys_data_set_cur_satidx(sel); } else if(bID == TP_ID) { get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node); get_tp_name(s_node.sat_id,sel,Uni_str); #ifdef SUPPORT_SELECT_SAME_SAT s_node.reserve_1 = antset_cur_tuner; modify_sat(s_node.sat_id, &s_node); update_data(); #endif } else if(bID == LNB_ID) get_lnb_name(sel,Uni_str); else if(bID == DISEQC11_ID) get_diseqc11_name(sel,Uni_str); else if(bID == IF_CHANNEL_ID) get_IF_channel_name(sel,Uni_str); else if(bID == CENTRE_FREQ_ID) get_centre_freqs_name(sel,Uni_str); break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_POP_UP) { OSD_SetRect2(&rect,&pObj->frame); /*Patch: For solve pop-up windows show bugs,for example: Universal(5150-10600) can not be all show*/ OSD_SetRect(&rect, rect.uLeft, rect.uTop, (rect.uWidth + 10), rect.uHeight); param.selecttype = POP_LIST_SINGLESELECT; switch(bID) { case SAT_ID: rect.uLeft -= 40; rect.uWidth += 40; list_type = POP_LIST_TYPE_SAT; rect.uHeight = 300; param.id = antset_cur_tuner; param.cur = SAT_IDX; break; case LNB_ID: list_type = POP_LIST_TYPE_LNB; rect.uHeight = 300; param.cur = LNB_IDX; break; case TP_ID: list_type = POP_LIST_TYPE_TP; rect.uHeight = 340; get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node); param.id = s_node.sat_id; param.cur = TP_IDX; break; case DISEQC10_ID: list_type = POP_LIST_TYPE_DISEQC10; rect.uHeight = 280; param.cur = DISEQC10_IDX; break; case DISEQC11_ID: list_type = POP_LIST_TYPE_DISEQC11; rect.uHeight = 240; param.cur = DISEQC11_IDX; break; case IF_CHANNEL_ID: list_type = POP_LIST_TYPE_IF_CHANNEL; rect.uHeight = 200; param.cur = IF_CHANNEL_IDX; break; case CENTRE_FREQ_ID: list_type = POP_LIST_TYPE_CENTRE_FREQ; rect.uHeight = 200; param.cur = CENTRE_FREQ_IDX; break; default: list_type = 0xFF; break; } if(list_type == 0xFF) break; cur_idx = win_com_open_sub_list(list_type,&rect,¶m); if(cur_idx == LIST_INVALID_SEL_IDX || cur_idx == param.cur) break; item = anesetf_items[bID - 1]; msel = anesetf_msels[bID - 1]; switch(bID) { case SAT_ID: SAT_IDX = cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); win_atnsetf_load_sat_setting((UINT32)cur_idx, TRUE); break; case LNB_ID: LNB_IDX = cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); win_atnsetf_load_22k_action(TRUE); #ifdef SUPPORT_UNICABLE if(win_unicable_setting_open(LNB_IDX)) OSD_TrackObject((POBJECT_HEAD)&g_win_antenna_set_fixed, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); #endif break; /* case TP_ID: TP_IDX = cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; case DISEQC10_ID: DISEQC10_IDX = cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; case DISEQC11_ID: DISEQC11_IDX = cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; case IF_CHANNEL_ID: IF_CHANNEL_IDX= cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; case CENTRE_FREQ_ID: CENTRE_FREQ_IDX= cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; */ default: msel->nSel = cur_idx; OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); break; } if(bID != SAT_ID && bID != TP_ID) win_atnsetf_modify_sat_setting(SAT_IDX); api_stop_timer(&set_frontend); set_frontend = api_start_timer("SETANT",500,(OSAL_T_TIMER_FUNC_PTR)atnsetf_set_frontend_handler); } break; } return ret; }