static void dm_pvr_timer_handler() { DM_DEBUG("waiting PVR default volumes times out\n"); pvr_timer_id = OSAL_INVALID_ID; ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_USBREMOUNT, 0, FALSE); }
PRESULT ap_mp_message_proc(UINT32 msg_type, UINT32 msg_code) { UINT32 dev_type = DM_DEV_TYPE(msg_code); UINT32 dev_id = DM_DEV_ID(msg_code); UINT8 back_saved; #ifdef DVR_PVR_SUPPORT ap_pvr_message_proc(msg_type, msg_code, 0); #endif if (msg_type == CTRL_MSG_SUBTYPE_STATUS_USBMOUNT) { if (dev_type != MNT_TYPE_SD) { pvr_disk_attach_proc(FALSE); disk_usb_num++; } mp_disk_attach_proc(); win_disk_info_update(TRUE); #if (defined(GZ1110006)||defined(GZ1110007)) win_compopup_init(WIN_POPUP_TYPE_SMSG); win_compopup_set_msg( NULL,OSD_GetUnicodeString(RS_USB_DIS_CO), 0); #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(); #else dm_disk_show_hint(dev_type, dev_id, DM_HINT_CONNECT); #endif ap_send_msg(CTRL_MSG_SUBTYPE_CMD_STO, USB_STATUS_OVER, FALSE); } else if (msg_type == CTRL_MSG_SUBTYPE_STATUS_USBREMOUNT) { pvr_disk_attach_proc(TRUE); } else if (msg_type == CTRL_MSG_SUBTYPE_STATUS_USBUNMOUNT) { if (dev_type != MNT_TYPE_SD) { pvr_disk_detach_proc(); if(disk_usb_num==2) { pvr_disk_attach_proc(FALSE); } disk_usb_num--; } mp_disk_detach_proc(); win_disk_info_update(TRUE); SetReplayHintState(0); ShowReplayHintOSDOnOff(0); #if (defined(GZ1110006)||defined(GZ1110007)) win_compopup_init(WIN_POPUP_TYPE_SMSG); win_compopup_set_msg( NULL,OSD_GetUnicodeString(RS_USB_DIS_DISCO), 0); #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(); #else dm_disk_show_hint(dev_type, dev_id, DM_HINT_DISCONNECT); #endif if (dev_type != MNT_TYPE_SD) { win_pvr_detach_proc(); // must call after pvr_disk_detach_proc() } win_mp_detach_proc(); // must call after mp_disk_detach_proc() ap_send_msg(CTRL_MSG_SUBTYPE_CMD_STO, USB_STATUS_OVER, FALSE); } else if (msg_type == CTRL_MSG_SUBTYPE_STATUS_USBREFLASH) { ap_udisk_close(); #ifdef NEW_DEMO_FRAME win_media_player_init((mp_callback_func)(mp_apcallback)); mp_udisk_id = 0; #else udisk_set_ingore_dir(PVR_ROOT_DIR); mp_udisk_id = udisk_init(mp_udisk_id,(mp_callback_func)(mp_apcallback), __MM_MP_BUFFER_ADDR, __MM_MP_BUFFER_LEN); #endif } return PROC_LOOP; }
void mp_apcallback(UINT32 event_type,UINT32 param) { // DM_DEBUG("%s(): event_type = %d, param=%d\n",__FUNCTION__, event_type, param); POBJECT_HEAD win_top = menu_stack_get_top(); if((win_top == (POBJECT_HEAD)&g_win_imageslide) || (win_top == (POBJECT_HEAD)&g_win_usb_filelist) || (win_top == (POBJECT_HEAD)&g_win_imagepreview) || (win_top == (POBJECT_HEAD)&g_win_mpeg_player) || (win_top == (POBJECT_HEAD)&g_win_record) || (win_top == (POBJECT_HEAD)&g_win_volume) || (win_top == (POBJECT_HEAD)&g_cnt_chapter) #ifdef YOUTUBE_TEST || (win_top == (POBJECT_HEAD)&g_win_mpegYT_player) #endif #ifdef YOUPORN_TEST || (win_top == (POBJECT_HEAD)&g_win_youporn_player) #endif ) { switch(event_type) { case MP_IMAGE_PLAYBACK_END: // ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER,0,FALSE);//when play jpg+mp3,should not clear buff ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER,osal_get_tick(),FALSE);//when play jpg+mp3,should not clear buff break; case MP_MUSIC_PLAYBACK_END: ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MP3OVER,0,FALSE); break; case MP_IMAGE_DECODE_PROCESS: ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_PROCESS,param,FALSE); break; case MP_IMAGE_DECODER_ERROR: ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_ERR,param,FALSE); break; case MP_VIDEO_PLAYBACK_END: ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_VIDEO_OVER,param,TRUE); break; case MP_VIDEO_BUILD_IDX_TBL: ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_BUILD_IDX, param, FALSE); break; case MP_VIDEO_PARSE_END: ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_PARSE_END,param,TRUE); break; case MP_VIDEO_DECODER_ERROR: ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_VIDEO_DEC_ERR,param,TRUE); break; #ifdef SUPPORT_DRM case MP_DRM_NOT_AUTHORIZED: ap_send_msg(CTRL_MSG_SUBTYPE_DRM_NOT_AUTHORIZED, 0, FALSE); break; case MP_DRM_RENTAL_EXPIRED: ap_send_msg(CTRL_MSG_SUBTYPE_DRM_RENTAL_EXPIRED, param, FALSE); break; case MP_DRM_VIEW_RENTAL: ap_send_msg(CTRL_MSG_SUBTYPE_DRM_VIEW_RENTAL, param, FALSE); break; case MP_DRM_VERSION_ERR: ap_send_msg(CTRL_MSG_SUBTYPE_DRM_VERSION_ERR, 0, FALSE); break; case MP_DRM_ICT_ENABLE: ap_send_msg(CTRL_MSG_SUBTYPE_DRM_ICT_ENABLE, param, FALSE); break; #endif case MP_FS_IDE_MOUNT_NAME: STRCPY((char *)param, IDE_MOUNT_NAME); break; case MP_FS_USB_MOUNT_NAME: STRCPY((char *)param, USB_MOUNT_NAME); break; default: break; } } }
static PRESULT win_wifilist_message_proc(UINT32 msg_type, UINT32 msg_code) { PRESULT ret = PROC_LOOP; switch(msg_type) { case CTRL_MSG_SUBTYPE_STATUS_SIGNAL: win_wifilist_refresh_signal_bar(FALSE); break; case CTRL_MSG_SUBTYPE_CMD_WIFI_CTRL_MSG: win_wifilist_lib_wifi_sync_device_state(); switch(msg_code) { case WIFI_MSG_DEVICE_PLUG_IN: DEBUG_PRINTF("[xxxx] WIFI_MSG_DEVICE_PLUG_IN\n"); break; case WIFI_MSG_DEVICE_PLUG_OUT: DEBUG_PRINTF("[xxxx] WIFI_MSG_DEVICE_PLUG_OUT\n"); AP_Num=0; win_wifilist_update_all_wifi_manager_menu(TRUE); //ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (POBJECT_HEAD)&g_win_mainmenu, TRUE); ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT, 1, TRUE); break; case WIFI_MSG_DEVICE_ON: DEBUG_PRINTF("[xxxx] WIFI_MSG_DEVICE_ON\n"); win_wifilist_lib_wifi_retrieve_ap_scan_list(); win_wifilist_update_all_wifi_manager_menu(TRUE); break; case WIFI_MSG_DEVICE_OFF: DEBUG_PRINTF("[xxxx] WIFI_MSG_DEVICE_OFF\n"); AP_Num=0; win_wifilist_update_all_wifi_manager_menu(TRUE); break; case WIFI_MSG_DEVICE_AP_CONNECTED: DEBUG_PRINTF("[xxxx] WIFI_MSG_DEVICE_AP_CONNECTED\n"); win_wifilist_lib_wifi_retrieve_ap_scan_list(); win_wifilist_update_all_wifi_manager_menu(TRUE); break; case WIFI_MSG_DEVICE_AP_DISCONNECTED: DEBUG_PRINTF("[xxxx] WIFI_MSG_DEVICE_AP_DISCONNECTED\n"); win_wifilist_set_ui_wifi_manager_state(WIFI_UI_AP_SCANNING); win_wifilist_update_all_wifi_manager_menu(TRUE); break; case WIFI_MSG_DEVICE_AP_SCAN_FINISH: DEBUG_PRINTF("[xxxx] WIFI_MSG_DEVICE_AP_SCAN_FINISH\n"); gCurrentTime=osal_get_time(); if((AP_Num==0)|| ((gCurrentTime-gGetListTime)>AP_LIST_REFRESH_THRESHOLD)) { //Update entire AP List win_wifilist_lib_wifi_retrieve_ap_scan_list(); } else { //Update AP List's signal only win_wifilist_lib_wifi_update_ap_list_signal(); } win_wifilist_update_all_wifi_manager_menu(TRUE); break; } break; } if(!api_wifi_get_device_plugged_status()) { ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT, 1, TRUE); } return ret; }
/* * name: api_sim_callback * in : param( Struct sim_cb_param ) * out : SUCCESS or ERR_FAILUE * function: to be registered in sim, send info "CTRL_MSG_SUBTYPE_CMD_PIDCHANGE" at runtime when the PID monitored changed */ INT32 api_sim_callback(UINT32 param) { struct sim_cb_param *sim_param = (struct sim_cb_param *)param; INT32 ret = ERR_FAILUE; UINT16 sim_pcr_pid; UINT16 sim_video_pid; UINT16 sim_audio_pid[P_MAX_AUDIO_NUM]; UINT16 sim_audio_count = P_MAX_AUDIO_NUM; static BOOL on_process = FALSE; /* while(on_process) { osal_task_sleep(10); } */ on_process = TRUE; //static var to minitor the ecm and emm pids static UINT16 ecm_pids[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; static UINT16 emm_pids[16]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; static UINT16 ecm_pids_len = 0; UINT16 sie_ecm_pids[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; UINT16 sie_emm_pids[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; UINT8 max_ecm_cnt = 16; UINT8 max_emm_cnt = 16; static P_NODE p_node; // Come from get_prog_by_id INT8 sim_idx = -1, i; sim_information* info = api_get_sim_info_slot_by_sim(sim_param->dmx_idx, sim_param->sim_id); do{ if( NULL == info) { break; } if (sim_param->table == MONITE_TB_PMT) { sim_video_pid = sim_pcr_pid = 8191; MEMSET(sim_audio_pid, 8191, P_MAX_AUDIO_NUM); if (ERR_FAILUE == sim_get_video_pid(sim_param->sim_id, &sim_video_pid)) break; //sim_get_pmt(sim_param->sim_id, &sim_p_info); if (ERR_FAILUE == sim_get_audio_info(sim_param->sim_id, sim_audio_pid, NULL, &sim_audio_count)) break; if (ERR_FAILUE== sim_get_pcr_pid(sim_param->sim_id, &sim_pcr_pid)) break; if (ERR_FAILUE == sim_get_ecm_pid(sim_param->sim_id,sie_ecm_pids,&max_ecm_cnt)) break; if ((max_ecm_cnt != 0) && (MEMCMP(ecm_pids,sie_ecm_pids, sizeof(UINT16)*max_ecm_cnt)!=0)) { ecm_pids_len = max_ecm_cnt; libc_printf("ecms changed max_ecm_cnt:%d\n",max_ecm_cnt); MEMCPY(ecm_pids,sie_ecm_pids, sizeof(UINT16)*max_ecm_cnt); }else if(ecm_pids_len !=0 && max_ecm_cnt != ecm_pids_len ) { MEMCPY(ecm_pids,sie_ecm_pids, sizeof(UINT16)*(ecm_pids_len>max_ecm_cnt?ecm_pids_len:max_ecm_cnt)); ecm_pids_len = max_ecm_cnt; libc_printf("ecms changed 2 max_ecm_cnt = %d\n",max_ecm_cnt); } get_prog_by_id(info->prog_id, &p_node); if(p_node.pmt_pid != sim_param->sec_pid) { //used for debug!! libc_printf("fatal error!"); break; } //normal mode to update video pid, audio pid, ... except ecm pid & emm pid //libc_printf("dxm%d sim %d :channel %d pid [v %d, a %d, pcr %d] -> [v %d, a %d, pcr %d]\n", \ // sim_param->dmx_idx,sim_param->sim_id,info->prog_id, p_node.video_pid, p_node.audio_pid[0], p_node.pcr_pid, sim_video_pid, sim_audio_pid[0], sim_pcr_pid); if((sim_video_pid != p_node.video_pid) || (sim_pcr_pid != p_node.pcr_pid) ||(sim_audio_count != p_node.audio_count) ||(MEMCMP(p_node.audio_pid,sim_audio_pid, sizeof(UINT16)*sim_audio_count)!=0)) { if ((PROG_TV_MODE ==p_node.av_flag) &&((0 == sim_video_pid) ||(8191 == sim_video_pid) ||(0 == sim_pcr_pid) ||(8191 == sim_pcr_pid) ||(0 == sim_audio_pid[0]) ||(8191 == sim_audio_pid[0]))) break; if ((PROG_RADIO_MODE ==p_node.av_flag) &&((0 != sim_video_pid) ||(8191 != sim_video_pid) ||(0 == sim_pcr_pid) ||(8191 == sim_pcr_pid) ||(0 == sim_audio_pid[0]) ||(8191 == sim_audio_pid[0]))) break; //libc_printf("dxm%d sim %d :channel %d pid changed![v %d, a %d, pcr %d] -> [v %d, a %d, pcr %d]\n", \ // sim_param->dmx_idx,sim_param->sim_id,info->prog_id, p_node.video_pid, p_node.audio_pid[0], p_node.pcr_pid, sim_video_pid, sim_audio_pid[0], sim_pcr_pid); if(PROG_TV_MODE ==p_node.av_flag) p_node.video_pid = sim_video_pid; p_node.pcr_pid = sim_pcr_pid; p_node.audio_count = sim_audio_count; MEMCPY(p_node.audio_pid, sim_audio_pid, sizeof(UINT16)*sim_audio_count); modify_prog(p_node.prog_id, &p_node); update_data(); api_set_active_sim_info(info); ap_send_msg(CTRL_MSG_SUBTYPE_CMD_PIDCHANGE, p_node.prog_id, FALSE);//move down for sending MSG after modifed p_node } } //CA mode to update emm pid pid if ( sim_param->table == MONITE_TB_CAT ) { if (ERR_FAILUE == sim_get_emm_pid(sim_param->sim_id,sie_emm_pids,&max_emm_cnt)) break; if ((p_node.ca_mode) &&(max_emm_cnt != 0) && (MEMCMP(emm_pids,sie_ecm_pids, sizeof(UINT16)*max_emm_cnt)!=0)) { for (i=0;i<max_emm_cnt;i++) { libc_printf("emm pid changed![ %d] -> [ %d]\n",emm_pids[i],sie_emm_pids[i]); } libc_printf("Dynamic PID cause EMM changed!\n Need to update code to support it\n"); MEMCPY(emm_pids,sie_emm_pids, sizeof(UINT16)*max_emm_cnt); // TO DO: add ca interface to change the ecm_pids and emm_pids // TO DO: add pvr interface to change the ecm_pids and emm_pids } } ret = SUCCESS; }while(0); on_process = FALSE; 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; }
void win_sleep_handler() { ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SLEEP, (UINT32)0,TRUE); }
static PRESULT sm_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT32 i; UINT8 unact; CONTAINER* cont = (CONTAINER*)pObj; UINT8 id = OSD_GetObjID(pObj); POBJECT_HEAD focusObj; switch(event) { case EVN_PRE_OPEN: #if 0 for(i=0;i<9;i++) ComInt2UniStr(display_strs[i], i + 1, 0); #endif if (!submenu_set_items(sub_menu_desc)) { return PROC_LEAVE; } #ifdef EXIT_KEY_EXIT_ALL_MENU exit_key_flag =FALSE; #endif //wincom_open_title(pObj,sub_menu_desc->title_id, 0); //guop break; case EVN_POST_OPEN: break; case EVN_PRE_DRAW: { UINT8 mm_focus_id= OSD_GetFocusID((POBJECT_HEAD)&g_win_mainmenu); UINT8 sm_focus_id= OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu); #if ((defined(OSD_GOLDENMEDIA)) ||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12))) ((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=(sub_menu_desc->item_count)*43+50; #else if((mm_focus_id==1)/*&&((sm_focus_id==1)||(sm_focus_id==2))*/) ((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=W_H+14; else ((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=W_H; #endif }break; case EVN_POST_DRAW: { UINT16 str_id; UINT8 mm_focus_id= OSD_GetFocusID((POBJECT_HEAD)&g_win_mainmenu); UINT8 sm_focus_id= OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu); str_id=mm_item_str_ids[mm_focus_id-1]; OSD_SetTextFieldContent((PTEXT_FIELD)&subm_item_title,STRING_ID,str_id ); OSD_DrawObject((POBJECT_HEAD)&subm_item_title,C_UPDATE_ALL); //item_count = sub_menu_desc->item_count; #if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12))) #else need_draw_signal_status=0; #endif #ifdef OSD_12 #ifdef PREVIEW_SUBMENU switch(mm_focus_id) { case 1: //str_id=RS_MM_SERVICE; if(submenu_open_from_stack) { submenu_open_from_stack=0; if(editchannel_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(editchannel_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/); } break; case 2: //str_id=RS_MM_INSTALLATION; //if(sm_focus_id==1) if(submenu_open_from_stack) { submenu_open_from_stack=0; if(installation_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(installation_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/); } break; #ifdef PREVIEW_SUBMENU //-a by wangyang case 3: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(system_sub_menus[sm_focus_id-1]!=NULL) { /* if(system_sub_menus[sm_focus_id-1]==(POBJECT_HEAD)&g_win_disk_operate) OSD_ObjOpen((POBJECT_HEAD)&g_win_disk_operate, MENU_OPEN_TYPE_OTHER ); else*/ OSD_ObjOpen(system_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } } break; case 4: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(preference_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(preference_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; case 13: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(network_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(network_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; #if 1 case 14: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(sm_focus_id==1) { game_othello_init(); } else if(sm_focus_id==2) { game_sudoku_init(); } if(games_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(games_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; #endif case 15: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(ca_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(ca_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; case 16: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(upg_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(upg_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; #endif default: break; } #endif #else #ifdef PREVIEW_SUBMENU switch(mm_focus_id) { case 1: //str_id=RS_MM_SERVICE; if(submenu_open_from_stack) { submenu_open_from_stack=0; if(editchannel_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(editchannel_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/); } break; case 2: //str_id=RS_MM_INSTALLATION; //if(sm_focus_id==1) if(submenu_open_from_stack) { submenu_open_from_stack=0; if(installation_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(installation_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/); } break; #ifdef PREVIEW_SUBMENU //-a by wangyang case 3: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(system_sub_menus[sm_focus_id-1]!=NULL) { /* if(system_sub_menus[sm_focus_id-1]==(POBJECT_HEAD)&g_win_disk_operate) OSD_ObjOpen((POBJECT_HEAD)&g_win_disk_operate, MENU_OPEN_TYPE_OTHER ); else*/ OSD_ObjOpen(system_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } } break; case 4: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(preference_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(preference_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; case 9: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(network_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(network_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; #if 1 case 10: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(sm_focus_id==1) { game_othello_init(); } else if(sm_focus_id==2) { game_sudoku_init(); } if(games_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(games_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; #endif case 11: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(ca_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(ca_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; case 12: if(submenu_open_from_stack) { submenu_open_from_stack=0; if(upg_sub_menus[sm_focus_id-1]!=NULL) OSD_ObjOpen(upg_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER); } break; #endif default: break; } #endif #endif //if(item_count<3) //OSD_SetObjRect(&subm_item_bg,CON_L,CON_T,CON_W,CON_H*2); //else //OSD_SetObjRect(&subm_item_bg,CON_L,CON_T,CON_W,CON_H*item_count+2); //OSD_DrawObject((POBJECT_HEAD)&subm_item_bg,C_UPDATE_ALL); }break; case EVN_PRE_CLOSE: /* Make OSD not flickering */ *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; //OSD_DrawObject((POBJECT_HEAD)&g_win_submenu,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);//albert.li del break; case EVN_POST_CLOSE: enter_system_flag=FALSE; #if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))/*||(defined(OSD_15))*/) #ifdef EXIT_KEY_EXIT_ALL_MENU if(exit_key_flag) api_full_screen_play(); #endif #else api_full_screen_play(); #endif #if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12))) #else need_draw_signal_status=1; #endif #ifdef EXIT_KEY_EXIT_ALL_MENU #ifdef MINI_INFO_BAR//wdh 2012.2.3 对此客户,进入service 的submenu项直接按推出键会出现信号条没消除掉,原因是把INFO BAR 改小以后没有刷新的这块区域 win_progname_signal_close(); #endif if(exit_key_flag ==FALSE ) { exit_submenu_flag_mute =TRUE; exit_submenu_flag_pause =TRUE; exit_submenu_flag_rec =TRUE; ap_send_key(V_KEY_MENU, TRUE); } else { exit_key_flag =FALSE; } #else ap_send_key(V_KEY_MENU, TRUE);//albert.li add #endif break; case EVN_UNKNOWN_ACTION: #ifdef PREVIEW_SUBMENU unact = (VACTION)(param1>>16) ; if((unact == VACT_FOCUS_UP)||(unact == VACT_FOCUS_DOWN)) ; else #endif submenu_unknown_act(sub_menu_desc, (VACTION)(param1>>16)); ret = PROC_LOOP; break; case EVN_MSG_GOT: if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER) { #ifdef PREVIEW_SUBMENU //-a by wangyang UINT8 sm_focus_id= OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu); #endif //storage_dev_mount_hint(1); submenu_set_items(sub_menu_desc); submenu_show(); OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); // if all sub menu items are inactive, exit sub menu if (!submenu_active(sub_menu_desc)) { UINT32 hkey; ap_vk_to_hk(0, V_KEY_EXIT, &hkey); ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE); } #ifdef USB_MP_SUPPORT #ifdef USB_SAFELY_REMOVE_SUPPORT #ifndef DISK_MANAGER_SUPPORT extern UINT8 g_show_usb_safely_removed; if (g_show_usb_safely_removed) { g_show_usb_safely_removed = 0; UINT8 back_saved; win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_msg(NULL, NULL, RS_USB_SAFELY_REMOVE_SUCCESS); ap_clear_all_message(); win_compopup_open_ext(&back_saved); } #endif #endif #endif #ifdef PREVIEW_SUBMENU //-a by wangyang if(sub_menu_desc->title_id==RS_MM_SYSTEM) { if((sm_focus_id ==4)||(sm_focus_id ==5) ||(sm_focus_id ==6)) { OSD_DrawFill(SUBMENU_W_L, SUBMENU_W_T, (SUBMENU_W_W), (SUBMENU_W_H), OSD_TRANSPARENT_COLOR, NULL); OSD_ObjOpen((POBJECT_HEAD)&win_info_con, MENU_OPEN_TYPE_OTHER ); } } else if (sub_menu_desc->title_id==RS_MM_UPGRADE) { if((sm_focus_id ==3)||(sm_focus_id==4)) { OSD_DrawFill(SUBMENU_W_L, SUBMENU_W_T, (SUBMENU_W_W), (SUBMENU_W_H), OSD_TRANSPARENT_COLOR, NULL); OSD_ObjOpen((POBJECT_HEAD)&win_rs232upg_con, MENU_OPEN_TYPE_OTHER ); } } #endif } #ifdef PREVIEW_SUBMENU //-a by wangyang { UINT8 sm_focus_id; sm_focus_id= OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu); #if !defined (MAIN_CHIP_M3601S) && !defined (M3606_NON_NETWORK) if (sub_menu_desc->title_id==RS_MM_NETWORK) { if((sm_focus_id ==1)) { TestNetStatus(); } } #endif } #endif #ifdef NETWORK_SUPPORT #ifdef WIFI_SUPPORT if(param1 == CTRL_MSG_SUBTYPE_CMD_WIFI_CTRL_MSG && (param2 == WIFI_MSG_DEVICE_PLUG_IN||param2 == WIFI_MSG_DEVICE_PLUG_OUT)) { //storage_dev_mount_hint(1); submenu_set_items(sub_menu_desc); submenu_show(); OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); // if all sub menu items are inactive, exit sub menu if (!submenu_active(sub_menu_desc)) { UINT32 hkey; ap_vk_to_hk(0, V_KEY_EXIT, &hkey); ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE); } } #endif #endif 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; }
/*qjzheng ,2010.7.15 未完成,只支持输入数字*/ BOOL win_input_open(char *title, UINT32 input_type) { char ch; UINT32 hkey,vkey; UINT32* exit_pwd_keys; UINT32 exit_pwd_keycnt; UINT32 i,vscr_idx; UINT32 pwd_u32; BOOL ret = TRUE; struct OSDRect* frame; POBJECT_HEAD win; POBJECT_HEAD pObj; CONTAINER* con; BOOL old_value = ap_enable_key_task_get_key(TRUE); con = &win_input_con; if(!api_is_sd_color_mode()) { #if 0 pObj = (POBJECT_HEAD)&win_input_con; OSD_SetColor(pObj,WIN_SH_IDX,WIN_SH_IDX,0,0); pObj = (POBJECT_HEAD)&win_input_title; OSD_SetColor(pObj, TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX); pObj = (POBJECT_HEAD)&win_input_char; OSD_SetColor(pObj, CHAR_SH_IDX,CHAR_HL_IDX,CHAR_SH_IDX,CHAR_SH_IDX); #endif } else if(api_is_sd_color_mode()) { pObj = (POBJECT_HEAD)&win_input_con; OSD_SetColor(pObj,WIN_SH_IDX_SD,WIN_SH_IDX_SD,0,0); pObj = (POBJECT_HEAD)&win_input_title; OSD_SetColor(pObj, TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD); pObj = (POBJECT_HEAD)&win_input_char; OSD_SetColor(pObj, CHAR_SH_IDX_SD,CHAR_HL_IDX_SD,CHAR_SH_IDX_SD,CHAR_SH_IDX_SD); } //win_input_con.head.frame.uHeight=W_H; //win_input_title.wStringID=RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD; if(title!=NULL) { OSD_SetTextFieldStrPoint(&win_input_title,display_strs[0]); OSD_SetTextFieldContent(&win_input_title,STRING_ANSI,(UINT32)title); } else { OSD_SetTextFieldStrPoint(&win_input_title,NULL); OSD_SetTextFieldContent(&win_input_title,STRING_ID,RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD); } exit_pwd_keys = default_key_exit; exit_pwd_keycnt = sizeof(default_key_exit)/sizeof(default_key_exit[0]); win = (POBJECT_HEAD)&win_input_con; /* Start to try to save backgrand */ wincom_backup_region(&win->frame); /* End of try to save backgrand */ input_char_cnt = 0; OSD_DrawObject(win, C_UPDATE_ALL); win_input_draw_chars(); while(1) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ap_hk_to_vk(0, hkey, &vkey); for(i=0;i<exit_pwd_keycnt;i++) { if(vkey == exit_pwd_keys[i]) { ret = FALSE; goto EXIT; } } if(vkey<=V_KEY_9) { ch = (char)('0' + (vkey - V_KEY_0)); if(input_char_cnt < input_length) { input_chars[input_char_cnt] = ch; input_char_cnt ++; } win_input_draw_chars(); if(input_char_cnt == input_length) { ret = TRUE; goto EXIT; } } else if(vkey==V_KEY_LEFT) { if(input_char_cnt) { input_char_cnt--; win_input_draw_chars(); } } }; EXIT: wincom_restore_region(); if((!ret) && ((vkey != V_KEY_EXIT) && (vkey != V_KEY_MENU))) { ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);/*if exit key got,repatch the messages again*/ } ap_enable_key_task_get_key(old_value); return ret; }
static PRESULT wifi_password_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT8 bID; UINT32 pos0; switch(event) { case EVN_PRE_OPEN: wifi_password_set_color_style(); api_inc_wnd_count(); win_wifi_password_keyboard_set_title(RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD); wifi_password_init_keys(); wifi_password_set_key_display(); break; case EVN_POST_OPEN: #ifdef OSD_12 draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L-10, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 280+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #else draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 240+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #endif break; case EVN_PRE_CLOSE: /* Make OSD not flickering */ *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; break; case EVN_POST_CLOSE: api_dec_wnd_count(); break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_CANCEL) { wifi_password_check_ok = FALSE; ret = PROC_LEAVE; } #ifdef RC_PHILIPS_RCMM else if(((unact >= VACT_NUM_0 && unact<= VACT_NUM_9)||(unact >= VACT_sh_0 && unact<= VACT_sh_9)||(unact >= VACT_alt_0 && unact<= VACT_alt_9))&&(change_char_for_findkeyborad==1)) { change_char_for_findkeyborad=0; if(unact >= VACT_alt_0 && unact<= VACT_alt_9) { if((unact==VACT_alt_0)) bID =39;// 1 else if((unact==VACT_alt_1)) bID =40;// 2 else if((unact==VACT_alt_2)) bID =41;// 3 else if((unact==VACT_alt_3)) bID =42;//E else if((unact==VACT_alt_4)) bID =43;//R else if((unact==VACT_alt_5)) bID =44;//T else if((unact==VACT_alt_6)) bID =45;//Y else if((unact==VACT_alt_7)) bID =46;//U else if((unact==VACT_alt_8)) bID =47;//I else if((unact==VACT_alt_9)) bID =48;//O } else { if((unact==VACT_NUM_0)||(unact==VACT_sh_0)) bID =16;//P else if((unact==VACT_NUM_1)||(unact==VACT_sh_1)) bID =17;//Q else if((unact==VACT_NUM_2)||(unact==VACT_sh_2)) bID =23;//w else if((unact==VACT_NUM_3)||(unact==VACT_sh_3)) bID =5;//E else if((unact==VACT_NUM_4)||(unact==VACT_sh_4)) bID =18;//R else if((unact==VACT_NUM_5)||(unact==VACT_sh_5)) bID =20;//T else if((unact==VACT_NUM_6)||(unact==VACT_sh_6)) bID =25;//Y else if((unact==VACT_NUM_7)||(unact==VACT_sh_7)) bID =21;//U else if((unact==VACT_NUM_8)||(unact==VACT_sh_8)) bID =9;//I else if((unact==VACT_NUM_9)||(unact==VACT_sh_9)) bID =15;//O //libc_printf("\nlllll00000000000wwwwwwww===%d\n",cur_display_mode); if((unact >= VACT_NUM_0 && unact<= VACT_NUM_9)&&(cur_display_mode2==0)) find_set_chars(1); else if((unact >= VACT_sh_0 && unact<= VACT_sh_9)&&(cur_display_mode2==1)) find_set_chars(1); OSD_TrackObject((POBJECT_HEAD)&g_win_wifi_password, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); #ifdef OSD_12 draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L-10, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 280+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #else draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 240+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #endif } OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } else if((unact >= VACT_EDIT_A&& unact<= VACT_EDIT_COMMA) ||(unact >= VACT_EDIT_Z&& unact<= VACT_EDIT_SPACE) ||(unact >= VACT_sh_A&& unact<= VACT_sh_M) ||(unact == VACT_sh_COM) ||(unact >= VACT_alt_A&& unact<= VACT_alt_WWW) ) { // libc_printf("\nssssssssssssssss===%d\n"); if((unact >= VACT_alt_A&& unact<= VACT_alt_WWW)) { if((unact==VACT_alt_A)) bID =52;// ? else if((unact==VACT_alt_S))//大写里 bID =27;// ! else if((unact==VACT_alt_D)) bID =28;// # else if((unact==VACT_alt_F)) bID =29;// $ else if((unact==VACT_alt_G)) bID =30;// % else if((unact==VACT_alt_H)) bID =51;// & else if((unact==VACT_alt_J)) bID =32;//* else if((unact==VACT_alt_K)) bID =33;// ( else if((unact==VACT_alt_L)) bID =34;// ) else if((unact==VACT_alt_Z)) bID =36;// + else if((unact==VACT_alt_X)) bID =35;// - //else if((unact==VACT_alt_C)) // bID =3;//C else if((unact==VACT_alt_COMMA)) bID =27;// : else if((unact==VACT_alt_V))//小写里 bID =30;// / else if((unact==VACT_alt_B)) bID =32;// _ else if((unact==VACT_alt_N)) bID =29;//N //else if((unact==VACT_alt_M)) // bID =29;// ' else if((unact==VACT_alt_WWW)) bID =28;// : if(((unact==VACT_alt_S) ||(unact==VACT_alt_D) ||(unact==VACT_alt_F) ||(unact==VACT_alt_G) ||(unact==VACT_alt_J) ||(unact==VACT_alt_K) ||(unact==VACT_alt_L) ||(unact==VACT_alt_Z) ||(unact==VACT_alt_X)) &&(cur_display_mode2==1) ) { find_set_chars(1); } else if(((unact==VACT_alt_V) ||(unact==VACT_alt_B) ||(unact==VACT_alt_WWW) ||(unact==VACT_alt_COMMA) ||(unact==VACT_alt_N)) &&(cur_display_mode2==0) ) { find_set_chars(1); } } else { if((unact==VACT_EDIT_A)||(unact==VACT_sh_A)) bID =1;//A else if((unact==VACT_EDIT_S)||(unact==VACT_sh_S)) bID =19;//S else if((unact==VACT_EDIT_D)||(unact==VACT_sh_D)) bID =4;//D else if((unact==VACT_EDIT_F)||(unact==VACT_sh_F)) bID =6;//F else if((unact==VACT_EDIT_G)||(unact==VACT_sh_G)) bID =7;//G else if((unact==VACT_EDIT_H)||(unact==VACT_sh_H)) bID =8;//H else if((unact==VACT_EDIT_J)||(unact==VACT_sh_J)) bID =10;//J else if((unact==VACT_EDIT_K)||(unact==VACT_sh_K)) bID =11;//K else if((unact==VACT_EDIT_L)||(unact==VACT_sh_L)) bID =12;//L else if((unact==VACT_EDIT_Z)||(unact==VACT_sh_Z)) bID =26;//Z else if((unact==VACT_EDIT_X)||(unact==VACT_sh_X)) bID =24;//X else if((unact==VACT_EDIT_C)||(unact==VACT_sh_C)) bID =3;//C else if((unact==VACT_EDIT_V)||(unact==VACT_sh_V)) bID =22;//V else if((unact==VACT_EDIT_B)||(unact==VACT_sh_B)) bID =2;//B else if((unact==VACT_EDIT_N)||(unact==VACT_sh_N)) bID =14;//N else if((unact==VACT_EDIT_M)||(unact==VACT_sh_M)) bID =13;//M else if(unact==VACT_EDIT_SPACE) bID =49;//M else if(unact==VACT_EDIT_WWW) bID =37;//M else if(unact==VACT_EDIT_COMMA) bID =38;// else if(unact==VACT_sh_COM) bID =50;// if(((unact >= VACT_EDIT_A && unact<VACT_EDIT_COMMA)||( unact >VACT_EDIT_COMMA &&unact<= VACT_EDIT_WWW))&&(cur_display_mode2==0)) find_set_chars(1); else if((unact >= VACT_sh_A && unact<= VACT_sh_M)&&(cur_display_mode2==1)) find_set_chars(1); else if((unact == VACT_EDIT_COMMA)&&(cur_display_mode2==1)) find_set_chars(1); } OSD_TrackObject((POBJECT_HEAD)&g_win_wifi_password, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); #ifdef OSD_12 draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L-10, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 280+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #else draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 240+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #endif if((unact==VACT_alt_C)||(unact==VACT_alt_M))//键盘里没有此字符 {} else OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } else if(unact >= VACT_NUM_0 && unact<= VACT_NUM_9) { for(pos0=0;pos0<KEY_CNT;pos0++) { if(wifi_password_key_chars[pos0] == '0') { break; } } bID = pos0+1 + unact - VACT_NUM_0; OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } #else else if(unact >= VACT_NUM_0 && unact<= VACT_NUM_9) { for(pos0=0;pos0<KEY_CNT;pos0++) { if(wifi_password_key_chars[pos0] == '0') { break; } } bID = pos0+1 + unact - VACT_NUM_0; OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } #endif } return ret; }
/******************************************************************************* * key mapping and event callback definition *******************************************************************************/ void multifeed_timer_func(UINT unused) { api_stop_timer(&multifeed_timer); ap_send_msg(CTRL_MSG_SUBTYPE_EXIT, multifeed_timer, TRUE); }
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_progdetail_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT32 vkey; static int input_num = 0; switch(event) { case EVN_PRE_OPEN: api_inc_wnd_count(); info_load(); break; case EVN_POST_OPEN: //win_minisignal_open(pObj); win_prog_event_display(TRUE); win_minisignal_open_ex(pObj,SIGNAL_L,SIGNAL_T); win_signal_refresh(); break; case EVN_MSG_GOT: if(CTRL_MSG_SUBTYPE_STATUS_SIGNAL == param1) win_signal_refresh(); else if(CTRL_MSG_SUBTYPE_CMD_PIDCHANGE == param1) { info_load(); OSD_DrawObject((POBJECT_HEAD)&txt_pidinfo,C_UPDATE_ALL); } break; case EVN_PRE_CLOSE: break; case EVN_POST_CLOSE: win_minisignal_restore(); win_signal_close(); api_dec_wnd_count(); break; #ifdef SFU_TEST_SUPPORT case EVN_UNKNOWNKEY_GOT: ap_hk_to_vk(0,param1,&vkey); //libc_printf("%s %d\n",__FUNCTION__,vkey); if(vkey <= V_KEY_9 && vkey >= V_KEY_0) { input_num *= 10; input_num += vkey; if(2008 == input_num) { //#define IOBASEADDRRESS 0xB8000000 //#if (SYS_CHIP_MODULE == ALI_S3601) //#define EXT_INT_STAT (IOBASEADDRRESS + 0x30) //#define EXT_INT_MASK (IOBASEADDRRESS + 0x34) //#elif (SYS_CHIP_MODULE == ALI_S3602) //#define EXT_INT_STAT (IOBASEADDRRESS + 0x30) //#define EXT_INT_MASK (IOBASEADDRRESS + 0x38) //#else //#define EXT_INT_STAT (IOBASEADDRRESS + 0x38) //#define EXT_INT_MASK (IOBASEADDRRESS + 0x3C) //#endif //disable pan and ir interrupt //*(volatile UINT32*)EXT_INT_MASK = (*(volatile UINT32*)EXT_INT_MASK) & (~0x10080000); libc_printf("Enter SFU auto test\n"); input_num = 0; extern struct pan_device* g_pan_dev; pan_close(g_pan_dev); g_b_is_open_sfu = TRUE; SFUTestInit(); ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_progdetail,FALSE); } } else { input_num = 0; } break; #endif default: break; } return ret; }
static PRESULT record_con_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT8 unact; UINT8 id = OSD_GetObjID(pObj) + sub_menu_desc->list_top; UINT8 back_saved; switch(event) { case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16) ; if(unact == VACT_ENTER) { if(id == RECORD_PVRMANAGE_ID) { hddfmt_win_set_type(TRUE); } else { hddfmt_win_set_type(FALSE); } #ifdef USB_SAFELY_REMOVE_SUPPORT if(id == TOOLS_USB_REMOVE_ID) //guop edit 20100623 { win_compopup_init(WIN_POPUP_TYPE_OKNO); win_compopup_set_msg(NULL, NULL,RS_USB_REMOVE_SAFELY_SURE); win_compopup_set_default_choice(WIN_POP_CHOICE_NO); win_popup_choice_t choice = win_compopup_open_ext(&back_saved); if(choice == WIN_POP_CHOICE_YES) { if (api_usb_device_safely_remove ()) g_show_usb_safely_removed = 1; else { win_compopup_init(WIN_POPUP_TYPE_OK); win_compopup_set_msg(NULL, NULL, RS_USB_SAFELY_REMOVE_FAILED); win_compopup_open_ext(&back_saved); if (!storage_usb_menu_item_ready()) { ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT,(UINT32)(&g_win_mainmenu),TRUE); } } } ret = PROC_LOOP; break; } #endif /* if(id == TOOLS_USB_ID) { if(get_stroage_device_number(STORAGE_TYPE_ALL) > 0 ) { if(mp_title_type != TITLE_RECORD) { enter_sub_menu(record_sub_menus,id - 1); //ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_USBMOUNT,0,0); } else { if(OSD_ObjOpen((POBJECT_HEAD)&g_win_record,(UINT32)(~0)) != PROC_LEAVE) { menu_stack_push((POBJECT_HEAD)&g_win_record); } } } return PROC_LOOP; } */ enter_sub_menu(record_sub_menus,id - 1); ret = PROC_LOOP; } } return ret; }
void volume_timer_func(UINT unused) { api_stop_timer(&volume_timer); ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT, 1, TRUE); }
static PRESULT win_progdetail_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT32 vkey; static int input_num = 0; UINT16 curitem; curitem = sys_data_get_cur_group_cur_mode_channel(); switch(event) { case EVN_PRE_OPEN: api_inc_wnd_count(); info_load(); #if (CC_ON==1) cc_vbi_show_on(FALSE); #endif show_epg_detail = FALSE; break; case EVN_POST_OPEN: //win_minisignal_open(pObj); win_prog_event_display(TRUE); win_minisignal_open_ex(pObj,SIGNAL_L,SIGNAL_T); win_signal_refresh(); break; case EVN_MSG_GOT: if(CTRL_MSG_SUBTYPE_STATUS_SIGNAL == param1) win_signal_refresh(); else if(CTRL_MSG_SUBTYPE_CMD_PIDCHANGE == param1) { info_load(); OSD_DrawObject((POBJECT_HEAD)&txt_pidinfo,C_UPDATE_ALL); } break; case EVN_PRE_CLOSE: break; case EVN_POST_CLOSE: win_minisignal_restore(); win_signal_close(); api_dec_wnd_count(); if(show_epg_detail) { eit_event_info_t *pe=NULL; UINT8 *s1=NULL; UINT16 cur_channel; INT32 len; cur_channel = sys_data_get_cur_group_cur_mode_channel(); pe=epg_get_cur_service_event((INT32)cur_channel, PRESENT_EVENT, NULL,NULL,NULL, /*event_update*/TRUE); s1=epg_get_event_name(pe, &len); if (s1 ) { show_current_epg_detail_win(); } } break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16) ; ret = win_progdatail_unkown_act_proc(unact); break; #ifdef SFU_TEST_SUPPORT case EVN_UNKNOWNKEY_GOT: ap_hk_to_vk(0,param1,&vkey); //libc_printf("%s %d\n",__FUNCTION__,vkey); if(vkey <= V_KEY_9 && vkey >= V_KEY_0) { input_num *= 10; input_num += vkey; if(2008 == input_num) { //#define IOBASEADDRRESS 0xB8000000 //#if (SYS_CHIP_MODULE == ALI_S3601) //#define EXT_INT_STAT (IOBASEADDRRESS + 0x30) //#define EXT_INT_MASK (IOBASEADDRRESS + 0x34) //#elif (SYS_CHIP_MODULE == ALI_S3602) //#define EXT_INT_STAT (IOBASEADDRRESS + 0x30) //#define EXT_INT_MASK (IOBASEADDRRESS + 0x38) //#else //#define EXT_INT_STAT (IOBASEADDRRESS + 0x38) //#define EXT_INT_MASK (IOBASEADDRRESS + 0x3C) //#endif //disable pan and ir interrupt //*(volatile UINT32*)EXT_INT_MASK = (*(volatile UINT32*)EXT_INT_MASK) & (~0x10080000); libc_printf("Enter SFU auto test\n"); input_num = 0; extern struct pan_device* g_pan_dev; pan_close(g_pan_dev); g_b_is_open_sfu = TRUE; SFUTestInit(); ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_progdetail,FALSE); } } else { input_num = 0; } break; #endif default: break; } return ret; }