📄 ircmd_subtitle.c
字号:
/**************************************************************************
* *
* Copyright (c) 2002 by Sunplus Technology Co., Ltd. *
* *
* This software is copyrighted by and is the property of Sunplus *
* Technology Co., Ltd. All rights are reserved by Sunplus Technology *
* Co., Ltd. This software may only be used in accordance with the *
* corresponding license agreement. Any unauthorized use, duplication, *
* distribution, or disclosure of this software is expressly forbidden. *
* *
* This Copyright notice MUST not be removed or modified without prior *
* written consent of Sunplus Technology Co., Ltd. *
* *
* Sunplus Technology Co., Ltd. reserves the right to modify this *
* software without notice. *
* *
* Sunplus Technology Co., Ltd. *
* 19, Innovation First Road, Science-Based Industrial Park, *
* Hsin-Chu, Taiwan, R.O.C. *
**************************************************************************/
/*--------------------------------------------------------------------------
| File Name : ircmd_subtitle.c
|
| Description : realize subtitle function in IR subtitle key.
|
| Version : 0.1
|
|
| Rev Date Author(s) Status & Comments
|---------------------------------------------------------------------------------
| 0.1 2004/4/6 Terry Creating
| 0.2 2004/8/4 Terry modified
|--------------------------------------------------------------------------------*/
#include "file_if.h" //lyc add 2006-4-26,for null idx1,can't resync av but continues only
#include "avi_def.h"
extern void sup_select_subtitles(int n);
extern void sup_select_channel_2(int chn);
#ifdef SUPPORT_QUICKTIME
extern int QT_Set_SubP();
#endif //SUPPORT_QUICKTIME
#ifdef TWO_KEY_SWITCH_TWO_SUBTITLE //added by wangwei,2004-9-29 17:25
extern int IDTWO;
extern int twoSubTTFlag;
#endif
#ifdef SUPPORT_MP4_SUBTITLE
extern BYTE show_unsupported_message;
#endif
#if defined( SUPPORT_DIVX_HOME_THEATER/*AVI_INTERNAL_SUP*/ ) || defined( SUPPORT_MP4_SUBTITLE ) // 2004/09/17 yltseng
#include "avi_if.h"
UINT8 g_uiSubtitleKeyPressed = FALSE;
#ifdef SUPPORT_QUICKTIME
static inline UINT32 sub_picture_QT()
{
if (IS_FILE_TYPE_ND())
{
UINT32 uResult;
uResult = QT_Set_SubP();
if ((uResult & 0xF0000000) == 0xF0000000)
{
psprintf(RegionValStr[REGION1], "DISABLE SUBPICTURE");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
else
{
//lyc add 2005-12-22
extern char *get_cur_SUBP_Name();
char *c = get_cur_SUBP_Name();
psprintf(RegionValStr[REGION1], "SUBPICTURE %d %s", uResult,c);
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
return TRUE;
}
return FALSE;
}
#endif //SUPPORT_QUICKTIME
static inline void PrepareToLoadMP4InternalSubtitle()
{
if( action_click &&( (GetCurrentFileType() == CDROM_MP4)||(GetCurrentFileType() == CDROM_AVI)) )
{
g_uiSubtitleKeyPressed = TRUE;
#ifdef SUPPORT_DIVX_HOME_THEATER/*AVI_INTERNAL_SUP*/
extern int file_set_supic_stream(int sup_strm_num);
if( file_set_supic_stream( NP_SPSTN & 0x3f ) )
g_uiSubtitleKeyPressed = FALSE;
#ifndef SUPPORT_MP4_SUBTITLE
else
NP_SPSTN &= (~0x40);
#endif
#endif
}
}
/**************************************************************************
* Function Name: PrepareToLoadMP4ExternalSubtitle *
* Purposes: *
* load external subtitle. *
* Descriptions: * *
* Arguments: *
* NP_SPSTN: current subtitle number variable. *
* numerical value from 0x40. *
* *
* Returns: NONE *
* See also: NONE *
**************************************************************************/
void PrepareToLoadMP4ExternalSubtitle()
{
#ifdef SUPPORT_MP4_SUBTITLE
// 2004/01/31 yltseng, if DiscType is CDROM, then we need to wait until current packet is finished,
// that is, we have to wait until !is_dvddsp_hw_busy() and ( do_cd == do_cd_sync )
// for DVDROM, it's easier, we just wait until !is_dvddsp_hw_busy()
extern int do_cd_sync(void);
extern BYTE DiscType;
if( DiscType == CDDVD || do_cd == do_cd_sync
#if defined(SUPPORT_CARD_STORAGE)||defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)
|| (media_type == MEDIA_CARD) //kevinmonkey 050707 for card to call this function
#endif //usb,card supported
)
{
if( g_uiSubtitleKeyPressed )
{
g_uiSubtitleKeyPressed = FALSE; // 2004/09/19 yltseng, [note] don't change the code sequence
UINT32 uiStream = ( NP_SPSTN & 0x40 ) ? ( NP_SPSTN & 0x3f ) : 0xffff;
if( supSetSubtitleStream( uiStream ) ) // 2005/10/04 yltseng, resync av after change subtitle stream
{
if((GET_FILE_FLAG()&AVI_IDX1) > 0) //lyc add 2006-4-26,for null idx1,can't resync av but continues only
{
extern UINT8 avd_video_discont;
avd_video_discont = 1;
}
show_unsupported_message =0;
}
else
{
if(NP_SPSTN == 0xbf)
show_unsupported_message =0;
if(show_unsupported_message)
{
psprintf(RegionValStr[REGION2], "UnSupported");
PrintOsdMsg(STR_OS_SPACE, REGION2, 1, 1);
}
else
NP_SPSTN &= (~0x40);
}
}
}
#endif//#ifdef SUPPORT_MP4_SUBTITLE
}
#else
static inline void PrepareToLoadMP4InternalSubtitle() {}
inline void PrepareToLoadMP4ExternalSubtitle() {}
#endif//#if defined( SUPPORT_DIVX_HOME_THEATER/*AVI_INTERNAL_SUP*/ ) || defined( SUPPORT_MP4_SUBTITLE ) // 2004/09/17 yltseng
#ifdef SUPPORT_MP4
/**************************************************************************
* Function Name: set_sub_title_Ns *
* Purposes: *
* get subtitle total number . *
* Descriptions: *
* Arguments: *
* dAv_SPST_Ns: subtitle total number variable. *
* *
* Returns: NONE *
* See also: NONE *
**************************************************************************/
void set_sub_title_Ns(UINT8 Ns)
{
pDSV->dAv_SPST_Ns=Ns;
}
#endif
/**************************************************************************
* Function Name: sel_2nd_subtitle *
* Purposes: *
* realize two subtitle switch. *
* Descriptions: *
* realize two subtitle switch,but there is a fixed connection *
* between subtitle 1and subtitle 2,unskillfully. *
* Arguments: *
* id: get subtitle number. for example,0x40:ch1. *
* *
* Returns: NONE *
* See also: NONE *
**************************************************************************/
#ifdef TWO_SUBTITLE//terry,2004/8/4 09:39AM
#ifndef TWO_KEY_SWITCH_TWO_SUBTITLE //modified by wangwei,2004-9-29 17:04
void sel_2nd_subtitle(int id2)
{
int id1=NP_SPSTN&0x3f;
id2=id2&0x3f;
if(id2>=pDSV->dAv_SPST_Ns) id2=0;
if(pDSV->dAv_SPST_Ns>1)
{
if(id1 != id2)
{
sup_select_subtitles(2);
sup_select_channel_2(0x20+id2);
}else
{
sup_select_subtitles(1);
}
}
}
#endif //TWO_KEY_SWITCH_TWO_SUBTITLE
#endif
/**************************************************************************
* Function Name: ircmd_sub_picture *
* Purposes: *
* realize subtitle switch function in IR subtitle key. *
* Descriptions: *
* Arguments: *
* id : subtitle number id. *
* timer : fix time length that contents show on display. * *
* id_str : str id. *
* *
* Returns: NONE *
* See also: NONE *
**************************************************************************/
#if defined(PMP_UI)&&defined(SUPPORT_OSDID3)
extern int osd_id3_flag;
extern void show_id3(void);
#endif
void ircmd_sub_picture(void)
{
#if defined(PMP_UI)&&defined(SUPPORT_OSDID3)//////////////yangli mod control osdid3 2005-7-18
if(pFsJpeg->gifsState == FS_STATE_MP3)
{
if(osd_id3_flag==0)
{
osd_id3_flag=1;
show_id3();
psprintf(RegionValStr[REGION1], "ID3 ON");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
else
{
osd_id3_flag=0;
osd_tog_region(REGION3,OSD_OFF);
psprintf(RegionValStr[REGION1], "ID3 OFF");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
return;
}
#endif /////////////////SUPPORT_OSDID3
int id=0,timer,id_str;
#ifdef DVB1000_NON_OS //Maoyong 2005-3-21 19:43
#ifdef SUPPORT_TELETEXT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -