/* change group and recreate program view with current channel mode, then play it * this function does too many things, should be changed later.. */ void change_group(INT32 shift) { UINT16 cur_channel, max_channel; P_NODE p_node; UINT32 n; SYSTEM_DATA *sys_data; UINT8 cur_chan_mode; BOOL b_ret; sys_data = sys_data_get(); sys_data_change_group(0); cur_chan_mode = sys_data_get_cur_chan_mode(); cur_channel = sys_data_get_cur_group_cur_mode_channel(); max_channel = get_prog_num(VIEW_ALL | cur_chan_mode, 0); if (cur_channel >= max_channel) cur_channel = 0; n = 0; get_prog_at(cur_channel, &p_node); while ( ( p_node.skip_flag || ( sys_data->chan_sw == CHAN_SWITCH_FREE && p_node.ca_mode ) || ( sys_data->chan_sw == CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode ) ) && n != max_channel ) { cur_channel = (cur_channel + 1+max_channel) % max_channel; get_prog_at(cur_channel, &p_node); n++; }; // if (show_and_playchannel) // { // sys_data_set_cur_group_channel(cur_channel); //win_progname_redraw(); // } #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CONAX) /*clean msg*/ clean_mmi_msg(1, TRUE); clean_mmi_msg(3, TRUE); clean_mmi_msg(4, TRUE); clean_mmi_msg(6, TRUE); if(get_mmi_showed()==1||get_mmi_showed()==6) win_mmipopup_close(); if(get_mmi_showed()!=5) set_mmi_showed(10); #endif #endif api_play_channel(cur_channel, TRUE, TRUE, FALSE); #ifdef AD_SANZHOU szxc_ad_hide_txt(); szxc_ad_show_txt(p_node.prog_number); szxc_ad_hide_pic(AD_BANNER); szxc_ad_show_banner(p_node.prog_number,banner_pic_rt); #endif }
void change_group(INT32 shift) { UINT8 cur_group,max_group; UINT16 cur_channel,max_channel; UINT8 group_type, group_pos; S_NODE s_node; P_NODE p_node; UINT32 n; SYSTEM_DATA* sys_data; UINT8 cur_chan_mode; sys_data = sys_data_get(); max_group = sys_data_get_group_num(); cur_group = sys_data_get_cur_group_index(); cur_group = (cur_group + shift + max_group) % max_group; sys_data_set_cur_group_index(cur_group); sys_data_get_cur_mode_group_infor(cur_group, &group_type, &group_pos,&cur_channel); cur_chan_mode = sys_data_get_cur_chan_mode(); if(group_type==ALL_SATE_GROUP_TYPE) { PRINTF("========Change to ALL_SATE_GROUP_TYPE\n"); recreate_prog_view(VIEW_ALL|cur_chan_mode,0); } else if(group_type==SATE_GROUP_TYPE) { get_sat_at(group_pos,VIEW_ALL,&s_node); recreate_prog_view(VIEW_SINGLE_SAT|cur_chan_mode,s_node.sat_id); PRINTF("========Change to SATE_GROUP_TYPE(%d,%s)\n",group_pos,s_node.sat_name); } else { PRINTF("========Change to FAV_GROUP_TYPE(%d)\n",group_pos); recreate_prog_view(VIEW_FAV_GROUP|cur_chan_mode,group_pos); } max_channel = get_prog_num(VIEW_ALL|cur_chan_mode,0); if(cur_channel>= max_channel) cur_channel = 0; n = 0; get_prog_at(cur_channel, &p_node); while( (p_node.skip_flag || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode) || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode) ) && n!=max_channel) { cur_channel = (cur_channel + 1 + max_channel) % max_channel; get_prog_at(cur_channel, &p_node); n++; }; api_play_channel(cur_channel, TRUE, TRUE,FALSE); }
void win_multifeed_set_display(void) { TEXT_FIELD *txt; OBJLIST* ol; UINT16 i,cnt,top_idx,cur_idx,dep; P_NODE p_node; UINT16 channel; UINT8 name[32]; channel = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(channel,&p_node); ol = &multifeed_ol; cnt = OSD_GetObjListCount(ol); dep = OSD_GetObjListPage(ol); top_idx = OSD_GetObjListTop(ol); for(i=0;i<dep;i++) { cur_idx = top_idx + i; txt = text_items[i]; if(cur_idx < cnt ) { multifeed_get_feed_name(p_node.prog_id, cur_idx, name); OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)name); } else OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)""); } }
INT32 multifeed_change_feed(UINT16 channel, UINT32 idx) { INT32 ret; T_NODE t_node; P_NODE p_node; P_NODE *feed_pnode; UINT16 pmt_pid = 0x1FFF, video_pid = 0x1FFF, audio_pid = 0x1FFF, pcr_pid = 0x1FFF; struct MULTIFEED_INFO *multifeed_cur; struct FEED_INFO *feed_info; get_prog_at(channel, &p_node); multifeed_cur = multifeed_service_find(p_node.prog_id); if(multifeed_cur == NULL) return MULTIFEED_FAILURE; if(idx >= multifeed_cur->num) return MULTIFEED_FAILURE; if(idx == multifeed_cur->idx) return MULTIFEED_FAILURE; undo_prog_modify(p_node.tp_id, p_node.prog_number); if(idx==0) { multifeed_cur->idx = idx; return MULTIFEED_SUCCESS; } mf_debug("%s(ch=%d, fd=%d)\n", __FUNCTION__, channel, idx ); feed_info = get_feed_node(multifeed_cur, idx); if(feed_info->is_known) { multifeed_cur->idx = idx; // check feed info valid or not if( verify_feed_info( feed_info ) != MULTIFEED_SUCCESS ) { // trans to the tp, has some problem in logic, middle layer call app layer api_play_channel(channel, TRUE, FALSE,FALSE); // get pat info ret = search_pat_buff( multifeed_pat_buff, 1024, feed_info->service_id, &pmt_pid ); if( ret != MULTIFEED_SUCCESS ) { ret = find_info_in_pat( feed_info->transport_stream_id, feed_info->service_id, &pmt_pid ); } if( ret == MULTIFEED_SUCCESS ) { // get pmt info MEMCPY( &p_node, &feed_info->p_node, sizeof(P_NODE) ); // reuse p_node mf_debug("Going to get pids of feed: %s\n", feed_info->name ); ret = get_pid_in_pmt( pmt_pid, &p_node ); if( ret == MULTIFEED_SUCCESS ) { MEMCPY( &feed_info->p_node, &p_node, sizeof(P_NODE) ); } } } return MULTIFEED_SUCCESS; } return MULTIFEED_FAILURE; }
/* * create list for the service that has feed info * feed nodes belong to this service managed by feed_head/feed_tail */ static struct MULTIFEED_INFO *multifeed_service_create( UINT32 tp_id, UINT16 service_id ) { P_NODE p_node; INT32 i = 0; struct MULTIFEED_INFO *p = (struct MULTIFEED_INFO *)MALLOC(sizeof(struct MULTIFEED_INFO)); if (p != NULL) { MEMSET(p, 0, sizeof(struct MULTIFEED_INFO)); while(SUCCESS == get_prog_at(i, &p_node)) { if((p_node.tp_id==tp_id) && (p_node.prog_number==service_id)) { p->prog_id = p_node.prog_id; p->sat_id = p_node.sat_id; break; } i++; } p->tp_id = tp_id; p->service_id = service_id; } mf_debug("%s(): \n \t v:%d, a:%d, pmt:%d\n", __FUNCTION__, p_node.video_pid, p_node.audio_pid[0], p_node.pmt_pid); return p; }
void win_multifeed_load(void) { OBJLIST* ol; P_NODE p_node; UINT16 channel,cnt,sel,top_idx,cur_idx,dep; struct MULTIFEED_INFO multifeed_info; INT32 ret; ol = &multifeed_ol; channel = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(channel,&p_node); MEMSET(&multifeed_info, 0, sizeof(struct MULTIFEED_INFO)); ret = multifeed_get_info(p_node.prog_id, &multifeed_info); sel = 0xFFFF; cnt = multifeed_info.num; if(multifeed_info.idx < cnt) sel= multifeed_info.idx; dep = OSD_GetObjListPage(ol); cur_idx = 0; top_idx = 0; if(sel<multifeed_info.num) cur_idx = sel; top_idx = cur_idx / dep * dep; OSD_SetObjListCount(ol, cnt); OSD_SetObjListSingleSelect(ol, sel); OSD_SetObjListTop(ol, top_idx); OSD_SetObjListCurPoint(ol, cur_idx); OSD_SetObjListNewPoint(ol, cur_idx); }
void win_timerset_timerserviceinfo_change(BOOL update,UINT16 sel) { MULTISEL *msel; TIMER_SET_CONTENT* settimer; P_NODE p_node; UINT16 ch_idx,ch_cnt; settimer = &timer_set; msel = &timer_msel_serviceinfo; if(TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE) { OSD_SetMultiselSelType(msel,STRING_ID); OSD_SetMultiselCount(msel,3); OSD_SetMultiselSelTable(msel, (void*)WakeupMessageStr_id); if(sel >=3) sel = 0; settimer->wakeup_message = sel; OSD_SetMultiselSel(msel,settimer->wakeup_message); } else { if(get_prog_at(sel,&p_node) == DB_SUCCES) ch_idx = sel; else { ch_idx = sel = 0; get_prog_at(sel,&p_node); } settimer->wakeup_channel = p_node.prog_id; ch_cnt = get_prog_num(VIEW_ALL | settimer->wakeup_chan_mode, 0); OSD_SetMultiselSelType(msel,STRING_PROC); OSD_SetMultiselCount(msel,ch_cnt); OSD_SetMultiselSel(msel, ch_idx); } if(update) OSD_DrawObject((POBJECT_HEAD)&timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG |C_UPDATE_ALL); }
void change_fav_channel(INT32 shift) { UINT16 cur_channel,max_channel; P_NODE p_node; UINT32 i,n; SYSTEM_DATA* sys_data; UINT32 fav_mask; fav_mask = 0; for(i=0;i<MAX_FAVGROUP_NUM;i++) fav_mask |= (0x01<<i); sys_data = sys_data_get(); max_channel = get_prog_num(VIEW_ALL|sys_data->cur_chan_mode[sys_data->normal_group_idx], 0); if(max_channel==0) return; cur_channel = sys_data_get_cur_group_cur_mode_channel(); n = 0; do{ cur_channel = (cur_channel + shift + max_channel) % max_channel; get_prog_at(cur_channel, &p_node); if(shift==0) shift = 1; n++; }while( (p_node.skip_flag || ( (p_node.fav_group[0] & fav_mask) == 0 ) || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode) || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode)) && n!=max_channel); if(p_node.skip_flag || ( (p_node.fav_group[0] & fav_mask) == 0) || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode) || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode) ) return; /* If first time show the osd and play channel, to avoid display incorrect channel when meet skip channel. */ if(show_and_playchannel) { sys_data_set_cur_group_channel(cur_channel); win_progname_redraw(); } api_play_channel(cur_channel, TRUE, TRUE,FALSE); }
static int SetTP(unsigned int argc, unsigned char *argv[]) { UINT32 freq; UINT32 sym; UINT16 channel; T_NODE t_node; P_NODE p_node; if (argc != 3) { SH_PRINTF("Usage: SetPara <freq> <sym>\n"); return -1; } freq = ATOI(argv[1]); sym = ATOI(argv[2]); reset_group(); channel = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(channel,&p_node); get_tp_by_id(p_node.tp_id, &t_node); recreate_tp_view(VIEW_SINGLE_SAT, t_node.sat_id); t_node.frq = freq; t_node.sym = sym; modify_tp(t_node.tp_id,&t_node); api_play_channel(p_node.prog_id, TRUE, FALSE, TRUE); //UIChChgPlayProg(0,p_node.prog_id); //UIChChgPlayProg(0,CC_CMD_RESET_CRNT_CH);//for 3501D sfu test //UIChChgPlayProg(0,p_node.prog_id); //LIB_ASH_OC('\r'); //LIB_ASH_OC('\n'); LIB_ASH_OC('S'); LIB_ASH_OC('U'); LIB_ASH_OC('C'); LIB_ASH_OC('C'); LIB_ASH_OC('E'); LIB_ASH_OC('S'); LIB_ASH_OC('S'); LIB_ASH_OC('\r'); LIB_ASH_OC('\n'); reset_perflag(); return 0; }
eit_event_info_t* epg_get_cur_service_event(INT32 prog_idx, UINT32 event_type,date_time *start_dt,date_time *end_dt,INT32 *event_num, BOOL update) { P_NODE service_info; if (event_num != NULL) *event_num = 0; if (SUCCESS==get_prog_at(prog_idx, &service_info)) { return epg_get_service_event(service_info.tp_id, service_info.prog_number, event_type, start_dt, end_dt, event_num, update); } else return NULL; }
eit_event_info_t* epg_get_first_event(INT32 prog_idx, UINT32 event_type,date_time *dt,INT32 *event_num) { P_NODE service_info; T_NODE tp_info; UINT16 service_id,orig_nw_id,ts_id; eit_tp_t *tp=NULL; eit_event_info_t *ep=NULL; eit_service_info_t *sp=NULL; if (SUCCESS==get_prog_at(prog_idx,&service_info)) { service_id=service_info.prog_number; get_tp_by_id(service_info.tp_id, &tp_info); orig_nw_id=tp_info.network_id; ts_id=tp_info.t_s_id; #ifdef EPG_NETWORK_PATCH tp=epg_get_tp(get_tp_header(),service_info.tp_id,ts_id); #else tp=epg_get_tp(get_tp_header(),orig_nw_id,ts_id); #endif *event_num=0; if (NULL==tp) return NULL; sp=epg_get_service(tp,service_id); if (NULL== sp) return NULL; if (event_type==PRESENT_EVENT) { ep=epg_get_present_event(sp); } else if (event_type==FOLLOWING_EVENT) ep=epg_get_following_event(sp); else { // ep=epg_get_schdedule_event(sp,date,event_num); ep=sp->sch_event_header[0]; } return ep; // return epg_get_event(get_tp_header(), orig_nw_id, ts_id, service_id, event_type, dt, event_num); } else return NULL; }
static PRESULT timerlst_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT8 bID; TIMER_SET_CONTENT rettimer,*timer; SYSTEM_DATA* sys_data; P_NODE p_node; UINT16 curview_index = 0; bID = OSD_GetObjID(pObj); sys_data = sys_data_get(); switch(event) { case EVN_PRE_DRAW: break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_ENTER) { sys_data->timer_set.common_timer_num = bID; timer = &sys_data->timer_set.TimerContent[bID - 1]; if(timer->timer_mode==TIMER_MODE_OFF) { timer->wakeup_chan_mode = sys_data_get_cur_chan_mode(); curview_index = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(curview_index,&p_node); timer->wakeup_channel = p_node.prog_id; }/*if the timer if off,set the default channel as current playing one.*/ if(win_timerset_open(timer,&rettimer,timer->timer_mode==TIMER_MODE_OFF)) MEMCPY(timer,&rettimer,sizeof(TIMER_SET_CONTENT)); OSD_TrackObject((POBJECT_HEAD)&g_win_timerlist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } break; default: ; } return ret; }
static PRESULT osd_item_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT8 unact,input; UINT8 id = OSD_GetObjID(pObj); BOOL bchanged = FALSE; UINT16 cur_channel = 0; P_NODE p_node; switch(event) { case EVN_FOCUS_PRE_GET: break; case EVN_FOCUS_PRE_LOSE: break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16) ; if((unact == VACT_INCREASE) || (unact == VACT_DECREASE)) { win_LCN_left_right_key(pObj,id); bchanged = TRUE; cur_channel = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(cur_channel, &p_node); } if(sys_data_get_LCN()) sort_prog_node(PROG_LCN_SORT); else sort_prog_node(PROG_DEFAULT_SORT); //-m by wangyang 2011-12-21 //sort_prog_node(PROG_TYPE_SID_SORT); update_data(); if (bchanged) { cur_channel = get_prog_pos(p_node.prog_id); sys_data_set_cur_group_channel(cur_channel); } ret = PROC_LOOP; break; } return ret; }
void win_otaset_load_default_setting(BOOL checkonly) { INT8 rule[20]; UINT32 freq, symbol, constellation, freq_def; P_NODE p_node; T_NODE t_node; UINT32 prog_num; UINT16 cur_channel; UINT8 dot_pos; UINT32 channel_number=0,fi=0; SYSTEM_DATA* sys_data; sys_data = sys_data_get(); if(sys_data->current_ft_count > 0) { ota_symb = sys_data->current_ft[0].c_param.sym; ota_modulation = sys_data->current_ft[0].c_param.constellation; } get_default_bandparam(sys_data->country, (Band_param *)&uCountryParam); prog_num = get_prog_num(VIEW_ALL | TV_CHAN | RADIO_CHAN , 0); if (0 != prog_num) { get_prog_at( sys_data_get_cur_group_cur_mode_channel(),&p_node); get_tp_by_id(p_node.tp_id,&t_node); ota_freq = t_node.frq; ota_symb = t_node.sym; ota_modulation= t_node.FEC_inner; } else { ota_freq = uCountryParam[0].start_freq; ota_symb = sys_data->current_ft[0].c_param.sym; ota_modulation= sys_data->current_ft[0].c_param.constellation; } ota_pid = OTA_DATA_PID;
void win_screen_prog_infor(void) { UINT16 cur_channel; P_NODE p_node; char string[100]={0}; UINT16 unistr_dest[200]={0}; TEXT_FIELD* txt; txt = &g_screen_saver_text; BITMAP* bmp; bmp = &g_screen_saver_bmp; memset(string,0,sizeof(string)); memset(unistr_dest,0,sizeof(unistr_dest)); cur_channel = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(cur_channel,&p_node); sprintf(string,"%04d ",cur_channel + 1); ComAscStr2Uni(string,unistr_dest); ComUniStrCat(&unistr_dest,(UINT32)p_node.service_name); if( p_node.ca_mode) //guop add 20110624 { OSD_SetTextFieldContent(txt, STRING_ANSI,(UINT32)"Scrambled"); } else { OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)unistr_dest); } txt->head.frame.uTop = top_offset+70; txt->head.frame.uLeft= left_offset+20; // OSD_SetBitmapContent(bmp, IM_SCREEN_SAVER_RADIO); OSD_SetBitmapContent(bmp, IM_VOLUME); bmp->head.frame.uTop = top_offset+15; bmp->head.frame.uLeft= left_offset+85; }
eit_event_info_t* epg_get_cur_service_event(INT32 prog_idx, UINT32 event_type,date_time *dt,INT32 *event_num) { P_NODE service_info; T_NODE tp_info; UINT16 service_id,orig_nw_id,ts_id; eit_tp_t tp; if (SUCCESS==get_prog_at(prog_idx,&service_info)) { service_id=service_info.prog_number; get_tp_by_id(service_info.tp_id, &tp_info); orig_nw_id=tp_info.network_id; ts_id=tp_info.t_s_id; #ifdef EPG_NETWORK_PATCH return epg_get_event(get_tp_header(), service_info.tp_id, ts_id, service_id, event_type, dt, event_num); #else return epg_get_event(get_tp_header(), orig_nw_id, ts_id, service_id, event_type, dt, event_num); #endif } else return NULL; }
void win_timerset_timerservice_change(BOOL update) { UINT8 action; TEXT_FIELD* txt; MULTISEL *msel; UINT16 ch_idx,ch_cnt; TIMER_SET_CONTENT* settimer; P_NODE p_node; settimer = &timer_set; if(TIMER_MODE == TIMER_MODE_OFF) action = C_ATTR_INACTIVE; else { if((TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE) ||(!pvr_info.hdd_valid) ||(TIMER_SERVICE_TYPE == TIMER_SERVICE_CHANNEL)) action = C_ATTR_INACTIVE; else action = C_ATTR_ACTIVE; } /* TIMER service information: message or channel */ txt = &timer_txt_serviceinfo; msel = &timer_msel_serviceinfo; if(TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE) { /* TIMER_SERVICE_SMG */ OSD_SetMultiselSelType(msel,STRING_ID); OSD_SetMultiselCount(msel,3); OSD_SetMultiselSelTable(msel, (void*)WakeupMessageStr_id); if(settimer->wakeup_message>=3) settimer->wakeup_message = 0; OSD_SetMultiselSel(msel,settimer->wakeup_message); } else { //modified by Robin if(get_prog_by_id(settimer->wakeup_channel,&p_node) == DB_SUCCES) ch_idx = get_prog_pos(settimer->wakeup_channel); else ch_idx = sys_data_get_cur_group_cur_mode_channel(); ch_cnt = get_prog_num(VIEW_ALL | settimer->wakeup_chan_mode, 0); OSD_SetMultiselSelType(msel,STRING_PROC); OSD_SetMultiselCount(msel,ch_cnt); OSD_SetMultiselSel(msel, ch_idx); } OSD_SetTextFieldContent(txt, STRING_ID, (UINT32)TimerServiceTxtStr_id[TIMER_SERVICE_TYPE]); if(update) OSD_DrawObject((POBJECT_HEAD)&timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG |C_UPDATE_ALL); set_container_active(&timer_con_duration,action); if(update) OSD_DrawObject((POBJECT_HEAD)&timer_con_duration, C_UPDATE_ALL); get_prog_at(settimer->wakeup_channel, &p_node); if((TIMER_SERVICE_TYPE != TIMER_SERVICE_DVR_RECORD) || (p_node.ca_mode == 1)) { action = C_ATTR_INACTIVE; settimer->wakeup_message = 0; } else if((TIMER_SERVICE_TYPE == TIMER_SERVICE_DVR_RECORD) && (!pvr_info.hdd_valid))//guop add action = C_ATTR_INACTIVE; else action = C_ATTR_ACTIVE; set_container_active(&timer_con_rec_type,action); msel = &timer_msel_rec_type; if(action == C_ATTR_ACTIVE) { if(settimer->wakeup_message > 2) settimer->wakeup_message = 0; } OSD_SetMultiselSel(msel, settimer->wakeup_message); if(update) OSD_DrawObject((POBJECT_HEAD)&timer_con_rec_type, C_UPDATE_ALL); }
void win_timerset_timermode_change(BOOL update) { UINT8 action; MULTISEL *msel; TIMER_SET_CONTENT* settimer; P_NODE p_node; UINT8 ifpvr; settimer = &timer_set; if(TIMER_MODE == TIMER_MODE_OFF) //guop modify 20100629 { action = C_ATTR_INACTIVE; ifpvr = C_ATTR_INACTIVE; } else { action = C_ATTR_ACTIVE; if(!pvr_info.hdd_valid) ifpvr = C_ATTR_INACTIVE; else ifpvr = C_ATTR_ACTIVE; } //if(OSD_CheckAttr(&timer_con_servicetype, action)) // return; set_container_active(&timer_con_servicetype,ifpvr); set_container_active(&timer_con_serviceinfo,action); set_container_active(&timer_con_wakeupdate,action); set_container_active(&timer_con_wakeupweekday,action); set_container_active(&timer_con_wakeuptime,action); set_container_active(&timer_con_duration,ifpvr); set_container_active(&timer_con_rec_type,ifpvr); // if(ifpvr == C_ATTR_ACTIVE && ((TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE) ||( TIMER_SERVICE_TYPE == TIMER_SERVICE_CHANNEL))) // ifpvr = C_ATTR_INACTIVE; // set_container_active(&timer_con_duration,ifpvr); msel = &timer_msel_rec_type; get_prog_at(settimer->wakeup_channel, &p_node); /*if((TIMER_MODE == TIMER_MODE_OFF) || (TIMER_SERVICE_TYPE != TIMER_SERVICE_DVR_RECORD) || (p_node.ca_mode == 1) ) { ifpvr = C_ATTR_INACTIVE; settimer->wakeup_message = 0; } else if((TIMER_SERVICE_TYPE == TIMER_SERVICE_DVR_RECORD) && (!pvr_info.hdd_valid)) ifpvr = C_ATTR_INACTIVE; else ifpvr = C_ATTR_ACTIVE; set_container_active(&timer_con_duration,ifpvr); set_container_active(&timer_con_rec_type,ifpvr); */ if(ifpvr == C_ATTR_ACTIVE) { if(settimer->wakeup_message > 2) settimer->wakeup_message = 0; } OSD_SetMultiselSel(&timer_msel_rec_type, settimer->wakeup_message); if(update) { OSD_DrawObject((POBJECT_HEAD)&timer_con_servicetype, C_UPDATE_ALL); OSD_DrawObject((POBJECT_HEAD)&timer_con_serviceinfo, C_UPDATE_ALL); OSD_DrawObject((POBJECT_HEAD)&timer_con_wakeupdate, C_UPDATE_ALL); OSD_DrawObject((POBJECT_HEAD)&timer_con_wakeupweekday, C_UPDATE_ALL); OSD_DrawObject((POBJECT_HEAD)&timer_con_wakeuptime, C_UPDATE_ALL); OSD_DrawObject((POBJECT_HEAD)&timer_con_duration, C_UPDATE_ALL); OSD_DrawObject((POBJECT_HEAD)&timer_con_rec_type, C_UPDATE_ALL); } }
static PRESULT timerset_mselinfo_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT32 sel; VACTION unact; P_NODE p_node; UINT16* Uni_str; TIMER_SET_CONTENT* settimer; COM_POP_LIST_PARAM_T param; OSD_RECT rect; settimer = &timer_set; switch(event) { case EVN_PRE_CHANGE: sel = *((UINT32*)param1); break; case EVN_POST_CHANGE: sel = param1; break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_ENTER) // select channel { OSD_SetRect2(&rect,&pObj->frame); rect.uTop -= 80; rect.uLeft -= 40; rect.uWidth += 40; rect.uHeight = 300; param.selecttype = POP_LIST_SINGLESELECT; param.cur = TIMER_SERVICE_INFO; sel = win_com_open_sub_list(POP_LIST_TYPE_CHANLIST,&rect,¶m); if(sel < (UINT32)TIMER_SERVICE_INFO_CNT) { get_prog_at(sel,&p_node); settimer->wakeup_channel = p_node.prog_id; TIMER_SERVICE_INFO = sel; } OSD_TrackObject( (POBJECT_HEAD )&timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } break; case EVN_REQUEST_STRING: sel = param1; Uni_str= (UINT16*)param2; get_prog_at(sel,&p_node); if(p_node.ca_mode) ComAscStr2Uni("$", Uni_str); ComUniStrCopyChar((UINT8*)&Uni_str[p_node.ca_mode], p_node.service_name); if((TIMER_MODE == TIMER_MODE_OFF) || (TIMER_SERVICE_TYPE != TIMER_SERVICE_DVR_RECORD) || (p_node.ca_mode == 1)) { set_container_active(&timer_con_rec_type, C_ATTR_INACTIVE); settimer->wakeup_message = 0; } else if((TIMER_SERVICE_TYPE == TIMER_SERVICE_DVR_RECORD) && (!pvr_info.hdd_valid)) //guop add set_container_active(&timer_con_rec_type, C_ATTR_INACTIVE); else { set_container_active(&timer_con_rec_type, C_ATTR_ACTIVE); if(settimer->wakeup_message > 2) settimer->wakeup_message = 0; } OSD_SetMultiselSel(&timer_msel_rec_type, settimer->wakeup_message); OSD_DrawObject((POBJECT_HEAD)&timer_con_rec_type, C_UPDATE_ALL); break; } return ret; }
void win_progname_draw_infor(void) { UINT16 group_name[MAX_SERVICE_NAME_LENGTH + 1 + 10]; UINT8 group_type,av_mode; UINT16 cur_channel; P_NODE p_node; S_NODE s_node; // T_NODE t_node; char string[100]; char prog_name[MAX_SERVICE_NAME_LENGTH + 1]; INT32 ret,len; UINT32 i,j; BITMAP* bmp; TEXT_FIELD* txt; UINT16 icon; date_time dt; prog_txt_t* p_prog_txt; prog_bmp_t* p_prog_bmp; eit_event_info_t *pe=NULL,*fe=NULL; UINT8 *s1=NULL,*s2=NULL; INT32 strlen; struct ACTIVE_SERVICE_INFO service; struct t_ttx_lang *ttx_lang_list; UINT8 ttx_lang_num; struct t_subt_lang* sub_lang_list; UINT8 sub_lang_num; bmp = &prog_bmp; txt = &prog_text; UINT32 fav_mask; fav_mask = 0; for(i=0;i<MAX_FAVGROUP_NUM;i++) fav_mask |= (0x01<<i); av_mode = sys_data_get_cur_chan_mode(); cur_channel = sys_data_get_cur_group_cur_mode_channel(); ret = get_prog_at(cur_channel,&p_node); get_sat_by_id(p_node.sat_id, &s_node); get_cur_group_name((char*)group_name,&group_type); get_local_time(&dt); /* #ifdef _EPG_MULTI_SERVICE #ifdef EPG_FAST_PARSE epg_fast_pasrse_set(FALSE,NULL,NULL); #endif get_tp_by_id(p_node.tp_id, &t_node); api_epg_parse(p_node.tp_id, t_node.network_id, t_node.t_s_id, p_node.prog_number, epg_type_pf); struct active_service_t service; service.tp_id = p_node.tp_id; service.orig_network_id = t_node.network_id; service.ts_id = t_node.t_s_id; service.service_id = p_node.prog_number; api_epg_set_active_service(&service, 1); api_epg_parse(p_node.tp_id, t_node.network_id, t_node.t_s_id, p_node.prog_number, epg_type_pf); #endif */ service.tp_id = p_node.tp_id; service.service_id = p_node.prog_number; epg_set_active_service(&service, 1); /*current next epg info */ pe=epg_get_cur_service_event((INT32)cur_channel, PRESENT_EVENT, NULL,NULL,NULL, /*event_update*/TRUE); fe=epg_get_cur_service_event((INT32)cur_channel, FOLLOWING_EVENT, NULL,NULL,NULL, event_update); if(event_update==FALSE) { if(pe==NULL || fe==NULL) { event_update = TRUE; } } else { if(pe!=NULL && fe!=NULL) { event_update = FALSE; } } s1=epg_get_event_name(pe, &len); // s1=(UINT8*)epg_get_event_name(pe, present_name, 32); s2=epg_get_event_name(fe, &len); // s2=(UINT8*)epg_get_event_name(fe, following_name, 32); TTXEng_GetInitLang(&ttx_lang_list, &ttx_lang_num); subt_get_language(&sub_lang_list ,&sub_lang_num); if(sub_lang_num == 0) TTXEng_GetSubtLang(&ttx_lang_list,&sub_lang_num); for(i=0;i<PROG_BMP_NUM;i++) { p_prog_bmp = &prog_bmps[i]; icon = INVALID_ID; switch(p_prog_bmp->bmp_type) { case PROG_BMP_STATIC: icon = prog_bmps[i].icon; break; #ifndef MODIFY_FOR_EGYPT_CUSTOMER case PROG_BMP_AV_TYPE: if(av_mode==TV_CHAN) icon = IM_INFO_BAR_TV; else icon = IM_INFO_BAR_RADIO; break; #endif case PROG_BMP_EPG: if( (s1||s2) ) icon = prog_bmps[i].icon; break; case PROG_BMP_TTX: if(ttx_lang_num>0) icon = prog_bmps[i].icon; break; case PROG_BMP_SUBT: if(sub_lang_num>0) icon = prog_bmps[i].icon; break; case PROG_BMP_LOCK: if(p_node.lock_flag) icon = prog_bmps[i].icon; break; case PROG_BMP_FAV: if(p_node.fav_group[0] & fav_mask) icon = prog_bmps[i].icon; break; case PROG_BMP_CA: { #if 0 BOOL b,bFlag; INT8 level,quality,lock; signal_lock_status lock_flag; signal_scramble_status scramble_flag; signal_lnbshort_status lnbshort_flag; signal_parentlock_status parrentlock_flag; bFlag = GetSignalStatus(&lock_flag, &scramble_flag,&lnbshort_flag,&parrentlock_flag); if(bFlag && lock_flag== SIGNAL_STATUS_LOCK && lnbshort_flag==SIGNAL_STATUS_LNBNORMAL && parrentlock_flag==SIGNAL_STATUS_PARENT_UNLOCK && scramble_flag == SIGNAL_STATUS_SCRAMBLED) icon = prog_bmps[i].icon; #else if(p_node.ca_mode) icon = prog_bmps[i].icon; #endif } break; default: break; } OSD_SetBitmapContent(bmp, icon); OSD_SetRect(&bmp->head.frame, p_prog_bmp->left, p_prog_bmp->top, p_prog_bmp->width,p_prog_bmp->height); OSD_DrawObject( (OBJECT_HEAD*) bmp, C_UPDATE_ALL); } for(i=0;i<PROG_TXT_NUM;i++) { p_prog_txt = &prog_txts[i]; string[0] = '\0'; switch(p_prog_txt->txt_type) { case PROG_TXT_PROG_NAME: #ifndef DB_USE_UNICODE_STRING STRCPY(prog_name,p_node.service_name); for(j=0;j<STRLEN(prog_name);j++) if(prog_name[j] >= 0x80) { prog_name[j] = '\0'; break; } if(p_node.ca_mode==0) sprintf(string,"%s(%s)",prog_name,s_node.sat_name); else sprintf(string,"$%s(%s)",prog_name,s_node.sat_name); #else if(p_node.ca_mode==0) STRCPY(string,""); else STRCPY(string,"$"); ComAscStr2Uni(string,len_display_str); strlen = ComUniStrLen( len_display_str); //strcpy_uni(&len_display_str[strlen],p_node.service_name); ComUniStrCopyChar((UINT8 * )&len_display_str[strlen],p_node.service_name); strlen = ComUniStrLen( len_display_str); ComAscStr2Uni("(",&len_display_str[strlen]); strlen = ComUniStrLen( len_display_str); ComUniStrCopyChar((UINT8 * )&len_display_str[strlen],s_node.sat_name); strlen = ComUniStrLen( len_display_str); ComAscStr2Uni(")",&len_display_str[strlen]); #endif break; case PROG_TXT_DATE: sprintf(string,"%02d/%02d",dt.month,dt.day); ComAscStr2Uni(string, (UINT16 *)len_display_str); break; case PROG_TXT_TIME: sprintf(string,"%02d:%02d",dt.hour,dt.min); ComAscStr2Uni(string, (UINT16 *)len_display_str); break; case PROG_TXT_PROG_NUM: sprintf(string,"%04d",cur_channel + 1); ComAscStr2Uni(string, (UINT16 *)len_display_str); break; case PROG_TXT_EPG_NOW: if (s1 ) { sprintf(string,"Now: "); ComAscStr2Uni(string, (UINT16 *)len_display_str); len =ComUniStrLen(len_display_str); ComUniStrCopyChar((UINT8*)&len_display_str[len],s1); } else { OSD_SetTextFieldStrPoint(txt,NULL); OSD_SetTextFieldContent(txt,STRING_ID,RS_EPG_NO_INFORMATION); } break; case PROG_TXT_EPG_NEXT: if (s2) { sprintf(string,"Next: "); ComAscStr2Uni(string, (UINT16 *)len_display_str); len =ComUniStrLen(len_display_str); ComUniStrCopyChar((UINT8*)&len_display_str[len],s2); } else { sprintf(string," "); ComAscStr2Uni(string, (UINT16 *)len_display_str); } break; case PROG_TXT_PROG_GROUP: #ifndef DB_USE_UNICODE_STRING sprintf(string,"%s",group_name); #else ComUniStrCopy(len_display_str, group_name); #endif break; default: ; } #ifndef DB_USE_UNICODE_STRING ComAscStr2Uni(string, (UINT16 *)len_display_str); #else /* if(p_prog_txt->txt_type != PROG_TXT_PROG_NAME && p_prog_txt->txt_type != PROG_TXT_PROG_GROUP &&p_prog_txt->txt_type != PROG_TXT_EPG_NOW &&p_prog_txt->txt_type != PROG_TXT_EPG_NEXT) ComAscStr2Uni(string, (UINT16 *)len_display_str); */ if(p_prog_txt->txt_type == PROG_TXT_PROG_NUM) txt->head.bFont = 2; else txt->head.bFont = 0; #endif OSD_SetRect(&txt->head.frame, p_prog_txt->left, p_prog_txt->top, p_prog_txt->width,p_prog_txt->height); //txt->pText = (UINT8*)len_display_str; txt->head.style.bShowIdx = p_prog_txt->shidx; OSD_DrawObject( (OBJECT_HEAD *)txt, C_UPDATE_ALL); OSD_SetTextFieldContent(txt,STRING_ID,0); OSD_SetTextFieldStrPoint(txt,len_display_str); } #ifdef MODIFY_FOR_EGYPT_CUSTOMER progname_signal_refresh(TRUE); #endif }
static PRESULT timerset_mselinfo_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT32 sel; VACTION unact; P_NODE p_node; UINT16 *Uni_str; TIMER_SET_CONTENT *settimer; COM_POP_LIST_PARAM_T param; OSD_RECT rect; settimer = &timer_set; switch (event) { case EVN_PRE_CHANGE: sel = *((UINT32*)param1); break; case EVN_POST_CHANGE: sel = param1; break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1 >> 16); if (unact == VACT_ENTER) // select channel { OSD_SetRect2(&rect, &pObj->frame); rect.uLeft -= 40; rect.uWidth += 40; rect.uHeight = 180; param.selecttype = POP_LIST_SINGLESELECT; param.cur = TIMER_SERVICE_INFO; sel = win_com_open_sub_list(POP_LIST_TYPE_CHANLIST, &rect, ¶m); if (sel < (UINT32)TIMER_SERVICE_INFO_CNT) { get_prog_at(sel, &p_node); settimer->wakeup_channel = p_node.prog_id; //MEMCPY(settimer->event_name, (UINT8 *)&p_node.service_name[0], 40); TIMER_SERVICE_INFO = sel; } OSD_TrackObject((POBJECT_HEAD) &timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } break; case EVN_REQUEST_STRING: sel = param1; Uni_str = (UINT16*)param2; get_prog_at(sel, &p_node); if (p_node.ca_mode) ComAscStr2Uni("$", Uni_str); ComUniStrCopyChar((UINT8*) &Uni_str[p_node.ca_mode], p_node.service_name); MEMCPY(settimer->event_name, (UINT8 *)Uni_str, 40); break; } return ret; }
void change_channel(INT32 shift) { UINT16 cur_channel,max_channel; P_NODE p_node; UINT32 n; SYSTEM_DATA* sys_data; UINT16 cur_tp_id; UINT8 cur_ca_mode; UINT8 change_enable = TRUE; sys_data = sys_data_get(); #if 0//def PVR_DMX_DELAY_SUPPORT //guop edit 20110118 if (api_pvr_is_recording()) { UINT8 back_saved; win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H); win_compopup_set_msg("Please stop record, then change channel!",NULL,0); win_compopup_open_ext(&back_saved); return; } #endif //max_channel = get_node_num(TYPE_PROG_NODE, NULL); max_channel = get_prog_num(VIEW_ALL|sys_data->cur_chan_mode[sys_data->normal_group_idx], 0); if(max_channel==0) return ; cur_channel = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(cur_channel, &p_node); cur_tp_id = p_node.tp_id; cur_ca_mode = p_node.ca_mode; //libc_printf("cur_tp_id = %d, cur_channel= %d\n",cur_tp_id,cur_channel); if( !(show_and_playchannel && shift==0) ) { n = 0; do{ cur_channel = (cur_channel + shift + max_channel) % max_channel; get_prog_at(cur_channel, &p_node); if(shift==0) shift = 1; n++; }while( (p_node.skip_flag || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode) || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode)) && n!=max_channel); if(p_node.skip_flag || (sys_data->chan_sw==CHAN_SWITCH_FREE && p_node.ca_mode) || (sys_data->chan_sw==CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode)) return ; } #if ((!defined(NEW_DEMO_FRAME)) || \ (defined(NEW_DEMO_FRAME) && defined(CC_USE_TSG_PLAYER))) #ifdef DVR_PVR_SUPPORT if (api_pvr_is_recording()) { if (p_node.tp_id == cur_tp_id) { change_enable = TRUE; if (cur_ca_mode && (sys_data_get_scramble_record_mode() == 1) && api_pvr_is_record_active() && api_pvr_is_recording_cur_prog()) { change_enable = FALSE; } } else { change_enable = FALSE; } } if (!change_enable) { UINT8 back_saved; win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W+100, MSG_POPUP_LAYER_H); win_compopup_set_msg("Please stop record, then change channel!",NULL,0); win_compopup_open_ext(&back_saved); } #endif #endif if(change_enable) { /* If first time show the osd and play channel, to avoid display incorrect channel when meet skip channel. */ if(show_and_playchannel) { sys_data_set_cur_group_channel(cur_channel); win_progname_redraw(); } for(n=0;n<MAX_TIMER_NUM;n++) {//bug30192.when timer play,if change channel,cancel timer duration. if((sys_data->timer_set.TimerContent[n].wakeup_state == TIMER_STATE_RUNING) && (sys_data->timer_set.TimerContent[n].wakeup_duration_time > 0) && (sys_data->timer_set.TimerContent[n].timer_service == TIMER_SERVICE_CHANNEL)) sys_data->timer_set.TimerContent[n].wakeup_duration_time = 0; } api_play_channel(cur_channel, TRUE, TRUE,FALSE); #ifdef MULTIFEED_SUPPORT if(multifeed_have_feed(p_node.prog_id)) { UINT32 hk; ap_vk_to_hk(0, V_KEY_RED, &hk); ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hk, TRUE); } #endif } }
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT8 bID,back_saved; S_NODE s_node; P_NODE p_node; T_NODE t_node; bID = OSD_GetObjID(pObj); INT16 i=0; INT16 n =0; UINT16 prog_num =0; UINT8 av_flag = 0; 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_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(); break; case IDC_CON2: 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(); break; case IDC_CON3: 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); sort_prog_node(PROG_FTA_SORT); av_flag = sys_data_get_cur_chan_mode(); prog_num = get_prog_num(VIEW_ALL | av_flag, 0); libc_printf("prog_num11111111==%d\n",prog_num); for(i=prog_num-1;i>=0;i--) { get_prog_at(i,&p_node); get_tp_by_id(p_node.tp_id, &t_node); get_sat_by_id(t_node.sat_id, &s_node); if(p_node.ca_mode == 0) { libc_printf("iiiiiiiiiiiiiiiiii====%d\n",i); del_prog_at((UINT16)i); } } update_data(); sys_data_check_channel_groups(); win_compopup_smsg_restoreback(); break; case IDC_CON4: 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); sort_prog_node(PROG_FTA_SORT_EXT); av_flag = sys_data_get_cur_chan_mode(); prog_num = get_prog_num(VIEW_ALL | av_flag, 0); libc_printf("prog_num222222222==%d\n",prog_num); for(i=prog_num-1;i>=0;i--) { get_prog_at(i,&p_node); get_tp_by_id(p_node.tp_id, &t_node); get_sat_by_id(t_node.sat_id, &s_node); if(p_node.ca_mode) { libc_printf("i===============%d\n",i); del_prog_at((UINT16)i); } } update_data(); sys_data_check_channel_groups(); win_compopup_smsg_restoreback(); break; default: break; } } break; } return ret; }
BOOL GetSignalStatus( signal_lock_status* lock_flag, signal_scramble_status* scramble_flag, signal_lnbshort_status* lnbshort_flag, signal_parentlock_status* parrentlock_flag) { UINT8 lock; struct dmx_device * dmx_dev; signal_lnbshort_status lnbshort; SYSTEM_DATA* sys_data; sys_data = sys_data_get(); UINT8 scrabled,scrable_typ; P_NODE p_node; UINT16 cur_channel; struct VDec_StatusInfo curStatus; static UINT16 prechan; static UINT32 descDetTime = 0; struct nim_device* nim_dev; #ifdef NEW_DEMO_FRAME static UINT32 unlock_times; INT32 ts_route_id; struct ts_route_info ts_route; struct nim_config nim_config; #endif if(cur_tuner_idx == 0) nim_dev = g_nim_dev; else nim_dev = g_nim_dev2; #ifdef NEW_DEMO_FRAME MEMSET(&ts_route, 0, sizeof(struct ts_route_info)); if(ts_route_get_by_type(TS_ROUTE_MAIN_PLAY, &ts_route_id, &ts_route) != RET_FAILURE) { nim_dev = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, ts_route.nim_id); } else { nim_dev = (cur_tuner_idx == 0) ? g_nim_dev : g_nim_dev2; } #endif lnbshort = SIGNAL_STATUS_LNBNORMAL; #if(SYS_LNB_SHORT_DET == SYS_FUNC_ON) /* if(sys_data->bLNB_power == LNB_POWER_ON) { if(LNB_state() == 1)//short { lnbshort = SIGNAL_STATUS_LNBSHORT; } } */ lnbshort = lnb_power_short; #elif(SYS_12V_SHORT_DET == SYS_FUNC_ON) lnbshort = v12_power_short; #endif if(lnbshort_flag != NULL) *lnbshort_flag = lnbshort; SetSignalLNBShortStatus(lnbshort); // if(*lnbshort_flag == SIGNAL_STATUS_LNBSHORT) // return TRUE; #ifdef NEW_DEMO_FRAME dmx_dev = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, ts_route.dmx_id); #else dmx_dev = g_dmx_dev; #endif #ifdef DVR_PVR_SUPPORT if(singal_play_chan_nim_busy) lock = SIGNAL_STATUS_UNLOCK; else #endif nim_get_lock(nim_dev,&lock); #if 0//def NEW_DEMO_FRAME //reset diseqc, but it may hold this process, if attached to UI flow maybe cause bug! if(!lock) unlock_times++; else unlock_times = 0; if((unlock_times > 10)&& sys_data->bLNB_power) { dev_get_nim_config(nim_dev, FRONTEND_TYPE_S, &nim_config); frontend_set_antenna(nim_dev, &nim_config.antenna, &nim_config.xpond, 1); if(frontend_lnb_22k_ctl(&nim_config.antenna) || (nim_dev == g_nim_dev2)) frontend_set_nim(nim_dev, &nim_config.antenna,&nim_config.xpond,1); nim_get_lock(nim_dev,&lock); unlock_times = 0; } #endif if (parrentlock_flag == NULL) lv_lock_status = lock? SIGNAL_STATUS_LOCK : SIGNAL_STATUS_UNLOCK; else SetSignalLockStatus( lock? SIGNAL_STATUS_LOCK : SIGNAL_STATUS_UNLOCK); cur_channel = sys_data_get_cur_group_cur_mode_channel(); get_prog_at(cur_channel,&p_node); #if 0 scrabled = 0; if(dmx_io_control(dmx_dev,IS_AV_SCRAMBLED,(UINT32)(&scrable_typ)) == RET_SUCCESS ) { if(scrable_typ & (VDE_TS_SCRBL|VDE_PES_SCRBL)) scrabled = 1; else { scrabled = 0; } } #else scrabled = key_get_dmx0_scramble(NULL); #endif #ifdef CI_SUPPORT2 if ((parrentlock_flag == NULL) && (p_node.ca_mode) && (!scrabled) && lock && (screen_back_state == SCREEN_BACK_VIDEO) && (VIEW_MODE_FULL == hde_get_mode()) #ifdef DVR_PVR_SUPPORT && !freeze_for_pvr //black screen result in pvr state trans! && api_pvr_is_live_playing() #endif ) { vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus); UINT32 freeze_flag = curStatus.display_idx; if((curStatus.uFirstPicShowed) && (curStatus.uCurStatus == VDEC_DECODING)) //for scramble prog and freeze screen (show black screen and scramble osd) { osal_task_sleep(100); //vdec_io_control(g_decv_dev, VDEC_IO_GET_STATUS, (UINT32)&curStatus); vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus); if(freeze_flag == curStatus.display_idx) { osal_task_sleep(100); //vdec_io_control(g_decv_dev, VDEC_IO_GET_STATUS, (UINT32)&curStatus); vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus); if(freeze_flag == curStatus.display_idx) // freeze screen state! { scrabled = 1; #ifdef DVR_PVR_SUPPORT //add to simulate monitor's function for video hold state because monitor is off under DVR project! if((!last_ca_pmt_cmd_time) || (last_ca_pmt_cmd_time && (osal_get_tick() > last_ca_pmt_cmd_time + 6000))) { if(ca_pmt_cmd_cnt >= 2) { UIChChgPlayProg(0,CC_CMD_RESET_CRNT_CH); ca_pmt_cmd_cnt = 0; } else { //cc_send_ca_pmt(); cc_send_ca_pmt(p_node.prog_id); ca_pmt_cmd_cnt++; } last_ca_pmt_cmd_time = osal_get_tick(); } #endif } else { ca_pmt_cmd_cnt = 0; } } else { ca_pmt_cmd_cnt = 0; } } else if(!curStatus.uFirstPicShowed) //for scramble prog and black screen { scrabled = 1; ca_pmt_cmd_cnt = 0; } } #endif #ifdef CTI_CA { UINT32 freeze_flag = curStatus.display_idx; vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus); freeze_flag = curStatus.display_idx; if((curStatus.uFirstPicShowed) && (curStatus.uCurStatus == VDEC_DECODING)) //for scramble prog and freeze screen (show black screen and scramble osd) { osal_task_sleep(100); vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus); if(freeze_flag == curStatus.display_idx) { osal_task_sleep(100); vdec_io_control(get_selected_decoder(), VDEC_IO_GET_STATUS, (UINT32)&curStatus); if(freeze_flag == curStatus.display_idx) // freeze screen state! { scrabled = 1; } } } else if(!curStatus.uFirstPicShowed) //for scramble prog and black screen { scrabled = 1; } /*qjzheng 2010.5.7 BUG2003 不能播放加锁节目时, 有时提示是CA错误*/ if( !lv_lock_status ) { scrabled = 0; } } #endif if (parrentlock_flag) { if (scrabled) { if (lv_scramble_fake) scrabled = 0; } SetSignalScrambleStatus(scrabled? SIGNAL_STATUS_SCRAMBLED : SIGNAL_STATUS_UNSCRAMBLED); } else { lv_scramble_status = scrabled? SIGNAL_STATUS_SCRAMBLED : SIGNAL_STATUS_UNSCRAMBLED; } /*Never in In multi-view mode*/ if(lock && !scrabled && hde_get_mode()!=VIEW_MODE_MULTI) { if(p_node.ca_mode && sys_data_get_cur_chan_mode() == TV_CHAN) { if(!curStatus.uFirstPicShowed && curStatus.uCurStatus!=VDEC_PAUSED) { descDetTime ++; if(descDetTime == 1) prechan = cur_channel; if(descDetTime >=3 && prechan == cur_channel) scrabled = 1; else descDetTime = 0; } else descDetTime = 0; } } if(lock_flag != NULL) *lock_flag = lv_lock_status; if(scramble_flag != NULL) *scramble_flag = lv_scramble_status; if(parrentlock_flag != NULL) *parrentlock_flag = lv_parrentlock_status; if(lv_lock_status == SIGNAL_STATUS_LOCK && lv_scramble_status == SIGNAL_STATUS_UNSCRAMBLED && lv_lnbshort_status == SIGNAL_STATUS_LNBNORMAL && lv_parrentlock_status == SIGNAL_STATUS_PARENT_UNLOCK) return FALSE; else { return TRUE; } }
/* return value: -1 : wakeup_year <= 2000 || wakeup_year>2100 -2 : wakeup_month<0 || wakeup_month>12 -3 : wakeup_day not valied in the wakeup_year & wakeup_month -4 : on time hour > 23 -5 : on timer minute > 59 -6 : duration minute > 59 -7 : add timer the wakeup date & time < current time -8: add timer conflict with other timers */ INT32 win_timerset_check_and_save(void) { EDIT_FIELD *edf; UINT16 ch_idx,ch_cnt; P_NODE p_node; date_time dt,wkdt; UINT32 val,duration; INT32 ret; TIMER_SET_CONTENT* timer; timer = &timer_set; timer->timer_mode = TIMER_MODE; timer->timer_service = TIMER_SERVICE_TYPE; if(timer->timer_service == TIMER_SERVICE_MESSAGE) timer->wakeup_message = TIMER_SERVICE_INFO; else { get_prog_at(TIMER_SERVICE_INFO,&p_node); timer->wakeup_channel = p_node.prog_id; #ifdef DVR_PVR_SUPPORT if(timer->timer_service == TIMER_SERVICE_DVR_RECORD) { timer->wakeup_message = TIMER_REC_TYPE; } #endif } edf = &timer_edf_wakeupdate; OSD_GetEditFieldIntValue(edf,&val); wkdt.year = val / 10000; val -= wkdt.year*10000; wkdt.month = val / 100; val -= wkdt.month*100; wkdt.day = val; wkdt.weekday = OSD_GetMultiselSel(&timer_msel_wakeupweekday); edf = &timer_edf_wakeuptime; OSD_GetEditFieldIntValue(edf,&val); wkdt.hour = val/100; val -= wkdt.hour*100; wkdt.min = val; wkdt.sec = 0; ret = api_check_valid_date(wkdt.year,wkdt.month,wkdt.day); if(ret != 0) return ret; if(wkdt.hour > 23) return -4; if(wkdt.min>59) return -5; if(timer_set_check_starttime_flag) { if(timer->timer_mode != TIMER_MODE_OFF) { get_local_time(&dt); if(api_compare_day_time(&wkdt,&dt) < 0) return -7; } } else { if(timer->timer_mode != TIMER_MODE_OFF) { /* if(timer->wakeup_state == TIMER_STATE_RUNING) { } */ } } if(timer->timer_mode != TIMER_MODE_OFF) { timer->wakeup_year = wkdt.year; timer->wakeup_month= wkdt.month; timer->wakeup_day = wkdt.day; timer->wakeup_time = wkdt.hour*60 + wkdt.min; } edf = &timer_edf_duration; OSD_GetEditFieldIntValue(edf,&val); duration = val/100*60 + val%100; if(timer->timer_service == TIMER_SERVICE_MESSAGE) timer->wakeup_duration_time = 0; else { if(val % 100>59) return -6; timer->wakeup_duration_time = duration; } ret = IsValidTimer(timer); if(ret==0) return -8; return 0; }
static void win_search_program_append(UINT32 tp_idx, UINT16 prog_idx) { UINT32 si,i,j,n,cnt,str_len; UINT16* pstr; OSD_RECT rect; UINT8 shidx; char str[30]; DBG_PRINTF("Enter %s....\n",__FUNCTION__); if(prog_idx != INVALID_ID) { P_NODE p_node; get_prog_at(prog_idx, &p_node); MEMCPY(&win_search_cur_prog[p_node.av_flag], &p_node, sizeof(p_node)); srch_ch_cnt[p_node.av_flag] ++; cnt = srch_ch_cnt[p_node.av_flag]; if(cnt <= INFOR_CHAN_CNT) { si = 0; n = cnt; } else { si = cnt - INFOR_CHAN_CNT; n = INFOR_CHAN_CNT; } if(si != 0) { for(i=0;i<n - 1;i++) MEMCPY(display_strs[10 + p_node.av_flag*10 + i], display_strs[10 + p_node.av_flag*10 + i + 1], MAX_DISP_STR_LEN*2); } pstr = display_strs[10 + p_node.av_flag*10 + n - 1]; if(p_node.ca_mode) ComAscStr2Uni("$", pstr); else ComAscStr2Uni("", pstr); str_len = ComUniStrLen(pstr); ComUniStrCopyChar((UINT8*)&pstr[str_len] ,p_node.service_name); if(p_node.av_flag == PROG_TV_MODE) { rect.uLeft = TVB_L + 20;//INFO_TV_L; rect.uTop = TVB_T + INFO_TXT_H;//INFO_TV_T+4; rect.uWidth = INFO_TV_W; rect.uHeight= INFO_TXT_H; shidx = TV_TXT_SH_IDX; } else { rect.uLeft = RADIOB_L + 20;//INFO_RADIO_L; rect.uTop = RADIOB_T + INFO_TXT_H;//INFO_RADIO_T+4; rect.uWidth = INFO_TV_W;//INFO_RADIO_W; rect.uHeight= INFO_TXT_H; shidx = RADIO_TXT_SH_IDX; } for(i=0;i<n;i++) { pstr = display_strs[10 + p_node.av_flag*10 + i]; //win_srch_draw_info(&rect, NULL,pstr, shidx); win_srch_draw_info_ex(&rect, NULL,pstr, INFOMATION_TXT_IDX); rect.uTop += rect.uHeight; } rect.uTop = TVB_T+3; rect.uLeft += (rect.uWidth-80); rect.uWidth = 80; rect.uHeight = TXT_H; sprintf(str,"%d",cnt); win_srch_draw_info(&rect, str,NULL, shidx); tp_chsrched = 1; } if(tp_idx != 0xFFFFFFFF) { T_NODE t_node; S_NODE s_node; get_tp_by_id(tp_idx, &t_node); //get_sat_at(cur_sat_pos, VIEW_ALL,&s_node); get_sat_by_id(cur_sat_id, &s_node); srch_tp_cnt ++; cnt = srch_tp_cnt; if(cnt <= INFOR_TP_CNT) { si = 0; n = cnt; } else { si = cnt - INFOR_TP_CNT; n = INFOR_TP_CNT; } if(si != 0) { for(i=0;i<n - 1;i++) { MEMCPY(display_strs[ 30 + i], display_strs[30 + i + 1], MAX_DISP_STR_LEN*2); } } if(n>1) { pstr = display_strs[ 30 + n - 2]; #if 0 str_len = ComUniStrLen(pstr); #else str_len = tp_info_chw_tbl[0] + tp_info_chw_tbl[1] + tp_info_chw_tbl[2] + tp_info_chw_tbl[3] + tp_info_chw_tbl[4]; #endif if(tp_chsrched) ComAscStr2Uni("OK", &pstr[str_len]); else ComAscStr2Uni("Failed", &pstr[str_len]); } pstr = display_strs[30 + n - 1]; sprintf(str,"%d",srch_tp_cnt); ComAscStr2Uni(str,&pstr[0]); #if 0 str_len = ComUniStrLen(pstr); str_len = tp_info_chw_tbl[0]; ComUniStrCopyChar(&pstr[str_len], s_node.sat_name); str_len = ComUniStrLen(pstr); sprintf(str," %d %c %d ... ",t_node.frq,(t_node.pol == 0)? 'H' : 'V',t_node.sym); ComAscStr2Uni(str,&pstr[str_len]); #else str_len = tp_info_chw_tbl[0]; ComUniStrCopyChar((UINT8*)&pstr[str_len], s_node.sat_name); str_len += tp_info_chw_tbl[1]; sprintf(str,"%d",t_node.frq); ComAscStr2Uni(str,&pstr[str_len]); str_len += tp_info_chw_tbl[2]; sprintf(str,"%c",(t_node.pol == 0)? 'H' : 'V'); ComAscStr2Uni(str,&pstr[str_len]); str_len += tp_info_chw_tbl[3]; sprintf(str,"%d",t_node.sym); ComAscStr2Uni(str,&pstr[str_len]); str_len += tp_info_chw_tbl[4]; STRCPY(str,""); ComAscStr2Uni(str,&pstr[str_len]); #endif tp_chsrched = 0; rect.uLeft = INFO_TP_L; rect.uTop = INFO_TP_T; rect.uWidth = INFO_TP_W; rect.uHeight= INFO_TXT_H; shidx = TP_TXT_SH_IDX; for(i=0;i<n;i++) { pstr = display_strs[30 + i]; #if 0 win_srch_draw_info(&rect, NULL,pstr, shidx); #else rect.uLeft = INFO_TP_L; str_len = 0; pstr = display_strs[30 + i]; for(j=0;j<7;j++) { rect.uWidth = tp_info_w_tbl[j] - 2; if(j != 5) win_srch_draw_info(&rect, NULL,pstr, shidx); else win_srch_draw_info(&rect, "...",NULL, shidx); rect.uLeft += tp_info_w_tbl[j] ; if(j < 5) { pstr += tp_info_chw_tbl[j]; //pstr += str_len; } } #endif rect.uTop += rect.uHeight; } } DBG_PRINTF("Exit %s....\n",__FUNCTION__); }
INT32 si_sdtt_parser(UINT8 *section, INT32 length, struct section_parameter *param) { INT32 i,j; // sec_offset; UINT16 current_ver; //UINT16 program_number; struct sdtt_section*info; struct sdtt_content *content; //struct program_map *maps; struct sdtt_section_info *s_info = (struct sdtt_section_info *)param->priv; //?? if (section==NULL) { // s_info->map_counter = 0; return SI_SUCCESS; } //get current version current_ver=SYS_SW_VERSION; info = (struct sdtt_section *)section; content = (struct sdtt_content *)(section+sizeof(struct sdtt_section)); for(i=0;i<info->numer_of_content;i++) { UINT16 cont_desc_len,sche_desc_len,trg_ver,new_ver,sch_time_N; UINT32 down_desc_total_len,down_desc_pase_size; struct sch_time *sched_time; struct SDTT_DL_CONT_DESC_1 *down_desc; cont_desc_len = content->content_ds_len_lo|(((UINT16)content->content_ds_len_hi)<<4); sche_desc_len = content->schedule_ds_len_lo|(((UINT16)content->schedule_ds_len_hi)<<4); sch_time_N = (sche_desc_len/sizeof(struct sch_time)); down_desc_total_len = cont_desc_len - sche_desc_len; sched_time = (struct sch_time *)(((UINT8 *)content)+sizeof(struct sdtt_content)); down_desc = (struct SDTT_DL_CONT_DESC_1 *)(((UINT8 *)sched_time)+sche_desc_len); for(down_desc_pase_size=0;down_desc_pase_size<down_desc_total_len;) { UINT16 desc_len; UINT8 *desc_point; if(down_desc->compab_flag!=1) goto NEXT_CONT; //I can't check the model inf, skip it... desc_point = (((UINT8 *)down_desc) + sizeof(struct SDTT_DL_CONT_DESC_1)); desc_len = si_sdtt_parser_compab_desc((struct SDTT_COMPAB_DESC_1 *)desc_point); if(desc_len==0) //Error parsering Compatibility Desc table goto NEXT_CONT; down_desc_pase_size += (sizeof(struct SDTT_DL_CONT_DESC_1) + desc_len); desc_point += desc_len; if(down_desc->mod_inf_flag==1) { desc_len = st_sdtt_parser_module_desc(desc_point); down_desc_pase_size += desc_len; desc_point += desc_len; } //Private data desc_len = (*desc_point); desc_point += (desc_len+1); down_desc_pase_size += (desc_len+1); //text info if(down_desc->txt_inf_flag==1) { desc_point += 3; //3 Bytes, ISO_639_Lang_code desc_len = (*desc_point); desc_point += (desc_len+1); down_desc_pase_size += (desc_len+1+3); } down_desc = (struct SDTT_DL_CONT_DESC_1 *)desc_point; //Point to next download cont desc... } //check version trg_ver = SDTT_MERG_UINT16(content->target_ver_hi,content->target_ver_lo); new_ver = SDTT_MERG_UINT16(content->new_ver_hi,content->new_ver_lo); switch(content->ver_indicator) { case SDTT_VER_INDICAT_ALL: //Do Nothing... break; case SDTT_VER_INDICAT_LATER: if(trg_ver<current_ver) goto NEXT_CONT; break; case SDTT_VER_INDICAT_EARLIER: if(current_ver<trg_ver) goto NEXT_CONT; break; case SDTT_VER_INDICAT_ONLY: if(trg_ver!=current_ver) goto NEXT_CONT; break; } { //Set Timer date_time dtSet,dtGet; UINT32 mjd_time,set_dur_time,get_dur_time = 0,fForce; UINT8 temp; P_NODE p_node; T_NODE t_node; fForce = content->download_level; if(sch_time_N>0) { for(j=0;j<sch_time_N;j++) { #define BCD2DEC(a) ((a>>4)*10+(a&0x0F)) mjd_time =( (((UINT32)sched_time[j].sch_time_start[0])<<8) | (((UINT32)sched_time[j].sch_time_start[1])) ); dtSet.hour = BCD2DEC(sched_time[j].sch_time_start[2]); dtSet.min = BCD2DEC(sched_time[j].sch_time_start[3]); dtSet.sec = BCD2DEC(sched_time[j].sch_time_start[4]); set_dur_time =( (((UINT32)sched_time[j].sch_time_duration[0])<<16) | (((UINT32)sched_time[j].sch_time_duration[1])<<8) | (((UINT32)sched_time[j].sch_time_duration[2])) ); mjd_to_ymd(mjd_time,&dtSet.year,&dtSet.month,&dtSet.day,&temp); api_ota_check_timerinfo(&dtSet,&set_dur_time,&fForce); dtGet = dtSet; get_dur_time = set_dur_time; } } else { //Update Now... get_local_time(&dtSet); convert_time_by_offset2(&dtGet,&dtSet,0,0,3); //Set time as 3 second later... get_dur_time = 1; } if (get_prog_at(m_SdttChanIndex, &p_node) != SUCCESS) return SI_SUCCESS; get_tp_by_id(p_node.tp_id, &t_node); sys_data_set_ota_band(t_node.bandwidth*1000); sys_data_set_ota_freq(t_node.frq); api_ota_timer_open(dtGet,get_dur_time,fForce); } NEXT_CONT: content = (struct sdtt_content *)((UINT8 *)content + sizeof(struct sdtt_content) + cont_desc_len); } #if 0 info->numer_of_content=*(section+sizeof(struct section_header)+6); //get number of content sec_offset=sizeof(struct section_header)+7; //move to start of content for(i=0; i<info->numer_of_content; i++) { content=(struct sdtt_content *)(section+sec_offset); //if (SI_MERGE_UINT16(content->group) ==0x1234) //match group? { //-->It should be fixed!! if (( (current_ver <=(SI_MERGE_UINT16(content->target_ver_hi))) && (content->ver_indicator)==2) || ((current_ver >=(SI_MERGE_UINT16(content->target_ver_hi))) && (content->ver_indicator)==1) || ((current_ver ==(SI_MERGE_UINT16(content->target_ver_hi))) && (content->ver_indicator)==3) || ((content->ver_indicator)==0) ) { // match download // start to get schedule information } } sec_offset+=(4+SI_MERGE_UINT16(content->schedule_ds_len_hi)); } #endif return SI_SUCCESS; }
static void newcamd_draw_progname(BOOL update) { UINT8 av_mode,j; UINT16 cur_channel,strlen; P_NODE p_node; UINT32 ret; char prog_name[50]; char string[100]; UINT16 uni_string[100]; av_mode = sys_data_get_cur_chan_mode(); if( sys_data_get_group_num() == 0 ) { sys_data_set_cur_chan_mode(av_mode==TV_CHAN? RADIO_CHAN : TV_CHAN); if( sys_data_get_group_num() == 0 ) { sys_data_set_cur_chan_mode(av_mode); ComUniStrCopyChar((UINT8 *)uni_string, OSD_GetUnicodeString(RS_MSG_NO_CHANNELS)); goto set_progname; } } cur_channel = sys_data_get_cur_group_cur_mode_channel(); ret = get_prog_at(cur_channel,&p_node); #ifndef DB_USE_UNICODE_STRING MEMSET(prog_name,0,sizeof(prog_name)); STRCPY(prog_name,p_node.service_name); for(j=0;j<STRLEN(prog_name);j++) { if(prog_name[j] >= 0x80) { prog_name[j] = '\0'; break; } } if(p_node.ca_mode==0) sprintf(string,"%d.%s",cur_channel+1,prog_name); else sprintf(string,"$%d.%s",cur_channel+1,prog_name); ComAscStr2Uni(string, (UINT16 *)uni_string) #else if(p_node.ca_mode==0) sprintf(string,"%d.",cur_channel+1); else sprintf(string,"$%d.",cur_channel+1); ComAscStr2Uni(string,uni_string); strlen = ComUniStrLen( uni_string); ComUniStrCopyChar( (UINT8 *)&uni_string[strlen],p_node.service_name); strlen = ComUniStrLen( uni_string); #endif set_progname: OSD_SetTextFieldContent(&newcamd_txt_chn, STRING_UNICODE, (UINT32)uni_string); if(update) { OSD_DrawObject((POBJECT_HEAD)&newcamd_txt_chn,C_DRAW_SIGN_EVN_FLG |C_UPDATE_ALL); } }
/* * get one feed's detail information and fill to feed node * some info such as tp info, can't find in database, we have to retreive from nit */ static void fill_feed_detail_info(struct FEED_INFO *info, UINT32 sat_id, UINT32 prog_id) { INT32 ret = MULTIFEED_FAILURE, ret2 = MULTIFEED_FAILURE; T_NODE t_node; P_NODE p_node, p_node2; P_NODE *feed_pnode; DB_VIEW *last_view; UINT16 last_filter_mode, i; UINT32 last_view_param; get_prog_by_id(prog_id, &p_node); // first check db whether has the infomation ret = find_tp_in_db(sat_id, info->original_network_id, info->transport_stream_id, &t_node); if(ret != MULTIFEED_SUCCESS) { // if already got the nit, then search the buffer, and update to db ret = search_node( multifeed_table_buff, 1024, info->original_network_id, info->transport_stream_id, &t_node); if( ret!=MULTIFEED_SUCCESS ) { // not recieve nit data yet, so request nit data ret = find_tp_in_nit(info->original_network_id, info->transport_stream_id, &t_node); } if(ret == MULTIFEED_SUCCESS) { last_view = (DB_VIEW *)get_cur_view(); last_filter_mode = last_view->cur_filter_mode; last_view_param = last_view->view_param; if(last_view->cur_type==TYPE_PROG_NODE) { recreate_tp_view(VIEW_ALL ,0); ret = add_node(TYPE_TP_NODE, sat_id, (void*)&t_node); if(ret == SUCCESS) update_data(); recreate_prog_view(last_filter_mode, last_view_param); } else { ret = add_node(TYPE_TP_NODE, sat_id, (void*)&t_node); if(ret == SUCCESS) update_data(); } } } // maybe the subfeed is one of the channels, and that channel // maybe locked by parent, so we have to get this information if( p_node.prog_number != info->service_id ) { i = 0; while(SUCCESS == get_prog_at(i, &p_node2)) { if(( p_node2.tp_id == t_node.tp_id ) && ( p_node2.prog_number == info->service_id )) { mf_debug("feed: (%s, sid: %d) is Channel: %s\n", \ info->name, info->service_id, p_node2.service_name ); ret2 = MULTIFEED_SUCCESS; break; } i++; } } if(ret == SUCCESS) { info->is_known = 1; feed_pnode = &(info->p_node); MEMCPY(feed_pnode, &p_node, sizeof(P_NODE)); feed_pnode->tp_id = t_node.tp_id; feed_pnode->prog_number = info->service_id; if( ret2 != MULTIFEED_SUCCESS) { feed_pnode->pmt_pid = 0x1FFF; feed_pnode->audio_count = 1; feed_pnode->audio_pid[0]= feed_pnode->pcr_pid = feed_pnode->video_pid = 0x1FFF; } else { feed_pnode->av_flag = p_node2.av_flag; feed_pnode->ca_mode = p_node2.ca_mode; feed_pnode->video_pid = p_node2.video_pid; feed_pnode->pcr_pid = p_node2.pcr_pid; feed_pnode->h264_flag = p_node2.h264_flag; feed_pnode->pmt_pid = p_node2.pmt_pid; feed_pnode->pmt_version = p_node2.pmt_version; feed_pnode->service_type= p_node2.service_type; feed_pnode->audio_channel= p_node2.audio_channel; feed_pnode->audio_select= p_node2.audio_select; feed_pnode->lock_flag = p_node2.lock_flag;// parent lock feed_pnode->audio_count = p_node2.audio_count; MEMCPY( feed_pnode->audio_pid, p_node2.audio_pid, sizeof(UINT16)*MAX_AUDIO_CNT ); MEMCPY( feed_pnode->audio_lang, p_node2.audio_lang, sizeof(UINT16)*MAX_AUDIO_CNT ); } mf_debug("feed: tp_id: %d, frq: %d\n", feed_pnode->tp_id, t_node.frq ); } }
/************************************************************** *CAS Main message process entry. *msg_code has different meaning for different msg_type, check the *tf_catask.c for detailed info. **************************************************************/ PRESULT ap_cas_smc_info_proc( UINT32 msg_type, UINT32 msg_code) { cas_sc_t card_info; UINT16 cur_chan = 0; UINT8 scramble = 0; P_NODE p_node; POBJECT_HEAD p_top_menu = NULL,p_newtop_menu=NULL; PRESULT ret; p_top_menu = menu_stack_get_top(); if(p_top_menu == (POBJECT_HEAD)&g_win_cti_cardinfo || p_top_menu == (POBJECT_HEAD)&g_win_cti_set_maturity || p_top_menu == (POBJECT_HEAD)&g_win_cti_PPID || p_top_menu == (POBJECT_HEAD)&g_win_cti_PPID_info || p_top_menu == (POBJECT_HEAD)&g_win_cti_pin) { ret = OSD_ObjProc(p_top_menu, (MSG_TYPE_MSG << 16) | msg_type, msg_code, 0); while( ret == PROC_LEAVE) { menu_stack_pop(); p_newtop_menu = menu_stack_get_top(); if(NULL != p_newtop_menu) { ret = OSD_ObjOpen(p_newtop_menu, MENU_OPEN_TYPE_STACK) ; } } } cas_get_sc_info_req(&card_info); sys_data_get_cur_group_channel(&cur_chan, sys_data_get_cur_chan_mode()); get_prog_at(cur_chan, &p_node); //get_prog_scramble_type(p_node.prog_number, &scramble); if(card_info.sc_status==0) //smart card ok { //win_popup_msg("Smartcart is in!",NULL,0); } else if(card_info.sc_status==1) //smart card out { if(GetScrollStopFlag()!=SCROLL_STOP) { SetScrollStopFlag(SCROLL_STOP); } cas_sub_clear(); subtitle_clear_all_message(); //clean subtitle msg buffer when the card is out. ap_cas_fingerprint_proc(3);// to clear finger print buf and area if( p_top_menu == (POBJECT_HEAD)&g_win_ippv_popup) { OSD_ClearObject((POBJECT_HEAD)&g_win_ippv_popup, C_UPDATE_ALL); menu_stack_pop(); } //win_popup_msg("Smartcart is out!",NULL,0); } else if(card_info.sc_status==2||card_info.sc_status==3) { //win_popup_msg(NULL,NULL,RS_CTI_READ_SMC_ERROR); } }