AuxSubtitles.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:6k
- /**************************************************************
- * AuxSubtitles.h
- **************************************************************
- * Description:
- * ============
- * Handling of auxiliary subtitles files
- **************************************************************
- *
- * Hagay Barel 10.11.03
- **************************************************************/
- #include "Config.h" // Global Configuration - do not remove!
- #ifdef USE_AUX_SUBTITLES
- #ifndef __AUXSUBTITLES_H_
- #define __AUXSUBTITLES_H_
- #include "PlaycoreNav_ClipsClip_Impl.h"
- #include "PlaycoreNav_ClipsAuxSubtitlesCommonPrivate.h"
- #include "IncludeSysDefs.h"
- /////////////////////////////////////////////////////////////////////////////////////////////
- // Function name : initAuxSubtitles
- // Purpose : Initializes auxiliary subtitles for a clip
- // Input Parameters : clipInfo - Information about the clip for which
- // to initialize subtitles
- // dwScale, dwRate - dwScale/dwRate is the number of seconds
- // per video frame in the given clip
- // Return type : TRUE if subtitles were loaded, FALSE otherwise.
- // Description : The function looks for a subtitle files belonging to the given clip,
- // performs parsing and initializes interrupt and event handlers.
- /////////////////////////////////////////////////////////////////////////////////////////////
- BOOL initAuxSubtitles(ClipFileInfo *clipInfo, DWORD dwScale, DWORD dwRate);
- /////////////////////////////////////////////////////////////////////////////////////////////
- // Function name : findAndCheckAuxSubtitlesFile
- // Purpose : looks for a subtitle file for the given clip
- // Input Parameters : clipInfo - Information about the clip for which
- // to look for subtitles
- // Output Parameters: dwSubtitlesFileAddress - Start address of the 1st subtitles file that was found
- // dwSubtitlesFileSize - Size of the subtitles 1st file that was found
- // pfParse - The parsing function used by the detected format
- // of the 1st recognized subtitle file.
- // prParse=NULL if none was found.
- // Return type : TRUE if recognized subtitles were found, FALSE otherwise.
- // Description : The function looks for files which have the same name (only name, not extension)
- // as the given clip, and tests if they are recognized subtitle files.
- // It then determines the format of the 1st such file.
- /////////////////////////////////////////////////////////////////////////////////////////////
- // <<< Robin_0903_2004
- #ifdef DIVX_SUPPORT_MULTI_SUBTITLE
- BOOL findAndCheckAuxSubtitlesFile(ClipFileInfo *clipInfo,DWORD *dwSubtitlesFileAddress,
- DWORD *dwSubtitlesFileSize,SubtitleParsingFuncPtr *pfParse, WORD wSubtitleID);
- #else
- BOOL findAndCheckAuxSubtitlesFile(ClipFileInfo *clipInfo,DWORD *dwSubtitlesFileAddress,
- DWORD *dwSubtitlesFileSize,SubtitleParsingFuncPtr *pfParse
- /*, SubtitlesFormatID *sfFormat */ );
- #endif
- // >>> Robin_0903_2004
- void findAuxSubtitlesFile(Clip *pClip, const FindData *i_pFileInfo);
- /////////////////////////////////////////////////////////////////////////////////////////////
- // Function Name : checkAndHandleAuxSubtitles
- // Purpose : Reads subtitles from memory, and sends them to the UI
- // when it's time to display them.
- // Input Parameters: dwCurrentTime - current SCLK count.
- // Return type : void
- // Description : Checks if the current time is later than the previously
- // noted "next update time". If it's time to start displaying
- // a new subtitle, and the UI task has finished dealing with
- // the previous subtitle, write the new subtitle text to a buffer
- // and send an event to the UI - to start displaying it.
- // if it's time to stop displaying a subtitle - send a proper
- // event to the UI.
- /////////////////////////////////////////////////////////////////////////////////////////////
- void checkAndHandleAuxSubtitles(DWORD dwCurrentTime);
- void unlockAuxSubtitlesStringBuffer(void);
- /////////////////////////////////////////////////////////////////////////////////////////////
- // Function Name : setSubtitlesPlayMode
- // Purpose : Sets the play mode for subtitles - whether the core task should
- // check for new subtitles or not.
- // Input parameters: mode - whether play mode is on
- // Return type : void
- // Description : Before using FF/FB/Goto, play mode should be set to FALSE so that the
- // core task won't try to search for subtitles. After FF/FB/Goto is done
- // and subtitleGoToTime is called, play more should be set to TRUE.
- /////////////////////////////////////////////////////////////////////////////////////////////
- void setSubtitlesPlayMode(BOOL mode);
- /////////////////////////////////////////////////////////////////////////////////////////////
- // Function Name : stopDisplayAuxSubtitles
- // Purpose : notify the UI to stop displaying the current subtitle
- // Return type : void
- // Description :
- /////////////////////////////////////////////////////////////////////////////////////////////
- void stopDisplayAuxSubtitles(void);
- /////////////////////////////////////////////////////////////////////////////////////////////
- // Function Name : subtitleGoToTime
- // Purpose : Jump to a new time in the subtitle storage
- // Input parameters: dwCurrentTime - the new time
- // Return type : void
- // Description : After FF/FB/Goto, this function is used to set the next subtitle to be
- // the 1 right before the new time.
- /////////////////////////////////////////////////////////////////////////////////////////////
- void subtitleGoToTime(DWORD dwCurrentTime);
- BOOL areAuxSubtitlePresent(void);
- // <<< Robin_0907_2004
- BOOL areAuxSubtitleExist(void);
- // >>> Robin_0907_2004
- #define SUBTITLE_STRING_SC_SZ_B 156
- #define SUBTITLE_STRING_SC_SZ_DW 39
- #define SUBTITLE_DISPLAY_0_SC_OFFSET_DW 39
- #define SUBTITLE_DISPLAY_1_SC_OFFSET_DW 64
- #define SUBTITLE_DISPLAY_2_SC_OFFSET_DW 89
- #ifdef IS_MP4_CAPABLE
- void mp4InitSubtitles();
- void mp4CheckAndHandleSubtitle(DWORD dwCurrentTime);
- #endif
- #ifdef IS_AVI_CAPABLE
- BOOL aviParseInternalSubtileText();
- #endif
- #endif // __AUXSUBTITLES_H_
- #endif // USE_AUX_SUBTITLES