Beispiel #1
0
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;
}
Beispiel #2
0
/* 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
}
Beispiel #3
0
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);

}
Beispiel #4
0
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);
}
Beispiel #5
0
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;    
}
Beispiel #6
0
void BackToFullScrPlay()
{
	OSD_RECT rect;
	UINT16 cur_channel;
	UINT8 no_channel = 0, back_saved;

	ap_clear_all_menus();
	menu_stack_pop_all();

	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE , 0);
	if (get_prog_num(VIEW_ALL | PROG_TV_MODE, 0) == 0)
	{
		no_channel = 1;
	}
	if (get_prog_num(VIEW_ALL | PROG_RADIO_MODE, 0) > 0)
	{
		if (no_channel)
			sys_data_set_cur_chan_mode(RADIO_CHAN);
		no_channel = 0;
	}

	if (no_channel)
	{
		if (OSD_ObjOpen((POBJECT_HEAD) &g_win_mainmenu, MENU_OPEN_TYPE_STACK) != PROC_LEAVE)
			menu_stack_push((POBJECT_HEAD) &g_win_mainmenu);
	}
	else
	{
		hde_set_mode(VIEW_MODE_FULL);
		vpo_ioctl(g_vpo_dev, VPO_IO_DIRECT_ZOOM, 0);
		/* Clear OSD */
		OSD_GetRectOnScreen(&rect);
		OSDDrv_RegionFill((HANDLE)g_osd_dev, 0, &rect, OSD_TRANSPARENT_COLOR);
		/* show mute & pause status*/
		ShowMuteOnOff();
		ShowPauseOnOff();
//		ap_cas_message_show();
		/* show channel index */
		key_pan_display_channel(cur_channel);

		if(GetChannelParrentLock())
		{
			api_play_channel(cur_channel,TRUE,TRUE,FALSE);
		}
		//--{{{退到全屏播放的时候,弹出INFO BAR
		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)CHANNEL_BAR_HANDLE, TRUE);	
	}
}
Beispiel #7
0
static void win_rs232upg_start()
{
	UINT16 channel;

	OSD_SetProgressBarPos(&rs232upg_bar_progress,(INT16)0);
	OSD_SetTextFieldContent(&rs232upg_txt_progress, STRING_NUM_PERCENT, (UINT32)0);

	sys_upgrade(win_rs232upg_update,upg_check_exit_key/*UIGetExitKey*/);
	FreeSlavelist();
	if(screen_back_state == SCREEN_BACK_VIDEO)
	{
		channel = sys_data_get_cur_group_cur_mode_channel();
		api_play_channel(channel, TRUE, TRUE,FALSE);
	}
}
Beispiel #8
0
static PRESULT win_findprog_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT cbRet = PROC_PASS;
	
	UINT32 i,wTop,prog_idx,nStrLen,k;

	UINT16 channel,str_len;
	UINT16 unistr[50];
	char prog_pre[20];
	P_NODE  p_node;
	OBJLIST* ol = (OBJLIST*)pObj;

	UINT16 dep,cnt;

	dep = OSD_GetObjListPage(ol);
	cnt = OSD_GetObjListCount(ol);

	if(event==EVN_PRE_DRAW)
	{		
    	wTop = OSD_GetObjListTop(ol);
    	for(i=0;i<dep && (i+wTop)<cnt;i++)
		{
			prog_idx = i + wTop;
			get_find_prog_by_pos(prog_idx,&p_node);

			sprintf(prog_pre,"%04d  %s",prog_idx + 1,(p_node.ca_mode==0)? "" :  "$");
			nStrLen = ComAscStr2Uni(prog_pre, unistr);
			ComUniStrCopy(&unistr[nStrLen], (UINT16*)p_node.service_name);

			win_comlist_set_str(i + wTop, NULL, (char*)unistr,0);
		}
	}
	else if(event==EVN_POST_CHANGE)
	{
		cbRet = PROC_LEAVE;
		select_channel_idx = win_comlist_get_selitem();
		get_find_prog_by_pos(select_channel_idx,&p_node);
		select_channel_idx = get_prog_pos(p_node.prog_id);
		
		clear_node_find_flag();

		//UIChChgPlayProg(0, select_channel_idx);

		api_play_channel(p_node.prog_id, TRUE, TRUE, TRUE);
	}

	return cbRet;
}
Beispiel #9
0
void win_multifeed_change_feed()
{
	OBJLIST* ol;	
	UINT16 sel;
	UINT16 cur_channel = sys_data_get_cur_group_cur_mode_channel();
	
	ol = &multifeed_ol;
	if(OSD_GetObjListCount(ol) == 0)
		return;

	sel = OSD_GetObjListSingleSelect(ol);
      
	if(SUCCESS == multifeed_change_feed(cur_channel, sel))
	{
		api_play_channel(cur_channel, TRUE, TRUE,FALSE);
	}
}
Beispiel #10
0
static PRESULT info_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	POBJECT_HEAD submenu;

	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_title((POBJECT_HEAD)&win_info_con,RS_TOOLS_INFORMATION, 0);
		break;			
	case EVN_POST_OPEN:
		display_sys_infomation(0);
		break;		
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;				
		break;
	case EVN_POST_CLOSE:
		break;
	case EVN_UNKNOWN_ACTION:
        param1 &= 0xff;
		if (factorytest_check_magic_key(param1))
		{
#ifdef FACTORY_TEST_MENU
			submenu = (POBJECT_HEAD)&g_win_factory_test;
			if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_OTHER) != PROC_LEAVE)
				menu_stack_push(submenu);
#endif
		}
		else if (factorytest_check_magic_key_diag(param1))
		{
			UINT16 channel = sys_data_get_cur_group_cur_mode_channel();
            UINT16 group_idx = sys_data_get_cur_group_index();
			sys_data_change_group(group_idx);

            api_stop_play(0); //to call si_monitor_off for fixing bug 13806 --Michael 2008/2/18
			api_play_channel(channel, TRUE, FALSE, FALSE);
            ap_clear_all_menus();
			extern CONTAINER win_diag;
			ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&win_diag, TRUE);
		}
        else if(factorytest_check_hdmi_hdcp_key(param1))
        {
            extern CONTAINER g_win_hdmi_factory_test;
            submenu = (POBJECT_HEAD)&g_win_hdmi_factory_test;
            if(OSD_ObjOpen(submenu,MENU_OPEN_TYPE_OTHER) != PROC_LEAVE)
            {
                menu_stack_push(submenu);
            }
        }
        else if(factorytest_check_epg_show_logo_key(param1))
        {
            UINT8 back_saved;
            win_epg_set_show_state();
            win_compopup_init(WIN_POPUP_TYPE_SMSG);
            if(win_epg_is_show_logo())
            {
                win_compopup_set_msg("EPG Show Logo", NULL, 0);
            }
            else
            {
                win_compopup_set_msg("EPG Normal", NULL, 0);
            }
            win_compopup_open_ext(&back_saved);
            osal_task_sleep(2000);
            win_compopup_smsg_restoreback();
        }
		break;
	}
	return ret;
}
Beispiel #11
0
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 DVR_PVR_SUPPORT
	if(api_pvr_is_recording())
	{
		if( act != VACT_CH_UP && act != VACT_CH_DOWN)
		{
			return ret;
		}
	}
#endif

	api_stop_timer(&progname_timer);

	shift = -1;
	switch(act)
	{	
	case VACT_CH_UP:
		shift = 1;
	case VACT_CH_DOWN:
		change_channel(shift);
		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_get_cur_group_channel(&channel, av_mode);
		if(channel==P_INVALID_ID) /* If the opposite mode has no channel */
		{
			if(av_mode==RADIO_CHAN)
                strID = RS_MSG_NO_RADIO_CHANNEL;
            else
                strID = RS_MSG_NO_TV_CHANNEL;            
		win_compopup_init(WIN_POPUP_TYPE_SMSG);
		win_compopup_set_msg(NULL, NULL,strID);
		win_compopup_open_ext(&back_saved);
		osal_task_sleep(500);
		win_compopup_smsg_restoreback();
		}
		else
		{
#ifndef NEW_DEMO_FRAME
            UIChChgStopProg(TRUE);
#endif
			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)
			api_play_channel(channel, TRUE, TRUE,FALSE);	
		break;
	case VACT_POP_DETAIL:
		b_popdetail = TRUE;
		ret  = PROC_LEAVE;
		break;
	default:
		break;
	}

	win_progname_redraw();

	progname_timer = api_start_timer(PROGNAME_TIMER_NAME,PROGNAME_TIMER_TIME,progname_timer_func);

	return ret;
}
Beispiel #12
0
    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;
	
	sys_data = sys_data_get();
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		if(screen_back_state == SCREEN_BACK_MENU)
		{
			ap_clear_all_menus();
		}
		
		b_popdetail = FALSE;
		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)
		{
			if( (param2 & MENU_OPEN_PARAM_MASK ) == V_KEY_RECALL)
			{
				recall_channel = recall_play_channel(0);
			    if(recall_channel == P_INVALID_ID)
			        return PROC_LEAVE;
			}
		}
        api_inc_wnd_count();
			
		break;
	case EVN_POST_OPEN:
		if(show_and_playchannel)
		{
			UINT16 channel;

			show_and_playchannel = 0;

			channel = sys_data_get_cur_group_cur_mode_channel();
			api_play_channel(channel, TRUE, TRUE,FALSE);
		}
		
		if(recall_channel != P_INVALID_ID)
		{
			api_play_channel(recall_channel, TRUE, TRUE,FALSE);
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);			
		}

		progname_timer = api_start_timer(PROGNAME_TIMER_NAME,PROGNAME_TIMER_TIME,progname_timer_func);
		ShowMuteOnOff();
		ShowPauseOnOff();
#ifdef DVR_PVR_SUPPORT
		ShowRecHintOSDOnOff(GetRecHintState());		
#endif
		break;
	case EVN_PRE_CLOSE:
		break;
	case EVN_POST_CLOSE:
		api_stop_timer(&progname_timer);
        sys_data_save(1);
        api_dec_wnd_count();
		if(b_popdetail)
		{
#if 0//def DVR_PVR_SUPPORT
			if(pvr_info.hdd_valid && (ap_pvr_set_state() != PVR_STATE_IDEL))
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_pvr_ctrl, TRUE);
			else
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_progdetail, TRUE);				
#else
			ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&g_win_progdetail, TRUE);
#endif
		}
		break;
	case EVN_PRE_DRAW:
		break;
	case EVN_POST_DRAW:
#ifdef MODIFY_FOR_EGYPT_CUSTOMER
		win_progname_draw_bmp();
#endif
		win_progname_draw_infor();
		break;
	case EVN_UNKNOWNKEY_GOT:
		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;	
}
Beispiel #13
0
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
	}
}
Beispiel #14
0
void cti_chnchg_function()
{
	UINT16 chn_idx=0xffff;
	date_time local_time;
	CTI_CHN_CHG_CONTENT chnchg_data;
	UINT8 save;
	BOOL need_change = TRUE,info_changed = FALSE;
	win_popup_choice_t sel;
	UINT16 string[CHANNEL_JUMP_STR_LEN_MAX/2+1];

	INT sec = 0;
	if(pre_channel_index!=sys_data_get_cur_group_cur_mode_channel())//换台了
	{
		cti_chnchg_para_reset();
	}

	if(!get_cti_chnchg_flg())
	{
		return;
	}

	MEMSET(&local_time,0,sizeof(date_time));
	get_local_time(&local_time);

	MEMSET(&chnchg_data,0,sizeof(CTI_CHN_CHG_CONTENT));
	get_cti_chnchg_data(&chnchg_data);

	//显示内容有没有变化
	if(MEMCMP(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString))==0)
	{
		info_changed = FALSE;
	}
	else
	{
		info_changed = TRUE;
	}

	chn_idx=GetPlayChannelID(chnchg_data.bType,chnchg_data.wPart1,
							chnchg_data.wPart2,chnchg_data.wPart3,chnchg_data.wPart4);

	if((chnchg_data.bStatus==0)
		||(chnchg_data.bStatus==2))//立即跳转
	{
		set_cti_chnchg_flg(FALSE);
	}
	else//时间跳转
	{
		if(api_compare_day_time_ext(&(chnchg_data.stStartTime),&local_time)>=0)	//跳转时间没有到
		{
			need_change = FALSE;
		}
		else if(api_compare_day_time_ext(&(chnchg_data.stEndTime),&local_time)>=0)	//正常跳转
		{
			sec = cti_mktime(&(chnchg_data.stEndTime),&local_time);
		}
		else//控制时间已过
		{
			need_change = FALSE;
			set_cti_chnchg_flg(FALSE);
			return;
		}
	}

	if((chn_idx!=0xffff)
		&&(chn_idx!=sys_data_get_cur_group_cur_mode_channel())
		&&need_change)
	{

		if(chnchg_data.bStatus==0)//强制立即跳转
		{
			BackToFullScrPlay();
			win_compopup_init ( WIN_POPUP_TYPE_SMSG );
			win_compopup_set_frame ( 100, 140, 400, 120);
			//win_compopup_set_frame(100, 180, 400, 80);
			win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
			win_compopup_open_ext ( &save );
			osal_task_sleep(3000);
			win_compopup_close();
		}
		else if(chnchg_data.bStatus==1)//强制时间跳转
		{
			if(!info_showed)
			{
				BackToFullScrPlay();
				win_compopup_init ( WIN_POPUP_TYPE_SMSG );
				win_compopup_set_frame ( 100, 140, 400, 120);
				//win_compopup_set_frame(100, 180, 400, 80);
				win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
				win_compopup_open_ext ( &save );
				osal_task_sleep(3000);
				win_compopup_close();
				info_showed = TRUE;
			}
		}
		else if(chnchg_data.bStatus==2)//用户选择立即跳转
		{
			if((sys_data_get_cur_group_cur_mode_channel()==chn_idx_sel_no)
				&&(!info_changed))
			{
				return;
			}
			else
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);				
				//win_compopup_set_frame ( 100, 120, 400, 160);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, 5);
				if (sel == WIN_POP_CHOICE_NO)
				{
					chn_idx_sel_no = sys_data_get_cur_group_cur_mode_channel();
					return;//do not change
				}	
				//choice yes,so change channel
			}
		}
		else if(chnchg_data.bStatus==3)//用户选择按时间跳转
		{
			if((!info_showed)||info_changed)//没有显示过或者字符变化了
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT				
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, sec);
				choiced_yes = FALSE;
				info_showed = TRUE;
				if ((sel == WIN_POP_CHOICE_NO) || (sel == WIN_POP_CHOICE_TIMEOUT))
				{
					return;//do not change
				}	
				choiced_yes = TRUE;
			}
			else if(choiced_yes==TRUE)//用户选择yes,则继续判断是否需要跳转
			{

			}
			else
			{
				return;//提示过,不再提醒,也不换台
			}

		}

		api_play_channel(chn_idx, TRUE, TRUE, FALSE);
	}
}
Beispiel #15
0
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;

}
Beispiel #16
0
static PRESULT favgrplst_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;

	switch(event)
	{
	case EVN_PRE_OPEN:

#ifdef EXIT_KEY_EXIT_ALL_MENU
	         exit_key_flag =  FALSE;
#endif
		
#ifdef PREVIEW_SUBMENU
#if 1//def OSD_BLACKBERRY
		api_full_screen_play();
		//mm_enter_stop_mode(FALSE);
		if(RADIO_CHAN==sys_data_get_cur_chan_mode())
		{
			//api_show_menu_logo();
			api_play_channel(get_prog_pos(play_chan_id), TRUE, TRUE/*edit_group== NOMAL_GRP*/,FALSE);
		}
#else
		api_full_screen_play();
		mm_enter_stop_mode(FALSE);
		api_show_menu_logo();
#endif
		if((param2 & MENU_OPEN_TYPE_MASK) == MENU_OPEN_TYPE_OTHER)
			preview_menu=1;
		else
			preview_menu=0;
#endif	
		
		wincom_open_subtitle(pObj,RS_FAVORITE,0);
		break;
	case EVN_POST_OPEN:
#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
		wincom_open_commen_help(pObj);
		//wincom_open_help(pObj,fav_group_helpinfo, HELP_CNT);
#else
		//wincom_open_commen_help(pObj);
		wincom_open_help(pObj,fav_group_helpinfo, HELP_CNT);
#endif
		break;
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
		sys_data_save(1);
		break;
	case EVN_POST_CLOSE:
  		wincom_close_subtitle();
		//OSD_ClearObject((POBJECT_HEAD)&g_win_favgrplst,C_UPDATE_ALL);//albert.li add
		//OSD_TrackObject( (POBJECT_HEAD) &g_win_submenu/*g_win_mainmenu*/, C_UPDATE_ALL);//albert.li

#ifdef EXIT_KEY_EXIT_ALL_MENU
	        if( exit_key_flag == TRUE)
	        	{
 			 exit_key_flag =FALSE;
			mm_leave_all_menu();
		}
#endif
		break;
	}

	return ret;
}
Beispiel #17
0
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
}
Beispiel #18
0
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;

}