/* 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 }
static void dm_disk_show_hint(UINT32 dev_type, UINT32 dev_id, UINT32 hint_type) { UINT8 i; UINT16 hint[128]={0}; char strUsb[128]; char strA[128]; char strCon[128]; char strUcon[128]; char strSd[128]; char strIde[128]; char strSata[128]; UINT8 back_saved; UINT16 *unistr=NULL; #ifdef SUPPORT_CAS9 if(get_mmi_showed()!=0)//mmi pri is high than this popup return; #endif #ifndef _SYSTEM_DVBC switch (dev_type) { case MNT_TYPE_USB: //sprintf(hint, "USB disk %c", dev_id+'A'); ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_USB_DISK),strUsb); ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_KEY_A),strA); sprintf(hint," %c ",dev_id); strcat(strUsb,hint); strcat(strUsb,strA); strcat(strUsb," "); STRCPY(hint,strUsb); break; case MNT_TYPE_SD: ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_SD_CARD),strSd); sprintf(hint, strSd); break; case MNT_TYPE_IDE: ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_IDE_DISK),strIde); sprintf(hint, strIde); break; case MNT_TYPE_SATA: ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_SATA_DISK),strSata); sprintf(hint, strSata); break; default: return; } switch (hint_type) { case DM_HINT_CONNECT: ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_CONNECTED),strCon); strcat(hint,strCon); break; case DM_HINT_DISCONNECT: ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_DISCONNECTED),strUcon); strcat(hint,strUcon); break; default: return; } DM_DEBUG("%s() show message: %s\n", __FUNCTION__, hint); win_compopup_init(WIN_POPUP_TYPE_SMSG); win_compopup_set_msg_ext(hint, NULL, 0); #else if(hint_type==DM_HINT_CONNECT) { if(dev_type==MNT_TYPE_USB) { unistr=OSD_GetUnicodeString(RS_USB_DISK_CONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } else if(dev_type==MNT_TYPE_SD) { unistr=OSD_GetUnicodeString(RS_SD_CARD_CONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } else if(dev_type==MNT_TYPE_IDE) { unistr=OSD_GetUnicodeString(RS_IDE_DISK_CONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } else if(dev_type==MNT_TYPE_SATA) { unistr=OSD_GetUnicodeString(RS_SATA_DISK_CONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } } else if(hint_type==DM_HINT_DISCONNECT) { if(dev_type==MNT_TYPE_USB) { unistr=OSD_GetUnicodeString(RS_USB_DISK_DISCONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } else if(dev_type==MNT_TYPE_SD) { unistr=OSD_GetUnicodeString(RS_SD_CARD_DISCONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } else if(dev_type==MNT_TYPE_IDE) { unistr=OSD_GetUnicodeString(RS_IDE_DISK_DISCONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } else if(dev_type==MNT_TYPE_SATA) { unistr=OSD_GetUnicodeString(RS_SATA_DISK_DISCONNECTED); ComUniStrCopyChar(&hint,(UINT16 *)unistr); } } DM_DEBUG("%s() show message: %s\n", __FUNCTION__, hint); win_compopup_init(WIN_POPUP_TYPE_SMSG); win_compopup_set_msg_ext(NULL,hint, 0); #endif #ifdef SUPPORT_CAS9 win_compopup_set_frame(290, 250, 448, 100); #endif win_compopup_open_ext(&back_saved); osal_task_sleep(1000); win_compopup_smsg_restoreback(); }
static PRESULT subtitle_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; SYSTEM_DATA * sys; struct nim_device* nim_dev; UINT8 i,lock; UINT8 unact; if(cur_tuner_idx == 0) nim_dev = g_nim_dev; else nim_dev = g_nim_dev2; nim_get_lock(nim_dev,&lock); switch(event) { case EVN_PRE_OPEN: #ifdef SUPPORT_CAS9 if(0==get_mmi_showed()) ShowSignalStatusOSDOnOff(0); #endif api_set_deo_layer(0); api_inc_wnd_count(); for(i=0;i<SUBTITLE_ITEM_NUMBER;i++) { p_subtitle_track_str[i]=Subtitle_track_str[i]; p_subtitle_track_idx[i]=Subtitle_track_idx[i]; } if(system_state != SYS_STATE_USB_MP)//vic100507#1 { win_subtitle_init_data(); if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) || (!lock)) #if (DVR_PVR_SUPPORT_SUBTITLE)//temp disable if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) #ifdef DVR_PVR_SUPPORT || ((!lock) && !api_pvr_is_playing()) #else || (!lock) #endif ) #endif { win_com_popup_open(WIN_POPUP_TYPE_SMSG,NULL, RS_DISPLAY_NO_DATA); osal_task_sleep(1000); win_compopup_close(); api_dec_wnd_count(); return PROC_LEAVE; } } else { #ifdef MP_SUBTITLE_SUPPORT //vic100507#1 //TODO: //such like win_subtitle_init_data long resut; resut = win_mp_subtitle_init_data(); if (resut < 0) { return PROC_LEAVE; } #endif } break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(system_state != SYS_STATE_USB_MP)//vic100507#1 { if(VACT_ENTER == unact) { UINT16 cur_sel = OSD_GetListCurPoint(&g_ls_subtitle); sys = sys_data_get(); if(g_win_subtitle_count + g_win_ttx_subtitle_count==cur_sel) { sys->osd_set.subtitle_display = 0;/*select off option*/ sys->osd_set.subtitle_lang = 0xFF; } else if(cur_sel < g_win_ttx_subtitle_count) { sys->osd_set.subtitle_display = 1;/*subtitle on*/ sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/ } else if(cur_sel < g_win_subtitle_count + g_win_ttx_subtitle_count) {/*ttx_subtitle on the top then normal subtitle*/ sys->osd_set.subtitle_display = 1; sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/ } ret = PROC_LEAVE; api_osd_mode_change(OSD_NO_SHOW); //api_osd_mode_change(OSD_SUBTITLE); } } else if(VACT_ENTER == unact) { //vic100507#1 begin #ifdef MP_SUBTITLE_SUPPORT //TODO: //select language index if (!subtitle_handle) { return PROC_LEAVE; } long resut; UINT16 cur_sel = OSD_GetListCurPoint(&g_ls_subtitle); if(g_ext_subtitle_plugin) g_ext_subtitle_plugin->mps_change_language(subtitle_handle,cur_sel); OSD_ObjClose(pObj,C_CLOSE_CLRBACK_FLG); //if (resut < 0) { return PROC_LEAVE; } #endif //vic100507#1 end } break; case EVN_PRE_CLOSE: unact = (VACTION)(param1>>16); ret = PROC_PASS; break; case EVN_POST_CLOSE: #ifdef SUPPORT_CAS9 restore_ca_msg_when_exit_win(); #endif api_set_deo_layer(1); api_dec_wnd_count(); break; default: break; } return ret; }
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, 0); if (max_channel == 0) { #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CONAX) if(get_mmi_msg_cnt()>0) { ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE); MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: change fav ch only one; code:%d\n",0); set_mmi_showed(10); } #endif #endif 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 ) ) { #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CONAX) if(get_mmi_msg_cnt()>0) { ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE); MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: change fav ch invalid; code:%d\n",0); set_mmi_showed(10); } #endif #endif return ; } #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CONAX) /*clean msg*/ /*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 /* 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(TRUE); } 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 }
static PRESULT win_progname_unkown_act_proc(VACTION act) { PRESULT ret = PROC_LOOP; INT32 shift; UINT8 av_mode, back_saved; UINT16 channel; UINT16 strID; #ifdef AD_SANZHOU P_NODE pnode; #endif api_stop_timer(&progname_timer); #ifdef MULTI_CAS #if(CAS_TYPE==CAS_IRDETO) if(getStopChannelChange()&&(act!=VACT_RECALL&&act!=VACT_SCHEDULE))//check whether stop channel change return ret; #endif #endif shift = - 1; switch (act) { case VACT_CH_UP: shift = 1; case VACT_CH_DOWN: change_channel(shift); #ifdef MIS_AD MIS_ShowEpgAdv(0); #endif break; case VACT_GRP_UP: shift = 1; case VACT_GRP_DOWN: change_group(shift); break; case VACT_FCH_UP: shift = 1; case VACT_FCH_DOWN: change_fav_channel(shift); break; case VACT_TV_RADIO_SW: av_mode = sys_data_get_cur_chan_mode(); av_mode = (av_mode == TV_CHAN) ? RADIO_CHAN : TV_CHAN; //sys_data_set_cur_intgroup_index(0); /*force to return all group*/ sys_data_get_group_channel(0, &channel, av_mode); if (channel == P_INVALID_ID) { /* If the opposite mode has no channel */ win_compopup_init(WIN_POPUP_TYPE_SMSG); if(av_mode == TV_CHAN) { win_compopup_set_msg(NULL, NULL, RS_MSG_NO_PROGRAM_TV); } else { win_compopup_set_msg(NULL, NULL, RS_MSG_NO_RADIO_CHANNEL); } win_compopup_open_ext(&back_saved); osal_task_sleep(1000); win_compopup_smsg_restoreback(); #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CONAX) if(get_mmi_msg_cnt()>0) { ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE); MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: tv/radio; code:%d\n",0); set_mmi_showed(10); } #endif #endif } else { sys_data_set_cur_chan_mode(av_mode); change_group(0); } break; case VACT_RECALL: channel = recall_play_channel(0); if (channel != P_INVALID_ID) { #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(channel, TRUE, TRUE, FALSE); #ifdef AD_SANZHOU if(get_prog_at(channel, &pnode) == SUCCESS) { szxc_ad_hide_txt(); szxc_ad_show_txt(pnode.prog_number); szxc_ad_hide_pic(AD_BANNER); szxc_ad_show_banner(pnode.prog_number,banner_pic_rt); } #endif } #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CONAX) else if(get_mmi_msg_cnt()>0) { ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE); MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: recall; code:%d\n",0); set_mmi_showed(10); } #endif #endif #ifdef MIS_AD MIS_ShowEpgAdv(0); #endif break; case VACT_SCHEDULE: api_stop_timer(&progname_timer); //close the mini_epg ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT, 1, TRUE); //open the schedule // ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)(POBJECT_HEAD)&g_win_schedule, TRUE); break; default: ; } #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CDCA) show_finger_print(0, 0); #elif(CAS_TYPE==CAS_DVT) ap_cas_fingerprint_proc(0, 1); #endif #endif win_progname_redraw(TRUE); progname_timer = api_start_timer(PROGNAME_TIMER_NAME, PROGNAME_TIMER_TIME, progname_timer_func); #ifdef MIS_AD Mis_Set_SameChan_AdvShowOnce(TRUE); Mis_Set_EnterAutoShow(FALSE); #endif return ret; }
static PRESULT win_progname_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT32 i; VACTION unact; static UINT16 recall_channel = P_INVALID_ID; SYSTEM_DATA *sys_data; ID taskID; UINT8 *screenBuf; UINT32 vKey; enum API_PLAY_TYPE ret_enum; P_NODE pnode; UINT16 channel = 0; sys_data = sys_data_get(); switch (event) { case EVN_PRE_OPEN: #if(CAS_TYPE == CAS_CONAX) if(get_mmi_showed()!=5) { #endif //Clear the subtitle or teletext content of the last program #if ((SUBTITLE_ON == 1 )||(TTX_ON ==1)) api_osd_mode_change(OSD_WINDOW); #endif #if(CAS_TYPE == CAS_CONAX) } #endif taskID = osal_task_get_current_id(); screenBuf = OSD_GetTaskVscrBuffer(taskID); MEMSET(screenBuf, OSD_TRANSPARENT_COLOR, OSD_VSRC_MEM_MAX_SIZE); #ifdef NVOD_FEATURE if(GetNvodPlayFlag()) return PROC_LEAVE; #endif PROGNAME_TIMER_TIME = sys_data->osd_set.time_out; if (PROGNAME_TIMER_TIME == 0 || PROGNAME_TIMER_TIME > 10) PROGNAME_TIMER_TIME = 5; PROGNAME_TIMER_TIME *= 1000; recall_channel = P_INVALID_ID; if ((param2 &MENU_OPEN_TYPE_MASK) == MENU_OPEN_TYPE_KEY) { vKey = param2 & MENU_OPEN_PARAM_MASK; if (vKey == V_KEY_RECALL) { recall_channel = recall_play_channel(0); if (recall_channel == P_INVALID_ID) return PROC_LEAVE; } #ifdef MULTI_CAS #if(CAS_TYPE==CAS_CONAX) else if( (param2 & MENU_OPEN_PARAM_MASK ) == V_KEY_INFOR) { if(get_mmi_msg_cnt()>0) { ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE); MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: info key; code:0"); set_mmi_showed(10); } } #endif #endif else { if(V_KEY_UP==vKey || V_KEY_DOWN==vKey || V_KEY_C_UP==vKey ||\ V_KEY_C_DOWN==vKey || V_KEY_P_UP==vKey || V_KEY_P_DOWN==vKey\ || V_KEY_TVRADIO==vKey) { unact = win_progname_keymap(pObj, vKey); if(VACT_PASS != unact) { win_progname_unkown_act_proc(unact); } } } } #ifdef MULTI_CAS #if(CAS_TYPE==CAS_IRDETO) if(IRCA_BAN_GetBannerShow()) { //ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS,0x00200000 , FALSE); ap_send_msg_expand(CTRL_MSG_SUBTYPE_STATUS_MCAS,0x00000020 ,0, FALSE); //ap_cas_call_back(0x00000020); } #endif #endif //ad_show(AD_CHANNEL_BAR); OSD_SetBitmapContent(&Bitmappr2, IM_PIC); break; case EVN_POST_OPEN: channel = sys_data_get_cur_group_cur_mode_channel(); if(get_prog_at(channel, &pnode) != SUCCESS) { return PROC_LEAVE; } /* if parent lock && no pwd, play it ,...just want to show pwd*/ /*if(pnode.lock_flag && GetChannelParrentLock()) { api_play_channel(channel,TRUE,TRUE,FALSE); } */ if (show_and_playchannel) { show_and_playchannel = 0; ret_enum = api_play_channel(channel,TRUE,TRUE,FALSE); #ifdef MIS_AD MIS_ShowEpgAdv(0); #endif } if (recall_channel != P_INVALID_ID) { ret_enum = api_play_channel(recall_channel, TRUE, TRUE, FALSE); OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } #ifdef AD_SANZHOU if((recall_channel == P_INVALID_ID)||(get_prog_at(recall_channel, &pnode) == SUCCESS)) { szxc_ad_hide_txt(); szxc_ad_show_txt(pnode.prog_number); szxc_ad_hide_pic(AD_BANNER); szxc_ad_show_banner(pnode.prog_number,banner_pic_rt); } #endif progname_timer = api_start_timer(PROGNAME_TIMER_NAME, PROGNAME_TIMER_TIME, progname_timer_func); ShowMuteOnOff(); ShowPauseOnOff(); #ifdef MIS_AD Mis_Set_SameChan_AdvShowOnce(TRUE); Mis_Set_EnterAutoShow(FALSE); #endif break; case EVN_PRE_CLOSE: //ad_stop(AD_CHANNEL_BAR); #ifdef MIS_AD MIS_HideEpgAdv(); #endif break; case EVN_POST_CLOSE: api_stop_timer(&progname_timer); win_progname_stop_scroll(); #if ((SUBTITLE_ON==1)||(TTX_ON==1)) api_osd_mode_change(OSD_SUBTITLE); #endif #ifdef AD_SANZHOU szxc_ad_hide_pic(AD_BANNER); #endif break; case EVN_PRE_DRAW: if(0 != win_progname_set_info()) ret = PROC_LEAVE; break; case EVN_POST_DRAW: break; case EVN_UNKNOWNKEY_GOT: ap_hk_to_vk(0, param1, &vKey); if(check_exit_key_validate(vKey)) { ap_send_msg(CTRL_MSG_SUBTYPE_KEY, param1, FALSE); ret = PROC_LEAVE; } break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1 >> 16); ret = win_progname_unkown_act_proc(unact); break; case EVN_MSG_GOT: ret = win_progname_message_proc(param1, param2); break; default: break; } return ret; }