Example #1
0
static PRESULT	win_progname_message_proc(UINT32 msg_type, UINT32 msg_code)
{
	PRESULT ret = PROC_LOOP;

	switch(msg_type)
	{
	case CTRL_MSG_SUBTYPE_CMD_EPG_PF_UPDATED:
		event_update=TRUE;
		osal_flag_clear(epg_flag, EPG_MSG_FLAG_PF);
	case CTRL_MSG_SUBTYPE_CMD_EPG_SCH_UPDATED:
	case CTRL_MSG_SUBTYPE_CMD_TIMEDISPLAYUPDATE:
	case CTRL_MSG_SUBTYPE_STATUS_SIGNAL:		
		win_progname_redraw();
		event_update=FALSE;
		if(msg_type==CTRL_MSG_SUBTYPE_STATUS_SIGNAL)
		{
			ret = PROC_PASS;
		}
		else if(msg_type==CTRL_MSG_SUBTYPE_CMD_EPG_SCH_UPDATED)
		{
			osal_flag_clear(epg_flag, EPG_MSG_FLAG_SCH);
		}
		break;
	case CTRL_MSG_SUBTYPE_CMD_EXIT:
		if(sys_data_get_cur_chan_mode() == TV_CHAN)
			ret = PROC_LEAVE;
		break;
	default:
		ret = PROC_PASS;
	}

	return ret;
}
Example #2
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);
}
Example #3
0
static PRESULT win_progname_message_proc(UINT32 msg_type, UINT32 msg_code)
{
	PRESULT ret = PROC_LOOP;

	switch (msg_type)
	{
		case CTRL_MSG_SUBTYPE_CMD_EPG_PF_UPDATED:
			//	case CTRL_MSG_SUBTYPE_CMD_EPG_SCH_UPDATED:
		case CTRL_MSG_SUBTYPE_CMD_TIMEDISPLAYUPDATE:
		case CTRL_MSG_SUBTYPE_STATUS_SIGNAL:
			if (msg_type == CTRL_MSG_SUBTYPE_CMD_EPG_PF_UPDATED)
			{
				event_update = TRUE;
				win_progname_redraw(TRUE);
			}
			else
				event_update = FALSE;
			
			if (msg_type == CTRL_MSG_SUBTYPE_STATUS_SIGNAL)
				ret = PROC_PASS;
			break;
		case CTRL_MSG_SUBTYPE_CMD_EXIT:
			if (sys_data_get_cur_chan_mode() == TV_CHAN)
				ret = PROC_LEAVE;
            else if(sys_data_get_cur_chan_mode() == RADIO_CHAN)
            {
            //to avoid the temporary stop when fast change Radio program channel 
            	sys_data_save(1);  
            }

			break;
		case CTRL_MSG_SUBTYPE_STATUS_SCROLL_STRING:
			win_progname_scroll_string();
			break;
		default:
			ret = PROC_PASS;
	}

	return ret;
}
Example #4
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;
}
Example #5
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
	}
}
Example #6
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
}
Example #7
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;

}