📄 setup.c
字号:
/***********************************************************************/
/* File: */
/* Copyright (c) 2000 ZORAN Corporation, All Rights Reserved */
/* THIS IS PROPRIETARY SOURCE CODE OF ZORAN CORPORATION */
/* */
/* =========== */
/* Descripton: */
/* =========== */
/* */
/* Log: */
/* === */
/* $Name: V_1_1A V_1_19 $
/* $Header: v:/dsg/rcs/dsg/vp2k/Customer/MENU/newzoran/Setup.c 1.13 2001/09/21 07:10:59 dingming Exp $
/* $Log: Setup.c $
/* Revision 1.13 2001/09/21 07:10:59 dingming
/* Revision 1.13 2001/09/20 10:19:49Z dingming
/* Revision 1.12 2001/09/13 03:23:55Z dingming
/* Revision 1.11 2001/09/12 09:06:47Z dingming
/* Revision 1.10 2001/08/14 11:27:39Z tonnyg
/* Revision 1.9 2001/08/13 14:37:37 tonnyg
/* Revision 1.8 2001/08/10 09:05:06 tonnyg
/* Revision 1.7 2001/08/02 10:05:09 dingming
/* Revision 1.6 2001/07/30 07:50:23Z tonnyg
/* Revision 1.5 2001/07/23 07:44:04 tonnyg
/* Revision 1.4 2001/07/11 07:54:58 dragonwg
/* Revision 1.3 2001/07/11 07:41:52 dragonwg
/* Progressive scan
/* Revision 1.2 2001/06/29 01:10:48 tonnyg
/* fix bug in setup\audio menu
/* Revision 1.1 2001/06/26 08:04:59 dingming
/* Initial revision
/* Revision 1.8 2001/06/14 06:45:35 dingming
/* Revision 1.7 2001/05/19 02:59:10 fwang
/* Delete prologic off
/* Revision 1.6 2001/05/07 08:59:11 fwang
/* Revision 1.5 2001/05/01 02:25:39 fwang
/* Revision 1.4 2001/04/11 01:01:52 fwang
/* Add SCART support based on video mode.
/* Revision 1.3 2001/03/27 09:56:31 fwang
/* Revision 1.2 2001/03/26 01:39:49 fwang
/* Adjust dialog position
/* Revision 1.1 2001/03/14 04:12:01 cliff
/* Initial revision
/* Revision 1.63 2000/12/23 01:22:21 charlie
/* Delete choice3/choice4 according to
/* D_ENABLE_SETUP_LRMODE
/* Revision 1.62 2000/12/15 01:19:28 charlie
/* Changed D_NO_FRENCH to D_FRENCH
/* Revision 1.61 2000/12/14 20:10:37 charlie
/* Control access to French language code via D_NO_FRENCH
/* Revision 1.60 2000/12/14 19:34:02 charlie
/* Control French language access via D_NO_FRENCH macro
/* Revision 1.59 2000/12/14 03:14:16 charlie
/* Added w_language_code for French
/* Revision 1.58 2000/12/14 02:57:18 charlie
/* Support French language
/* Revision 1.57 2000/12/09 03:47:44 tia
/* Add Pink Noise menu
/* Revision 1.56 2000/12/09 01:25:22 tia
/* Add pink noise in setup menu
/* Revision 1.55 2000/12/06 22:46:34 charlie
/* Fixed problem with parental menu (?): expanded width in LOCK_POS
/* Revision 1.54 2000/11/18 23:10:45 charlie
/* Changed debug message from printf to rtouts
/* Revision 1.53 2000/11/17 18:54:19 charlie
/* Use C_FOCUSED
/* Revision 1.52 2000/11/13 23:33:56 charlie
/* Changed button color; moved BAR_COLOR, BUTTON_COLOR to
/* ms_lib.h
/* Revision 1.51 2000/11/09 04:07:34 cliff
/***********************************************************************/
#include <stdio.h>
#include <string.h>
#include "sysdefs.h"
#include "..\..\..\ui\menu_sys\ms_wdgt.h"
#include "..\..\..\ui\menu_sys\ms_lib.h"
#include "..\..\..\ui\menu_sys\osd_drv.h"
#include "..\..\..\decoder\osdrendr.h"
#include "..\..\..\decoder\osdlayou.h"
#ifdef FONT32X24 //DM0605
#include "..\..\..\customer\dragon\strings\strings.h"
#else
#include "..\..\..\ui\strings\strings.h"
#endif
#include "menu_var.h"
#include "..\..\playcore\ps\ps.h"
#include "..\..\kernel\eventdef.h"
#include "..\..\playcore\coremain\coregdef.h"
#include "vs.h"
#ifdef D_ENABLE_SETUP_LRMODE
#include "lr.h"
#endif // D_ENABLE_SETUP_LRMODE
#ifdef D_ENABLE_SETUP_RESTORE_SETTING
#include "..\..\cpu\cpu_api.h"
#endif
#ifdef TV_GUARDIAN_ENABLE
#include "..\..\playcore\tvg\tvgapi.h"
#endif
// Width of all choice items
#define OPTION_WIDTH 192
#define OPTION_HEIGHT MS_LINE_HEIGHT
#define X_COLUMN1 OPTION_WIDTH
#define X_COLUMN2 (X_COLUMN1+ OPTION_WIDTH + 8)
#define X_OFFSET 64
#define Y_OFFSET 60
static void open_language(void);
static void close_language(void);
static void open_video(void);
static void close_video(void);
static void open_audio(void);
static void close_audio(void);
#ifndef D_NO_6CHANNEL_OUTPUT
static void open_more_audio(void);
#endif
static void close_more_audio(void);
static void open_parental(void);
static void close_parental(void);
static void close_dialog_box(void);
static void restore_setting_action();
void ac3_digital_action(int num);
void dts_digital_action(int num);
void others_digital_action(int num);
BOOL g_ui_bIsLocked;
/*
unsigned int foreground : 4;
unsigned int background : 4;
unsigned int activate : 4;
unsigned int focused : 4;
*/
#define STAT_COLOR SCREEN_COLOR
// These were moved to ms_lib.h
#ifdef DISABLE
#ifdef D_COLOR_STRUCT
#define BAR_COLOR {2,4,5,5}
#else
#define BAR_COLOR 0x2455
#endif // D_COLOR_STRUCT
#define BUTTON_COLOR I_COLOR
#endif // DISABLE
static const MS_POS setup_pos = {X_OFFSET, Y_OFFSET, 600, MS_MAX_LINES_BIGMM};
static const MS_POS dialog_pos ={0, MS_LINE_1, 600, MS_MAX_LINES_BIGMM - MS_LINE_HEIGHT};
const WORD w_language_code[] =
{
MAKE_DVD_LANGUAGE_CODE('e', 'n'),
#ifndef D_NO_CHINESE
MAKE_DVD_LANGUAGE_CODE('z', 'h'),
#elif D_SPANISH
MAKE_DVD_LANGUAGE_CODE('e', 's'),
#endif
SUBTITLE_AUTO,
SUBTITLE_OFF
};
static void layout (void)
{
go_CurrentLayout.m_bBigMemMap = TRUE;
go_CurrentLayout.m_cPixRes = 0;
// OSD can't start displaying at an arbitrary x-position, so we use 0 instead of X_OFFSET
go_CurrentLayout.m_wOriginX = 0;
// This can be set arbitrarily, as long as the m_wOriginY + m_wHeight <= video standard's height
go_CurrentLayout.m_wOriginY = Y_OFFSET;
go_CurrentLayout.m_wWidth = 720;
go_CurrentLayout.m_wHeight = MS_MAX_LINES_BIGMM;
go_CurrentLayout.m_cNbrHole = 0;
go_CurrentLayout.m_cInitColor = 0;
go_CurrentLayout.m_cNbrColor = 16;
go_CurrentLayout.m_pColorPalette = (OSD_Palette *)MenuBitmapColor;
OSDSetLayout();
OSDSetFont(0);
rtouts("\nSETUP BUTTONS LAYOUT");
}
#define ITEMNUM_LEVEL_KID_SAFE 0
#define ITEMNUM_LEVEL_G 1
#define ITEMNUM_LEVEL_PG 2
#define ITEMNUM_LEVEL_PG_13 3
#define ITEMNUM_LEVEL_PG_R 4
#define ITEMNUM_LEVEL_R 5
#define ITEMNUM_LEVEL_NC_17 6
#define ITEMNUM_LEVEL_ADULT 7
const OSD_MESSAGES lvl_par_list_c[] = {
S_KID_SAFE,
S_G,
S_RATING_PG,
S_PG_13,
S_PG_R,
S_R,
S_NC_17,
S_ADULT
};
const MS_TEXT_LIST lvl_par_list = {
8,(int *)lvl_par_list_c
};
//
// Analog Out choices
//
#ifdef D_NO_2CHANNEL_OUTPUT
#define ITEMNUM_6CH 0
#define ITEMNUM_AOUT_OFF 1
#endif
#ifdef D_NO_6CHANNEL_OUTPUT
#define ITEMNUM_2CH 0
#define ITEMNUM_AOUT_OFF 1
#endif
#if D_NO_2CHANNEL_OUTPUT|D_NO_6CHANNEL_OUTPUT
#else
#define ITEMNUM_2CH 0
#define ITEMNUM_6CH 1
#define ITEMNUM_AOUT_OFF 2
#endif
//<<<<<VW0523 remove off item.
const OSD_MESSAGES analog_out_list_c[] = {
#ifndef D_NO_2CHANNEL_OUTPUT
S_2CHANNEL,
#ifndef D_NO_6CHANNEL_OUTPUT
S_6CHANNEL,
#endif
S_OFF
#else
#ifndef D_NO_6CHANNEL_OUTPUT
S_6CHANNEL,
#endif
S_OFF
#endif //D_NO_2CHANNEL_OUTPUT
};
const MS_TEXT_LIST analog_out_list = {
#if D_NO_2CHANNEL_OUTPUT|D_NO_6CHANNEL_OUTPUT
2,(int *)analog_out_list_c
#else
3,(int *)analog_out_list_c
#endif
};
//VW0523 >>>>
//
// MP3 Analog Out choices
//
#define ITEMNUM_MP3_2CH 0
#define ITEMNUM_MP3_AOUT_OFF 2
const OSD_MESSAGES mp3_analog_out_list_c[] = {
S_2CHANNEL,
S_OFF
};
const MS_TEXT_LIST mp3_analog_out_list = {
2,(int *)mp3_analog_out_list_c
};
//
// Digital Out choices
//
#define ITEMNUM_PCM 0
#define ITEMNUM_RAW 1
#define ITEMNUM_DOUT_OFF 2
const OSD_MESSAGES digital_out_list_c[] = {
S_PCM,
S_RAW,
S_OFF
};
const MS_TEXT_LIST digital_out_list = {
3,(int *)digital_out_list_c
};
// ZORAN CDE0724 : Fixed usage of compound D20_BOARD and DTS_DISABLE macros
#if (defined(D20_BOARD) || defined(DTS_DISABLE)) //DM0316 enable DTS SPDIF when disable DTS
//#if D20_BOARD || DTS_DISABLE //DM0316 enable DTS SPDIF when disable DTS
//
// DTS Digital Out choices
//
#define ITEMNUM_DTS_RAW 0
#define ITEMNUM_DTS_DOUT_OFF 1
const OSD_MESSAGES dts_digital_out_list_c[] =
{
S_RAW,
S_OFF
};
const MS_TEXT_LIST dts_digital_out_list =
{
2,(int *)dts_digital_out_list_c
};
#endif // D20_BOARD
//
// MP3 Digital Out choices
//
#define ITEMNUM_MP3_PCM 0
#define ITEMNUM_MP3_OFF 1
const OSD_MESSAGES mp3_digital_out_list_c[] = {
S_PCM,
S_OFF
};
const MS_TEXT_LIST mp3_digital_out_list = {
2,(int *)mp3_digital_out_list_c
};
//
// Subwoofer choices
//
#define ITEMNUM_SUB_ON 0
#define ITEMNUM_SUB_OFF 1
const OSD_MESSAGES sub_aud_list_c[] = {
S_ON,
S_OFF
};
const MS_TEXT_LIST sub_aud_list = {
2,(int *)sub_aud_list_c
};
//
// Prologic choices
//
#define ITEMNUM_PRO_AUTO 0
#define ITEMNUM_PRO_ON 1
#define ITEMNUM_PRO_OFF 2
const OSD_MESSAGES pro_aud_list_c[] = {
S_AUTO,
S_ON,
S_OFF
};
const MS_TEXT_LIST pro_aud_list = {
3,(int *)pro_aud_list_c
};
///////////////////////////////////////// Ban
// Pink noise choices
//
#ifdef D_ENABLE_SETUP_PKNOISE
#define ITEMNUM_PKNOISE_OFF 0
#define ITEMNUM_PKNOISE_LEFT 1
#define ITEMNUM_PKNOISE_CENTER 2
#define ITEMNUM_PKNOISE_RIGHT 3
#define ITEMNUM_PKNOISE_LEFT_SURR 4
#define ITEMNUM_PKNOISE_RIGHT_SURR 5
#define ITEMNUM_PKNOISE_SUB 6
const OSD_MESSAGES pknoise_aud_list_c[] = {
S_OFF,
S_LEFT,
S_CENTER,
S_RIGHT,
S_LEFT_SURR,
S_RIGHT_SURR,
S_SUBWOOFER
};
const MS_TEXT_LIST pknoise_aud_list = {
7,(int *)pknoise_aud_list_c
};
#endif //D_ENABLE_SETUP_PKNOISE
///////////////////////////////////////// Ban
//
// OSD menu language choices
//
#define ITEMNUM_OSD_LNG_ENGLISH 0
#ifndef D_NO_CHINESE
#define ITEMNUM_OSD_LNG_CHINESE 1
#elif D_SPANISH
#define ITEMNUM_OSD_LNG_SPANISH 1
#endif
const OSD_MESSAGES osd_lng_list_c[] = {
S_ENGLISH,
#ifndef D_NO_CHINESE
S_CHINESE,
#elif D_SPANISH
S_SPANISH,
#endif
};
const MS_TEXT_LIST osd_lng_list = {
#if (defined (D_SPANISH) || !(defined (D_NO_CHINESE)))
2,
#else
1,
#endif
(int *)osd_lng_list_c
};
//
// OSD (enable) choices
//
#define ITEMNUM_OSD_ON 0
#define ITEMNUM_OSD_OFF 1
const OSD_MESSAGES osd_enable_list_c[] = {
S_ON,
S_OFF
};
const MS_TEXT_LIST osd_enable_list = {
2,(int *)osd_enable_list_c
};
//
// Audio language choices
//
#define ITEMNUM_AUD_LNG_ENGLISH 0
#ifndef D_NO_CHINESE
#define ITEMNUM_AUD_LNG_CHINESE 1
#elif D_SPANISH
#define ITEMNUM_AUD_LNG_SPANISH 1
#endif
const OSD_MESSAGES aud_lng_list_c[] = {
S_ENGLISH,
#ifndef D_NO_CHINESE
S_CHINESE,
#elif D_SPANISH
S_SPANISH,
#endif
};
const MS_TEXT_LIST aud_lng_list = {
#if (defined (D_SPANISH) || !(defined (D_NO_CHINESE)))
2,
#else
1,
#endif // D_SPANISH
(int *)aud_lng_list_c
};
//
// DVD menu language choices
//
#define ITEMNUM_MENU_LNG_ENGLISH 0
#ifndef D_NO_CHINESE
#define ITEMNUM_MENU_LNG_CHINESE 1
#elif D_SPANISH
#define ITEMNUM_MENU_LNG_SPANISH 1
#endif
const OSD_MESSAGES menu_lng_list_c[] = {
S_ENGLISH,
#ifndef D_NO_CHINESE
S_CHINESE,
#elif D_SPANISH
S_SPANISH,
#endif
};
const MS_TEXT_LIST menu_lng_list = {
#if (defined (D_SPANISH) || !(defined (D_NO_CHINESE)))
2,
#else
1,
#endif
(int *)menu_lng_list_c
};
//
// Subtitle language choices
//
#define ITEMNUM_SUB_LNG_ENGLISH 0
#ifndef D_NO_CHINESE
#define ITEMNUM_SUB_LNG_CHINESE 1
#define ITEMNUM_SUB_LNG_AUTO 2
#define ITEMNUM_SUB_LNG_OFF 3
#elif D_SPANISH
#define ITEMNUM_SUB_LNG_SPANISH 1
#define ITEMNUM_SUB_LNG_AUTO 2
#define ITEMNUM_SUB_LNG_OFF 3
#else
#define ITEMNUM_SUB_LNG_AUTO 1
#define ITEMNUM_SUB_LNG_OFF 2
#endif // D_SPANISH
const OSD_MESSAGES sub_lng_list_c[] = {
S_ENGLISH,
#ifndef D_NO_CHINESE
S_CHINESE,
#elif D_SPANISH
S_SPANISH,
#endif
S_AUTO,
S_OFF
};
const MS_TEXT_LIST sub_lng_list = {
#if (defined (D_SPANISH) || !(defined (D_NO_CHINESE)))
4,
#else
3,
#endif // D_SPANISH
(int *)sub_lng_list_c
};
//
// TV Shape (resolution) choices
//
#define ITEMNUM_4_3_PANSCAN 0
#define ITEMNUM_4_3_LETTERBOX 1
#define ITEMNUM_16_9 2
const OSD_MESSAGES res_vid_list_c[] = {
S_4_3_PANSCAN,
S_4_3_LETTERBOX,
S_16_9
};
const MS_TEXT_LIST res_vid_list = {
3,(int *)res_vid_list_c
};
//
// TV standard choices
//
#define ITEMNUM_STD_NTSC 0
#define ITEMNUM_STD_PAL 1
#ifdef NO_PAL_M//ZORAN LX0316
#define ITEMNUM_STD_AUTO 2
#ifdef PAL_N_ENABLE
#define ITEMNUM_STD_PAL_N 3
#endif
#ifdef PAL_NC_ENABLE //VW0604
#ifdef PAL_N_ENABLE
#define ITEMNUM_STD_PAL_NC 4
#else
#define ITEMNUM_STD_PAL_NC 3
#endif
#endif
#else//NO_PAL_M
#define ITEMNUM_STD_PAL_60 2
#define ITEMNUM_STD_PAL_M 3
#define ITEMNUM_STD_AUTO 4
#ifdef PAL_N_ENABLE
#define ITEMNUM_STD_PAL_N 5
#endif
#ifdef PAL_NC_ENABLE //VW0604
#ifdef PAL_N_ENABLE
#define ITEMNUM_STD_PAL_NC 6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -