📄 o_aux_subtitle.c
字号:
/* **************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: $Workfile: o_aux_subtitle.c $
*
* Description:
* ============
*
****************************************************************************************/
#include "Config.h" // Global Configuration - do not remove!
#ifdef USE_AUX_SUBTITLES
#ifdef DEBUG_UI_TRACE
#undef IFTRACE
#define IFTRACE if (gTraceUI)
#include "Debug\DbgMain.h"
#endif //DEBUG_UI_TRACE
#include "Include\SysDefs.h"
#include <stdio.h>
#include <string.h>
#include "Playcore\ScPad\ScPadAlloc.h"
#include "Playcore\ScPad\SCMGR.h"
#ifdef D_GINGER_I86
#include "Playcore\Nav_Clips\AuxSubtitles.h"
#endif //D_GINGER_I86
#ifdef D_GINGER_I96
#include "Playcore\Nav_Clips\AuxSubtitles\AuxSubtitles.h"
#endif //D_GINGER_I96
#include "Playcore\PS\ps.h"
// Include the module header file
#include "Components\Aux_subtitles\o_aux_subtitle.h"
#include "Menu\menu_operation_def.h"
#include "Menu_config\menu_config_common.h"
#include "GUI\Menu_system\ms_container.h"
#include "GUI\Menu_system\ms_component.h"
#include "GUI\Menu_system\osd_rendering.h"
#include "GUI\Object_class\Multiline\mso_multiline_text.h"
#include "Font\fonts.h"
#include "Library\Unicode.h"
#include "GUI\resource\bitmap\bitmap.h"
#include "CoreAPI\CoreAPI.h"
#include "gui\menu_system\Ms_display.h"
// Include configuration header file: named constants, macros and typedefs.
#include "Components\Aux_subtitles\o_aux_subtitle_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Components\Custom\Aux_subtitles\o_aux_subtitle_custom.h"
#ifndef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif
/***************************************************************************************
* Private static functions declaration
****************************************************************************************/
/***************************************************************************************
* Utility functions
****************************************************************************************/
static void OAuxSubt_GetFormUniStr_AuxSubt(FORMATED_UNICODE_STRING __NEAR *pFormattedString, UINT32 wParam);
/***************************************************************************************
* Operation handlers
****************************************************************************************/
static MS_OP _AuxSubtOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
BOOL _AuxSubtFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
/***************************************************************************************
* Include customization file.
****************************************************************************************/
// Include custom code file: customer specific code, over-writing common one.
#include "Components\Custom\Aux_subtitles\o_aux_subtitle_custom.c"
// Include configuration file: constants.
#include "Components\Aux_subtitles\o_aux_subtitle_config.c"
/***************************************************************************************
* Utility functions
****************************************************************************************/
#ifndef D_CUSTOM_OAuxSubt_GetFormUniStr_AuxSubt
static void OAuxSubt_GetFormUniStr_AuxSubt(FORMATED_UNICODE_STRING __NEAR *pFormattedString, UINT32 wParam)
{
if (CoreAPI_IsDivxSubtitleUnicode())
{
#ifdef D_GINGER_I86
sc_GetBytes(CoreAPI_GetDivxSubtitleAddr(), (((UINT16)(wParam >> 16))*2), (UNISTR_LENGTH_MAX*2), (BYTE*)pFormattedString->mszUniStr);
#endif //D_GINGER_I86
#ifdef D_GINGER_I96
BYTE far* aAuxSubtitleString = (BYTE far*)CoreAPI_GetDivxSubtitleAddr();
//sc_GetBytes(CoreAPI_GetDivxSubtitleAddr(), (((UINT16)(wParam >> 16))*2), (UNISTR_LENGTH_MAX*2), (BYTE*)pFormattedString->mszUniStr);
memcpy((BYTE*)pFormattedString->mszUniStr, aAuxSubtitleString+(((UINT16)(wParam >> 16))*2), (UNISTR_LENGTH_MAX*2));
#endif //D_GINGER_I96
}
else
{
#define _8BIT_CHARS 1
#ifdef D_GINGER_I86
sc_GetBytes(CoreAPI_GetDivxSubtitleAddr(), ((UINT16)(wParam >> 16)), UNISTR_LENGTH_MAX, (UINT8*)(pFormattedString->mszUniStr));
#endif //D_GINGER_I86
#ifdef D_GINGER_I96
BYTE far* aAuxSubtitleString = (BYTE far*)CoreAPI_GetDivxSubtitleAddr();
//sc_GetBytes(CoreAPI_GetDivxSubtitleAddr(), ((UINT16)(wParam >> 16)), UNISTR_LENGTH_MAX, (UINT8*)(pFormattedString->mszUniStr));
memcpy((BYTE*)pFormattedString->mszUniStr, aAuxSubtitleString+(UINT16)(wParam >> 16), (UNISTR_LENGTH_MAX*2));
#endif //D_GINGER_I96
ConvertToUnicode(pFormattedString->mszUniStr, pFormattedString->mszUniStr, UNISTR_LENGTH_MAX, CoreAPI_GetPSDivxSubtitleCodePage(), _8BIT_CHARS);
}
OSDR_FormatUniString(pFormattedString);
}
#endif //D_CUSTOM
/***************************************************************************************
* Operation handlers
****************************************************************************************/
/***************************************************************************************
* Function : AuxSubtOperation
*
* In :
* Out :
* Desc :
****************************************************************************************/
#ifndef D_CUSTOM__AuxSubtOperation
#pragma argsused
static MS_OP _AuxSubtOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch (MsOp)
{
case MS_OP_CORE_START_DISPLAY_AUX_SUBTITLE:
dbg_printf(("Start subt"));
MS_SendOperation(MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR *)&oAuxSubtTextDescriptor), MS_OP_BUILD_TEXT_TABLE, 0);
MS_SendOperation(MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR *)&oAuxSubtTextDescriptor), MS_OP_REFRESH, 0);
MsOp = MS_OP_NONE;
break;
case MS_OP_MENU_STOP_DISPLAY_AUX_SUBTITLE:
case MS_OP_CORE_STOP_DISPLAY_AUX_SUBTITLE:
dbg_printf(("Stop subt"));
MS_SendOperation(MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR *)&oAuxSubtTextDescriptor), MS_OP_EMPTY, 0);
MS_SendOperation(MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR *)&oAuxSubtTextDescriptor), MS_OP_REFRESH, 0);
MsOp = MS_OP_NONE;
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
#endif //D_CUSTOM
BOOL _AuxSubtFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
if (!((MSO_MULTILINE_TEXT __NEAR*)pThis)->moParam.moEntryTable.mcTableEntryCount)
return FALSE;
return OMULTILINETEXT_FillOSDSeg (pThis, pAbsArea);
}
#endif //USE_AUX_SUBTITLES
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -