Пример #1
0
long win_mp_subtitle_init_data()
{
	long			ret = -1;
	long			number;
	long			current_language_index;
	UINT16 lst_top,list_cnt;
	UINT8 sel_lang = 0xFF;

	if (!subtitle_handle)
	{
		return -1;
	}

	if(g_ext_subtitle_plugin)
		ret = g_ext_subtitle_plugin->mps_query_language(subtitle_handle, &number, &current_language_index, NULL, NULL);
	
	if (ret < 0)
	{
		return -1;
	}
	
	list_cnt =  number;
	OSD_SetListCount(&g_ls_subtitle, list_cnt);


	OSD_SetListCurPos(&g_ls_subtitle, current_language_index);
	OSD_SetListTop(&g_ls_subtitle, current_language_index);
	
	OSD_SetListVerScrollBar(&g_ls_subtitle, &g_sb_subtitle);
	
	lst_top = OSD_GetListTopPoint(&g_ls_subtitle);
	ret = win_mp_subtitle_read_page(lst_top);
	return ret;
}
Пример #2
0
/*****************************************************
Interface : void ListChapterInfoInit();
Function  : init chapter list
Author    : Wu Jianwen
Date      : 2010.8.25
Input     : NONE
Output    : NONE
Return    : NONE
******************************************************/
void ListChapterInfoInit()
{
	UINT16 top;
	UINT32 i_TotalChapter = 0;      //the total chapter of the video
	INT32 i_DestChapter = 0;        //dest chapter num
    INT32 i_CurChapter = 1;         //current chapter num
	DEC_CHAPTER_INFO t_ChapterInfo; //save chapter info of the stream

	MEMSET(&t_ChapterInfo,0,sizeof(DEC_CHAPTER_INFO));
	t_ChapterInfo.dst_chapter = -1;
	MpgFileGetChapterInfo(&t_ChapterInfo);   //get the current chapter info 
	i_CurChapter = t_ChapterInfo.cur_chapter;   //begin with chapter
	i_TotalChapter = t_ChapterInfo.nb_chapter;

	OSD_SetListCount(&g_ls_chapter, i_TotalChapter);
	OSD_SetListCurPos(&g_ls_chapter, i_CurChapter);
	OSD_SetListTop(&g_ls_chapter, i_CurChapter);
	OSD_SetListVerScrollBar(&g_ls_chapter, &g_sb_chapter);
	
	top = OSD_GetListTopPoint(&g_ls_chapter);
	GetListChapterInfo(top);
}
Пример #3
0
void win_subtitle_init_data()
{
	P_NODE	p_node;
	UINT16 lst_top,list_cnt;
	UINT8 sel_lang = 0xFF;
	SYSTEM_DATA* sys_data = sys_data_get();
	
	TTXEng_GetSubtLang(&ttx_sub_lang_list, &g_win_ttx_subtitle_count);
	subt_get_language(&sub_lang_list, &g_win_subtitle_count);
	
	list_cnt =  (g_win_subtitle_count + g_win_ttx_subtitle_count + 1);
	OSD_SetListCount(&g_ls_subtitle, list_cnt);
	
	if(sys_data->osd_set.subtitle_display == 0)/*subtitle off,select the last item*/
	{
		OSD_SetListCurPos(&g_ls_subtitle, (list_cnt - 1));
		if(list_cnt > SUBTITLE_ITEM_NUMBER)
			OSD_SetListTop(&g_ls_subtitle, (list_cnt - SUBTITLE_ITEM_NUMBER));
		else
			OSD_SetListTop(&g_ls_subtitle, 0);
	}
	else if(sys_data->osd_set.subtitle_lang == 0xFF)/*set_sub_lang_idx can only be set in subtitle pop-up*/
	{/*if first init,or reset*/
		sel_lang = 0xFF;
#if (SUBTITLE_ON == 1)
		sel_lang = api_ttxsub_getlang(NULL,sub_lang_list,sys_data->lang.sub_lang,g_win_subtitle_count);
		if(sel_lang != 0xFF)
		{
			sel_lang = sel_lang + g_win_ttx_subtitle_count;
		}/*subtitle language select first*/
#endif

#if (TTX_ON ==1)			
		if(sel_lang == 0xFF)
		{	
			sel_lang = api_ttxsub_getlang(ttx_sub_lang_list,NULL,sys_data->lang.sub_lang,g_win_ttx_subtitle_count);				
		}/*if can not get subt lang_idx,to get ttx_subt lang_idx*/
#endif
		if(sel_lang != 0xFF)/*If sel_lang valid,set to corresponding item highlight*/
		{
			OSD_SetListCurPoint(&g_ls_subtitle, sel_lang);
			//OSD_SetListTopPoint(&g_ls_subtitle, sel_lang);
			if(sel_lang > (SUBTITLE_ITEM_NUMBER - 1))
				OSD_SetListTop(&g_ls_subtitle, (sel_lang - SUBTITLE_ITEM_NUMBER + 1));
			else
				OSD_SetListTop(&g_ls_subtitle, 0);
		}
		else/*if sel_lang invalid,set to 0 position*/
		{
			OSD_SetListCurPoint(&g_ls_subtitle, 0);
			OSD_SetListTopPoint(&g_ls_subtitle, 0);
		}
	}
	else
	{
		OSD_SetListCurPoint(&g_ls_subtitle, sys_data->osd_set.subtitle_lang); 
	        if(sys_data->osd_set.subtitle_lang > (SUBTITLE_ITEM_NUMBER - 1))
			OSD_SetListTop(&g_ls_subtitle, (sys_data->osd_set.subtitle_lang - SUBTITLE_ITEM_NUMBER + 1));
		else
			OSD_SetListTop(&g_ls_subtitle, 0);
	}

	OSD_SetListVerScrollBar(&g_ls_subtitle, &g_sb_subtitle);
	
	lst_top = OSD_GetListTopPoint(&g_ls_subtitle);
	win_subtitle_read_page(lst_top);
}