long win_mp_subtitle_read_page(UINT8 top) { long i, j; long ret = -1; long number; long current_language_index; char description[201] = {0}; long description_len; char *temp; if (!subtitle_handle) { return -1; } number = 0; description_len = 200; if(g_ext_subtitle_plugin) ret = g_ext_subtitle_plugin->mps_query_language(subtitle_handle, &number, ¤t_language_index, description, &description_len); if (ret < 0) { return -1; } if(top > number) { top = 0; OSD_SetListCurPos(&g_ls_subtitle,0); OSD_SetListTop(&g_ls_subtitle,0); } for(i = 0;i < SUBTITLE_ITEM_NUMBER;i++) { if((top+i) < number) { temp = description + (top+i)*4; Subtitle_track_str[i][0]=temp[0]; Subtitle_track_str[i][1]=temp[1]; Subtitle_track_str[i][2]=temp[2]; Subtitle_track_str[i][3]=0; Subtitle_track_str[i][4]=0; Subtitle_track_str[i][5]=0; Subtitle_track_str[i][6]=0; ComUniStrToMB(Subtitle_track_str[i]); win_com_set_idx_str(top+i, Subtitle_track_idx[i], 2); } else { Subtitle_track_idx[i][0]=0; Subtitle_track_str[i][0]=0; } } return 1; }
void win_subtitle_read_page(UINT8 top) { UINT8 i,ttx_idx,subt_idx; struct t_subt_lang* p_lang; struct t_ttx_lang* p_ttx_lang; p_lang = sub_lang_list; p_ttx_lang = ttx_sub_lang_list; if(top > (g_win_ttx_subtitle_count + g_win_subtitle_count + 1)) { top = 0;/*if top value overflow,set it to zero*/ OSD_SetListCurPos(&g_ls_subtitle,0); OSD_SetListTop(&g_ls_subtitle,0); } for(i = 0;i < SUBTITLE_ITEM_NUMBER;i++) { if((top+i) < g_win_ttx_subtitle_count) { ttx_idx = (top + i); p_ttx_lang = (ttx_sub_lang_list + ttx_idx); Subtitle_track_str[i][0]=p_ttx_lang->lang[0]; Subtitle_track_str[i][1]=p_ttx_lang->lang[1]; Subtitle_track_str[i][2]=p_ttx_lang->lang[2]; Subtitle_track_str[i][3]='('; Subtitle_track_str[i][4]='T'; Subtitle_track_str[i][5]=')'; Subtitle_track_str[i][6]=0; ComUniStrToMB(Subtitle_track_str[i]); win_com_set_idx_str(top+i, Subtitle_track_idx[i],2); } else if((top+i) < (g_win_ttx_subtitle_count + g_win_subtitle_count)) { subt_idx = (top + i - g_win_ttx_subtitle_count); p_lang = (sub_lang_list + subt_idx); Subtitle_track_str[i][0]=p_lang->lang[0]; Subtitle_track_str[i][1]=p_lang->lang[1]; Subtitle_track_str[i][2]=p_lang->lang[2]; Subtitle_track_str[i][3]='('; Subtitle_track_str[i][4]='D'; Subtitle_track_str[i][5]=')'; Subtitle_track_str[i][6]=0; ComUniStrToMB(Subtitle_track_str[i]); win_com_set_idx_str(top+i, Subtitle_track_idx[i],2); } else if((top+i) == (g_win_ttx_subtitle_count + g_win_subtitle_count)) { Subtitle_track_str[i][0]='O'; Subtitle_track_str[i][1]='F'; Subtitle_track_str[i][2]='F'; Subtitle_track_str[i][3]=0; ComUniStrToMB(Subtitle_track_str[i]); Subtitle_track_idx[i][0]=0; } else { Subtitle_track_idx[i][0]=0; Subtitle_track_str[i][0]=0; } } }
/***************************************************** Interface : void GetListChapterInfo(UINT16 top); Function : set each item's display content of list Author : Wu Jianwen Date : 2010.8.25 Input : top:first item of list Output : NONE Return : NONE ******************************************************/ void GetListChapterInfo(INT16 top) { UINT8 len = 0; UINT8 i = 0; INT32 hh,mm,ss; //start time INT32 hh2,mm2,ss2; //end time UINT8 arr_DataTemp[50]; UINT8 back_saved; INT32 i_TotalChapter = 0; //the total chapter of the video INT32 i_CurChapStartTime = 0; //current chapter start time INT32 i_CurChapEndTime = 0; //current chapter end time INT32 i_DestChapStartTime = 0; //Dest chapter start time INT32 i_DestChapEndTime = 0; //Dest chapter end time INT32 i_DestChapter = 0; //dest chapter num INT32 i_CurChapter = 1; //current chapter num INT32 i_ChapterChange = 0; 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; if(i_TotalChapter > 1) //only chapter num > 1 can switch { if(top > i_TotalChapter) { top = 0; OSD_SetListCurPos(&g_ls_chapter,0); OSD_SetListTop(&g_ls_chapter,0); } i = 0; for(i = 0;i < CHAPTER_ITEM_NUMBER;i++) { i_ChapterChange = top + i; if(i_ChapterChange < i_TotalChapter) { i_DestChapter = i_ChapterChange; t_ChapterInfo.dst_chapter = i_DestChapter; MpgFileGetChapterInfo(&t_ChapterInfo); i_DestChapStartTime = t_ChapterInfo.dst_start_time / 1000; hh = i_DestChapStartTime / 3600; mm = (i_DestChapStartTime % 3600) / 60; ss = i_DestChapStartTime % 60; i_DestChapEndTime = t_ChapterInfo.dst_end_time / 1000; hh2 = i_DestChapEndTime / 3600; mm2 = (i_DestChapEndTime % 3600) / 60; ss2 = i_DestChapEndTime % 60; arr_DataTemp[0] = hh; arr_DataTemp[1] = mm; arr_DataTemp[2] = ss; arr_DataTemp[3] = hh2; arr_DataTemp[4] = mm2; arr_DataTemp[5] = ss2; win_com_set_idx_str2(arr_DataTemp, &Chapter_track_str[i][0],6); win_com_set_idx_str(top+i, Chapter_track_idx[i], 2); } else { //memset(&Chapter_track_idx[i],0,40); break; } } } else { win_compopup_init(WIN_POPUP_TYPE_SMSG); win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H); win_compopup_set_msg_ext("There is only one chapter!",NULL,0); win_compopup_open_ext(&back_saved); osal_task_sleep(1500); win_compopup_smsg_restoreback(); } }