📄 asrt_m.c
字号:
/***********************************************************************/
/* File: */
/* Copyright (c) 2000 ZORAN Corporation, All Rights Reserved */
/* THIS IS PROPRIETARY SOURCE CODE OF ZORAN CORPORATION */
/* */
/* =========== */
/* Descripton: */
/* =========== */
/* */
/* Log: */
/* === */
/* $Name: V_1_16 V_1_15 V_1_14 V_1_13 V_1_12 NV_1_00 V_1_11 $
/* $Header: v:/dsg/rcs/dsg/vp2k/Customer/menu/zoran/asrt_m.c 1.17 2001/06/12 07:21:08 dingming Exp $
/* $Log: asrt_m.c $
/* Revision 1.17 2001/06/12 07:21:08 dingming
/* Revision 1.16 2001/06/06 06:14:31 dingming
/* Revision 1.15 2000/11/17 18:54:10 charlie
/* Use C_FOCUSED
/* Revision 1.14 2000/11/17 17:58:12 charlie
/* Use C_FOCUSED
/* Revision 1.13 2000/11/09 04:07:30 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 "..\..\playcore\coremain\coregdef.h"
#include "..\..\..\kernel\eventdef.h"
#include "..\..\..\Decoder\decoder.h"
// A) This starts a line above mssVolume and volume_slider and ends on that line
//static const MS_POS screen_pos = {104, 60, 504, 60};
static const MS_POS screen_pos = {104, MS_LINE_2, 504, MS_LINE_HEIGHT};
#define USE_UNION
#ifdef USE_UNION
#define MEMBER(_member_) gu_ms.m_asrtm._member_
#else
typedef struct o_asrtm
{
static MS_SLIDER *volume_slider;
} O_ASRTM;
#endif
// These are the interactive positions
// This appears on the second line when screen_pos has value A) above
//static const MS_POS volume_slider_pos = {200, 30, 256, 22};
static const MS_POS volume_slider_pos = {200, MS_LINE_0, 256, 22};
#ifdef DISABLE
// This appears on the second line when screen_pos has value A) above
const MS_STATIC mssVolume = {
{
0,
ALIGN_LEFT,
I_COLOR,
{16, MS_LINE_1, 176, MS_LINE_HEIGHT},
NO_PARENT,
static_user_op,
},
(void *)S_VOLUME
};
#else
const MS_STATIC mssVolume = {
{
0,
ALIGN_LEFT,
I_COLOR,
{16, MS_LINE_0, 176, MS_LINE_HEIGHT},
NO_PARENT,
static_user_op,
},
(void *)S_VOLUME
};
#endif // DISABLE
static void layout (void)
{
if(gcs.pstate==PST_STOP||g_disc_type==DEC_DISC_TYPE_MP3)
;
else
go_CurrentLayout.m_bBigMemMap = FALSE;//USE_BIGMEMMAP_WHEN_REQUIRED;
go_CurrentLayout.m_cPixRes = 0;
go_CurrentLayout.m_wOriginX = 0;
#ifdef FONT32X24
go_CurrentLayout.m_wOriginY = MS_LINE_2;
#else
go_CurrentLayout.m_wOriginY = 60;
#endif
go_CurrentLayout.m_wWidth = 720;
go_CurrentLayout.m_wHeight = 120;
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);
printf("AUDIO RUNTIME MENU LAYOUT\n");
}
static void on_audio_runtime_close(void)
{
#ifdef NO_C_STDLIB
dbouts("\nAudio runtime screen closed");
#endif
SAFELY_DELETE(MEMBER(volume_slider));
}
#define UI_SLIDER_MAX 16 //DM0612 fix the scale lost issue
#define HW_VOLUME_MAX ( oHWLimit.mMaxGain )
static void on_volume_change(unsigned char cur)
{
DWORD d_Cmd;
int iVolume;
#ifdef NO_C_STDLIB
dbouts("\nVolume change to ");
dbouti( cur );
#endif
// Scale ui value to hardware range
iVolume = (cur == UI_SLIDER_MAX ? HW_VOLUME_MAX : (int) cur * (HW_VOLUME_MAX + 1) / UI_SLIDER_MAX );
d_Cmd = (((DWORD)PS_UPDATE_VOLUME_SETTING)<<16) + (DWORD) iVolume;
ie_send_ex(IE_CORE_UPDATE_PS, (void *)d_Cmd);
}
void open_audio_runtime(void)
{
screen = MS_create_screen((MS_POS *)&screen_pos,screen_color,0,on_audio_runtime_close,layout);
MEMBER(volume_slider) = MS_create_slider((MS_POS *)&volume_slider_pos,
i_color,
UI_SLIDER_MAX,
// Scale ui value from hardware range
(int) gps->volume * UI_SLIDER_MAX / HW_VOLUME_MAX,
1,
on_volume_change,
-1,
MS_HOT_SPOT);
MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)MEMBER(volume_slider), C_FOCUSED);
MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&mssVolume, !C_FOCUSED);
MS_dialog_display((MS_DIALOG*)screen);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -