Ejemplo n.º 1
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
	}
}
Ejemplo n.º 2
0
static PRESULT tms_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT32 i;
	BOOL subt_flag;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
    char new_volume[16];
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		wincom_open_subtitle((POBJECT_HEAD)&g_win_timeshift,RS_DVR_CONFIGURATION, 0);
		win_tms_set_string(sys_data_get_tms(),&tms_item_txtset1);
		win_tms_set_string(sys_data_get_tms2rec(),&tms_item_txtset2);		
        win_set_rec_type_string(sys_data_get_rec_type(),&tms_item_txtset3);        
#if (defined(MULTI_PARTITION_SUPPORT) && !defined(DISK_MANAGER_SUPPORT))		
		win_pvr_vol_init();
        win_set_vol_string(&tms_item_txtset4);
#endif
		tms_set_tms2rec_item_active(FALSE);
#ifdef NEW_DEMO_FRAME
		OSD_SetContainerFocus(&g_win_timeshift, 4);
		remove_menu_item((POBJECT_HEAD)&g_win_timeshift, (OBJECT_HEAD *)&tms_item_con1, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&g_win_timeshift, (OBJECT_HEAD *)&tms_item_con2, CON_H + CON_GAP);
		remove_menu_item((POBJECT_HEAD)&g_win_timeshift, (OBJECT_HEAD *)&tms_item_con3, CON_H + CON_GAP);
#else
		OSD_SetContainerFocus(&g_win_timeshift, 1);
#endif
		break;
	
	case EVN_POST_OPEN:
#if(defined(MULTI_PARTITION_SUPPORT) && !defined(DISK_MANAGER_SUPPORT))
		win_pvr_vol_invalid_msg();
#endif
		break;
		
	case EVN_PRE_CLOSE:
        *((UINT32 *)param2) &= ~C_CLOSE_CLRBACK_FLG;
#if (defined(MULTI_PARTITION_SUPPORT) && !defined(DISK_MANAGER_SUPPORT))
		win_pvr_vol_save();
#endif
		sys_data_save(1);
		break;

	case EVN_POST_CLOSE:
		break;
    case EVN_UNKNOWN_ACTION:
        if (api_pvr_is_record_active())
            break;
        if (sys_data_get_tms() == 0)
        {
            win_popup_choice_t choice;
            UINT8 back_saved;

            win_compopup_init(WIN_POPUP_TYPE_OKNO);
            win_compopup_set_msg(NULL, NULL, RS_ARE_YOU_SURE_TO_ENTER_RECORD_TP_MODE);
            if (pvr_r_get_record_all())
                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
            else
                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
            choice = win_compopup_open_ext(&back_saved);
            if(choice == WIN_POP_CHOICE_YES)
            {
                pvr_r_set_record_all(TRUE);
            }   
            else if (choice == WIN_POP_CHOICE_NO)
            {
                pvr_r_set_record_all(FALSE);
            }

        }
		else
		{
#ifdef PVR3_SUPPORT
            win_popup_choice_t choice;
            UINT8 back_saved;

            win_compopup_init(WIN_POPUP_TYPE_OKNO);
            win_compopup_set_msg(NULL, NULL, RS_CONTINUE_TMS_SUPPORT);
            if (pvr_r_get_record_all())
                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
            else
                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
            choice = win_compopup_open_ext(&back_saved);
            if(choice == WIN_POP_CHOICE_YES)
            {
                pvr_info.continue_tms = 1;
            }   
            else
            {
                pvr_info.continue_tms = 0;
            }
#endif
		}
       {
            win_popup_choice_t choice;
            UINT8 back_saved;

            win_compopup_init(WIN_POPUP_TYPE_OKNO);
            win_compopup_set_msg(NULL, NULL, RS_RECORD_CA_PROGRAM_IN_DESCRAMBLED_FORMAT);
            if (sys_data_get_scramble_record_mode())
                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
            else
                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
            choice = win_compopup_open_ext(&back_saved);
            if (choice == WIN_POP_CHOICE_YES)
            {
                sys_data_set_scramble_record_mode(0);
            }
            else if (choice == WIN_POP_CHOICE_NO)
            {
                sys_data_set_scramble_record_mode(1);
                pvr_r_set_scramble();
            }
        }
        break;
	}
	return ret;
}
Ejemplo n.º 3
0
void win_pvr_setting_right_key(POBJECT_HEAD pObj,UINT8 id)
{
	SYSTEM_DATA* p_sys_data=sys_data_get();
	UINT8 input;
	struct dvr_HDD_info hdd_info;	
	
	switch(id)
	{
		case MENU_PVR_SETTING_TIMESHIFT:
			sys_data_set_tms(!sys_data_get_tms());
			win_pvr_setting_timeshift_set_string(sys_data_get_tms());
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			if (sys_data_get_tms())
			{
				api_pvr_adjust_tms_space();
				if (pvr_get_HDD_info(&hdd_info) && (hdd_info.tms_size == 0))
				{
					pvr_set_tms_size(hdd_info.free_size); // set free space to tms
					pvr_get_HDD_info(&hdd_info);
				}
			}
			else
			{
				pvr_set_tms_size(0);
				pvr_get_HDD_info(&hdd_info);
			}
			api_pvr_check_level(&hdd_info);
			break;
		case MENU_PVR_SETTING_JUMP:
			input = sys_data_get_jumpstep();	
			input = (input+1)%5;
			sys_data_set_jumpstep(input);
			win_pvr_setting_jumpstep_set_string(input);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_PVR_SETTING_SCRAMBLE_MODE:
			input = sys_data_get_scramble_record_mode();	
			input = !input;
			sys_data_set_scramble_record_mode(input);
			pvr_r_set_scramble_ext(!input);
			win_pvr_setting_scramble_record_mode_set_string(input);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_PVR_SETTING_TS_FILE_SIZE:
			input = sys_data_get_record_ts_file_size();	
			input = (input+1)%4;
			sys_data_set_record_ts_file_size(input);
			win_pvr_setting_ts_file_size_set_string(input);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_PVR_SETTING_TMS_2_REC:
			sys_data_set_tms2rec(!sys_data_get_tms2rec());
			win_pvr_setting_tms2rec_set_string(sys_data_get_tms2rec());
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_PVR_SETTING_TTX_SUBT:
			input = sys_data_get_record_ttx_subt();	
			input = !input;
			sys_data_set_record_ttx_subt(input);
			win_pvr_setting_ttx_subt_set_string(input);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_PVR_SETTING_REC_NUM:
			sys_data_set_rec_num(3 - sys_data_get_rec_num());
			win_pvr_setting_rec_num_set_string(sys_data_get_rec_num());
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_PVR_SETTING_REC_PS:
			sys_data_set_rec_ps(!sys_data_get_rec_ps());
			win_pvr_setting_record_ps_set_string(sys_data_get_rec_ps());
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		default:
			break;
	}
}
Ejemplo n.º 4
0
static PRESULT pvr_setting_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT32 i;
	BOOL subt_flag;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	static UINT8 preval;
	SYSTEM_DATA* p_sys_data;
	
	switch(event)
	{
		case EVN_PRE_OPEN:
			wincom_open_title((POBJECT_HEAD)&win_osdset_con, RS_PVR_SETTING, 0);
			p_sys_data=sys_data_get();
			win_pvr_setting_timeshift_set_string(p_sys_data->timeshift);
			win_pvr_setting_jumpstep_set_string(p_sys_data->jumpstep);
			win_pvr_setting_scramble_record_mode_set_string(p_sys_data->scramble_record_mode);
            remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con3, CON_H + CON_GAP);
			win_pvr_setting_ts_file_size_set_string(p_sys_data->record_ts_file_size);
			remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con4, CON_H + CON_GAP);
			win_pvr_setting_tms2rec_set_string(p_sys_data->tms2rec);			
			win_pvr_setting_ttx_subt_set_string(p_sys_data->record_ttx_subt);
			remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con6, CON_H + CON_GAP);
			win_pvr_setting_rec_num_set_string(p_sys_data->rec_num);
			remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con7, CON_H + CON_GAP);
#ifdef NEW_DEMO_FRAME
			win_pvr_setting_record_ps_set_string(p_sys_data->rec_ps_enable);
#else
			remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con8, CON_H + CON_GAP);
#endif
			break;
		case EVN_POST_OPEN:
			break;			
		case EVN_PRE_CLOSE:
       		*((UINT32 *)param2) &= ~C_CLOSE_CLRBACK_FLG;
			p_sys_data=sys_data_get();
			sys_data_save(1);
#ifndef PVR3_SUPPORT
			pvr_r_set_ts_file_size(p_sys_data->record_ts_file_size + 1);
#endif
			//api_pvr_jumpstep_trans();
			break;
		case EVN_POST_CLOSE:
			break;
        case EVN_UNKNOWN_ACTION:
            if (api_pvr_is_record_active())
                break;
            
            win_popup_choice_t choice;
            UINT8 back_saved;

            win_compopup_init(WIN_POPUP_TYPE_OKNO);
            win_compopup_set_msg("Record CA program in descrambled format?", NULL, 0);
            if (sys_data_get_scramble_record_mode())
                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
            else
                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
            choice = win_compopup_open_ext(&back_saved);
            if (choice == WIN_POP_CHOICE_YES)
            {
                sys_data_set_scramble_record_mode(1);
                pvr_r_set_scramble_ext(0);
            }
            else if (choice == WIN_POP_CHOICE_NO)
            {
                sys_data_set_scramble_record_mode(0);
                pvr_r_set_scramble_ext(1);
            }
            break;
	}
	
	return ret;
}
Ejemplo n.º 5
0
static PRESULT pvr_setting_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT32 i;
	BOOL subt_flag;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	static UINT8 preval;
	SYSTEM_DATA* p_sys_data;
	
	switch(event)
	{
		case EVN_PRE_OPEN:
#ifdef EXIT_KEY_EXIT_ALL_MENU
	         exit_key_flag =  FALSE;
#endif
			wincom_open_subtitle((POBJECT_HEAD)&win_osdset_con, RS_PVR_SETTING, 0);
			p_sys_data=sys_data_get();
			win_pvr_setting_timeshift_set_string(p_sys_data->timeshift);
			win_pvr_setting_jumpstep_set_string(p_sys_data->jumpstep);
			win_pvr_setting_scramble_record_mode_set_string(p_sys_data->scramble_record_mode);
            remove_menu_item(&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con3, CON_H + CON_GAP);
			win_pvr_setting_ts_file_size_set_string(p_sys_data->record_ts_file_size);
			remove_menu_item(&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con4, CON_H + CON_GAP);
			win_pvr_setting_tms2rec_set_string(p_sys_data->tms2rec);			
			win_pvr_setting_ttx_subt_set_string(p_sys_data->record_ttx_subt);
			remove_menu_item(&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con6, CON_H + CON_GAP);
			win_pvr_setting_rec_num_set_string(p_sys_data->rec_num);
			remove_menu_item(&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con7, CON_H + CON_GAP);
#ifdef NEW_DEMO_FRAME
			win_pvr_setting_record_ps_set_string(p_sys_data->rec_ps_enable);
	#ifdef SUPPORT_CAS9
			remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con5, CON_H + CON_GAP);
			remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con8, CON_H + CON_GAP);
	#endif
