Example #1
0
static PRESULT subtitle_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	SYSTEM_DATA * sys;
	struct nim_device* nim_dev;	
	UINT8 i,lock;
	UINT8 unact;
	
	if(cur_tuner_idx == 0)
		nim_dev = g_nim_dev;
	else
		nim_dev = g_nim_dev2;
    	nim_get_lock(nim_dev,&lock);

	switch(event)
	{
	case EVN_PRE_OPEN:
        api_set_deo_layer(0);
        api_inc_wnd_count();

		for(i=0;i<SUBTITLE_ITEM_NUMBER;i++)
		{
			p_subtitle_track_str[i]=Subtitle_track_str[i];
			p_subtitle_track_idx[i]=Subtitle_track_idx[i];
		}
		win_subtitle_init_data();
		if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) || (!lock))
#if (DVR_PVR_SUPPORT_SUBTITLE)//temp disable
		if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) 
#ifdef DVR_PVR_SUPPORT
			|| ((!lock) && !api_pvr_is_playing())
#else
			|| (!lock)
#endif
			)
#endif
		{
			win_com_popup_open(WIN_POPUP_TYPE_SMSG,NULL, RS_DISPLAY_NO_DATA);			
			osal_task_sleep(1000);
			win_compopup_close();
            api_dec_wnd_count();
			return PROC_LEAVE;
		}
		break;		
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(VACT_ENTER == unact)
		{
			UINT16	cur_sel = OSD_GetListCurPoint(&g_ls_subtitle);
			sys = sys_data_get();
			if(g_win_subtitle_count + g_win_ttx_subtitle_count==cur_sel)
			{
				sys->osd_set.subtitle_display = 0;/*select off option*/
				sys->osd_set.subtitle_lang = 0xFF;
			}
			else if(cur_sel < g_win_ttx_subtitle_count)
			{
				sys->osd_set.subtitle_display = 1;/*subtitle on*/
				sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
			}
			else if(cur_sel < g_win_subtitle_count + g_win_ttx_subtitle_count)
			{/*ttx_subtitle on the top then normal subtitle*/
				sys->osd_set.subtitle_display = 1;
				sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
			}
			ret = PROC_LEAVE;
			api_osd_mode_change(OSD_NO_SHOW);
			//api_osd_mode_change(OSD_SUBTITLE);
		}
		break;
	case EVN_PRE_CLOSE:
		unact = (VACTION)(param1>>16);
		ret = PROC_PASS;
        break;

	case EVN_POST_CLOSE:
        api_set_deo_layer(1);
        api_dec_wnd_count();
        break;
	default:
		break;
	}

	return ret;
}
Example #2
0
static PRESULT subtitle_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	SYSTEM_DATA * sys;
	struct nim_device* nim_dev;	
	UINT8 i,lock;
	UINT8 unact;
	
	if(cur_tuner_idx == 0)
		nim_dev = g_nim_dev;
	else
		nim_dev = g_nim_dev2;
    	nim_get_lock(nim_dev,&lock);

	switch(event)
	{
	case EVN_PRE_OPEN:
        #ifdef SUPPORT_CAS9
			if(0==get_mmi_showed())
				ShowSignalStatusOSDOnOff(0);
        #endif
        api_set_deo_layer(0);
        api_inc_wnd_count();

		for(i=0;i<SUBTITLE_ITEM_NUMBER;i++)
		{
			p_subtitle_track_str[i]=Subtitle_track_str[i];
			p_subtitle_track_idx[i]=Subtitle_track_idx[i];
		}

		if(system_state != SYS_STATE_USB_MP)//vic100507#1	
		{
			win_subtitle_init_data();
			if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) || (!lock))
			#if (DVR_PVR_SUPPORT_SUBTITLE)//temp disable
			if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) 
			#ifdef DVR_PVR_SUPPORT
				|| ((!lock) && !api_pvr_is_playing())
			#else
				|| (!lock)
			#endif
				)
			#endif
			{
				win_com_popup_open(WIN_POPUP_TYPE_SMSG,NULL, RS_DISPLAY_NO_DATA);			
				osal_task_sleep(1000);
				win_compopup_close();
	            api_dec_wnd_count();
				return PROC_LEAVE;
			}
		}
		else
		{
		#ifdef MP_SUBTITLE_SUPPORT	//vic100507#1			
			//TODO:
			//such like win_subtitle_init_data
			long resut;
			resut = win_mp_subtitle_init_data();
			if (resut < 0)
			{						
				return PROC_LEAVE;				
			}
			
		#endif				
		}
		break;		
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);

		if(system_state != SYS_STATE_USB_MP)//vic100507#1 
		{

			if(VACT_ENTER == unact)
			{
				UINT16	cur_sel = OSD_GetListCurPoint(&g_ls_subtitle);
				sys = sys_data_get();
				if(g_win_subtitle_count + g_win_ttx_subtitle_count==cur_sel)
				{
					sys->osd_set.subtitle_display = 0;/*select off option*/
					sys->osd_set.subtitle_lang = 0xFF;
				}
				else if(cur_sel < g_win_ttx_subtitle_count)
				{
					sys->osd_set.subtitle_display = 1;/*subtitle on*/
					sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
				}
				else if(cur_sel < g_win_subtitle_count + g_win_ttx_subtitle_count)
				{/*ttx_subtitle on the top then normal subtitle*/
					sys->osd_set.subtitle_display = 1;
					sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
				}
				ret = PROC_LEAVE;
				api_osd_mode_change(OSD_NO_SHOW);
				//api_osd_mode_change(OSD_SUBTITLE);
			}
		}
		else if(VACT_ENTER == unact)
		{
		//vic100507#1 begin
		#ifdef MP_SUBTITLE_SUPPORT	
			//TODO:
			//select language index
			if (!subtitle_handle)
			{
				return PROC_LEAVE;
			}
			long resut;
			UINT16	cur_sel = OSD_GetListCurPoint(&g_ls_subtitle);

			if(g_ext_subtitle_plugin)
				g_ext_subtitle_plugin->mps_change_language(subtitle_handle,cur_sel);
			
			OSD_ObjClose(pObj,C_CLOSE_CLRBACK_FLG);
			//if (resut < 0)
			{
				return PROC_LEAVE;
			}			
		#endif					
		//vic100507#1 end
		}
		break;
	case EVN_PRE_CLOSE:
		unact = (VACTION)(param1>>16);
		ret = PROC_PASS;
        break;

	case EVN_POST_CLOSE:
        #ifdef SUPPORT_CAS9
            restore_ca_msg_when_exit_win();
        #endif
        api_set_deo_layer(1);
        api_dec_wnd_count();
        break;
	default:
		break;
	}

	return ret;
}