#else
			remove_menu_item((POBJECT_HEAD)&g_win_pvr_setting, (OBJECT_HEAD *)&pvr_setting_item_con8, CON_H + CON_GAP);
#endif
#ifdef PREVIEW_SUBMENU  //-a by wangyang 
{
				
			POBJECT_HEAD focusObj=OSD_GetFocusObject(pObj);
			
			if(param2==MENU_OPEN_TYPE_OTHER)
			{
				pvr_setting_item_set[focusObj->bID-1]->style.bHLIdx=TXTS_SH_IDX;
				pvr_setting_item_name[focusObj->bID-1]->style.bHLIdx=TXTN_SH_IDX;
			}
			else
			{
				pvr_setting_item_set[focusObj->bID-1]->style.bHLIdx=TXTS_HL_IDX;
				pvr_setting_item_name[focusObj->bID-1]->style.bHLIdx=TXTN_HL_IDX;
			}

}
#endif

			break;
		case EVN_POST_OPEN:
		wincom_open_commen_help(pObj);//-a by wangyang 
			break;			
		case EVN_PRE_CLOSE:
       		*((UINT32 *)param2) &= ~C_CLOSE_CLRBACK_FLG;
			p_sys_data=sys_data_get();
			sys_data_save(1);
#ifndef PVR3_SUPPORT
			pvr_r_set_ts_file_size(p_sys_data->record_ts_file_size + 1);
#endif
			//api_pvr_jumpstep_trans();
			break;
		case EVN_POST_CLOSE:
	  		wincom_close_subtitle();
			OSD_ClearScreen();
#ifdef EXIT_KEY_EXIT_ALL_MENU
	        if( exit_key_flag == TRUE)
	        	{
 			 exit_key_flag =FALSE;
			mm_leave_all_menu();
		}
#endif
			//OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
			break;
		#ifdef PREVIEW_SUBMENU  //-a by wangyang 
  		case EVN_MSG_GOT:
			if (param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
			{
				//system_state = SYS_STATE_NORMAL;
				wincom_close_subtitle();
				OSD_ClearScreen();
				//wincom_close_help();
				OSD_ClearObject( pObj, C_UPDATE_ALL);
				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 );
				ret = PROC_LEAVE;
			}
			break;		
		#endif
      case EVN_UNKNOWN_ACTION:
            if (api_pvr_is_record_active())
                break;
            
            win_popup_choice_t choice;
            UINT8 back_saved;

#ifndef CI_PLUS_PVR_SUPPORT
			if (sys_data_get_tms() == 0)
			{
				win_popup_choice_t choice;
				UINT8 back_saved;			
				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_msg("Are you sure to enter record TP mode?", NULL, 0);
				if (pvr_r_get_record_all())
					win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				else
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
				choice = win_compopup_open_ext(&back_saved);
				if(choice == WIN_POP_CHOICE_YES)
				{
					pvr_r_set_record_all(TRUE);
				}	
				else if (choice == WIN_POP_CHOICE_NO)
				{
					pvr_r_set_record_all(FALSE);
				}
			
			}
			else
#endif
			{
	            win_compopup_init(WIN_POPUP_TYPE_OKNO);
	            win_compopup_set_msg("Record CA program in descrambled format?", NULL, 0);
	            if (sys_data_get_scramble_record_mode())
	                win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
	            else
	                win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
	            choice = win_compopup_open_ext(&back_saved);
	            if (choice == WIN_POP_CHOICE_YES)
	            {
	                sys_data_set_scramble_record_mode(1);
	                pvr_r_set_scramble_ext(0);
	            }
	            else if (choice == WIN_POP_CHOICE_NO)
	            {
	                sys_data_set_scramble_record_mode(0);
	                pvr_r_set_scramble_ext(1);
	            }
			}
            break;
	}
	
	return ret;
}