?? o_drc.c
字號:
/* **************************************************************************************
* Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: $Workfile: o_drc.c $
*
* Description:
* ============
* Project definition of the MSO_DRC
*
****************************************************************************************/
#include "Config.h" // Global Configuration - do not remove!
#ifdef D_SETUP_ADVANCED_DRC
#ifdef DEBUG_UI_TRACE
#undef IFTRACE
#define IFTRACE if (gTraceUI)
#include "Debug\DbgMain.h"
#endif //DEBUG_UI_TRACE
#include "Include\SysDefs.h"
//#ifdef DIGITAL_AMPLIFIER_ENABLE
/***************************************************************************************
* Include files
****************************************************************************************/
#include <stdio.h>
#include <string.h>
#include "Kernel\eventdef.h"
#include "include\math-macro.h"
#include "Playcore\ScPad\SCMGR.h"
#include "Playcore\Coremain\Coremain.h"
#include "Playcore\Coremain\CoreGDef.h"
#include "Library\String_generate.h"
#include "Library\Number.h"
#include "CoreAPI\CoreAPI.h"
#include "GUI\Menu_system\ms_object.h"
#include "gui\menu_system\osd_rendering.h"
#include "gui\menu_system\ms_display.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_component.h"
#include "GUI\Menu_system\ms_send_op.h"
#include "GUI\Object_class\Choice\mso_choice.h"
#include "GUI\Object_class\Hslider\mso_hslider.h"
#include "GUI\Object_class\Vlist\mso_vlist.h"
#include "Components\Dynamic_range_control\o_drc.h"
#include "GUI\Resource\Bitmap\bitmap.h"
#include "Menu\menu_operation_def.h"
#include "GUI\Object_class\Button\mso_button.h"
#include "GUI\Object_class\Page\mso_page.h"
#ifndef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif
/**************************************************************************
* Constants and Macros
***************************************************************************/
#define AREA_SEARCH_TIME_X 136
#define AREA_SEARCH_TIME_Y 36
#define AREA_SEARCH_TIME_W 132
#define AREA_SEARCH_TIME_H 28
#define AREA_SEARCH_TRACK_X AREA_SEARCH_TIME_X
#define AREA_SEARCH_TRACK_Y 68
#define AREA_SEARCH_TRACK_W AREA_SEARCH_TIME_W
#define AREA_SEARCH_TRACK_H AREA_SEARCH_TIME_H
#define AREA_SEARCH_TITLE_X AREA_SEARCH_TIME_X
#define AREA_SEARCH_TITLE_Y 68
#define AREA_SEARCH_TITLE_W (AREA_SEARCH_TIME_W / 2)
#define AREA_SEARCH_TITLE_H AREA_SEARCH_TIME_H
#define AREA_SEARCH_CHAPTER_X (AREA_SEARCH_TIME_X + AREA_SEARCH_TITLE_W)
#define AREA_SEARCH_CHAPTER_Y 68
#define AREA_SEARCH_CHAPTER_W (AREA_SEARCH_TIME_W / 2)
#define AREA_SEARCH_CHAPTER_H AREA_SEARCH_TIME_H
#define DRC_COL_1_X 12
#define DRC_COL_1_WIDTH 50//80
#define DRC_COL_2_X (DRC_COL_1_X + DRC_COL_1_WIDTH + 8)
#define DRC_COL_2_WIDTH 130//180
#define DRC_COL_3_X (DRC_COL_2_X + DRC_COL_2_WIDTH + 8)
#define DRC_COL_3_WIDTH 180//200
#define DRC_LINE_HEIGHT (28)
// This is the height of the bar in a slider:
#define HSLIDER_BAR_HEIGHT (16)
// This is the width of the bar:
#define HSLIDER_BAR_WIDTH 100//(DRC_COL_2_WIDTH / 2)
// This is the height of the slider tab:
#define HTAB_HEIGHT (28)
// This is the width of the slider tab:
#define HTAB_WIDTH (24)
// This is the width of the choices used:
#define DRC_CHOICE_WIDTH 160 //(DRC_COL_2_WIDTH)
// This is the additional width of the items in the vertical list - the extra is for the tick
#define DRC_CHOICE_ITEM_ADDITIONAL_WIDTH (40)
#define DRC_LINE_1_Y (10)
#define DRC_LINE_2_Y (DRC_LINE_1_Y + DRC_LINE_HEIGHT)
#define DRC_LINE_3_Y (DRC_LINE_2_Y + DRC_LINE_HEIGHT)
#define DRC_LINE_4_Y (DRC_LINE_3_Y + DRC_LINE_HEIGHT)
#define DRC_LINE_5_Y (DRC_LINE_4_Y + DRC_LINE_HEIGHT)
#define DRC_LINE_6_Y (DRC_LINE_5_Y + DRC_LINE_HEIGHT)
#define DRC_LINE_7_Y (DRC_LINE_6_Y + DRC_LINE_HEIGHT)
#define DRC_LINE_8_Y (DRC_LINE_7_Y + DRC_LINE_HEIGHT)
#define MAX_VOLUME 150
#define NUM_SPEED_SLIDER_STEPS 16
#define NUM_THRESHOLD_SLIDER_STEPS 16
/**************************************************************************
* Utility functions
***************************************************************************/
/**************************************************************************
* Operation functions
***************************************************************************/
// The function to handle MODE CHOICE operations:
static MS_OP _ModeChoiceOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static UINT16 _SpeedAttackSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
static UINT16 _SpeedReleaseSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
static UINT16 _RangeAttackSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
static UINT16 _RangeReleaseSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
static void _ModeChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue);
/**************************************************************************
* Display functions
***************************************************************************/
//
// PARAMETER DECLARATIONS
//
static CONST MS_PARAM_HSLIDER oSpeedAttackSliderParams =
{
1, /* mwMinValue */ 16, /* mwMaxValue */
7, /* mwCurrValIndex */ 1 /* mwStepIndex */
};
static CONST MS_PARAM_HSLIDER oSpeedReleaseSliderParams =
{
1, /* mwMinValue */ 16, /* mwMaxValue */
7, /* mwCurrValIndex */ 1 /* mwStepIndex */
};
static CONST MS_PARAM_HSLIDER oRangeAttackSliderParams =
{
1, /* mwMinValue */ 16, /* mwMaxValue */
7, /* mwCurrValIndex */ 1 /* mwStepIndex */
};
static CONST MS_PARAM_HSLIDER oRangeReleaseSliderParams =
{
1, /* mwMinValue */ 16, /* mwMaxValue */
7, /* mwCurrValIndex */ 1 /* mwStepIndex */
};
// Choices
#define DRC_MODE_LIST_ITEMS 2
#define DRCMODE_ANTI_CLIPPING 0
#define DRCMODE_DYNAMIC_RANGE 1
static CONST MS_CHOICE_DATA aDrcModeTable[DRC_MODE_LIST_ITEMS] =
{
{DRCMODE_ANTI_CLIPPING, S_ANTI_CLIPPING},
{DRCMODE_DYNAMIC_RANGE, S_DYNAMIC_RANGE}
};
// VLISTS
#define MAX_VLIST_VALUES DRC_MODE_LIST_ITEMS
static CONST MS_PARAM_VLIST oValueVListParam = {
0, // Total number of items in the list.
0, // Index of the first item.
MAX_VLIST_VALUES, // Number of visible items.
0, // mcItemOffset
0
};
/**************************************************************************
* DESCRIPTORS
***************************************************************************/
// This is the descriptor used to generate each list item object:
static CONST MS_DESCRIPTOR_LISTITEM oValueListItemDescriptor =
{// MS_DESCRIPTOR
{
sizeof(MSO_LISTITEM),
MS_NAV_TO_ALGINED_Y,
MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_0,
{
0, 0, 0, DRC_LINE_HEIGHT
},
ListItemOperation,
ListItemFillOSDSeg,
mpParamNull
}
};
/**************************************************************************/
// The descriptor for the vertical list object:
static CONST MS_DESCRIPTOR_VLIST oValueVListDescriptor =
{ // Container descriptor start
{// Descriptor start
sizeof(MSO_VLIST),
MS_NAV_CONTAINER_WRAP_UD | MS_NAV_DISABLE_LR | MS_NAV_CONTAINER_GOTO_PREV_FOCUS | MS_NAV_CONTAINER_GOTO_SELECTED,
MS_ATTR_CONTAINER | MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_1 | MS_ATTR_INVISIBLE,
{
DRC_COL_3_X,
DRC_LINE_2_Y,
DRC_CHOICE_WIDTH + DRC_CHOICE_ITEM_ADDITIONAL_WIDTH,
(DRC_LINE_HEIGHT * MAX_VLIST_VALUES)
},
VListOperation,
VListFillOSDSeg,
(UINT8*)&oValueVListParam
},// Descriptor end
maContentsNull,
mwNbrContentsNull,
};
/**************************************************************************/
// This is the descriptor for the MODE choice:
static CONST MS_DESCRIPTOR_CHOICE oModeChoiceDescriptor =
{ // MS_DESCRIPTOR_CHOICE
{ // MS_DESCRIPTOR
sizeof(MSO_CHOICE),
MS_NAV_NULL,
MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_0 |
MS_ATTR_CHOICE_NO_NAME_DISPLAY |
MS_ATTR_CHOICE_DISPLAY_BG_BMP | MS_ATTR_CHOICE_OPEN_ON_RIGHT_PRESS,
{
DRC_COL_2_X,
DRC_LINE_2_Y,
DRC_CHOICE_WIDTH,
DRC_LINE_HEIGHT
},
_ModeChoiceOperation,
ChoiceFillOSDSeg,
(UINT8*)NULL
},
(MS_DESCRIPTOR_LISTITEM*)&oValueListItemDescriptor,
NULL, // mName
DRC_MODE_LIST_ITEMS,
(MS_CHOICE_DATA*)&aDrcModeTable,
CIDX_8,
CIDX_8,
CIDX_6,
BMP_BG_3,
_ModeChoiceAction // mpfMutator
};
/**************************************************************************/
// The descriptor for the SPEED ATTACK control slider:
static CONST MS_DESCRIPTOR_HSLIDER oSpeedAttackSliderDescriptor =
{
{
sizeof(MSO_HSLIDER),
MS_NAV_NULL,
MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_0,
{
DRC_COL_3_X,
DRC_LINE_3_Y,
DRC_COL_3_WIDTH,
DRC_LINE_HEIGHT
},
HSliderOperation,
HSliderFillOSDSeg,
(UINT8*)&oSpeedAttackSliderParams
},
HSLIDER_BAR_HEIGHT,
HSLIDER_BAR_WIDTH,
HTAB_HEIGHT,
HTAB_WIDTH,
HS_HIGHLIGHT_ON_TAB,
FALSE, // bDisplayCurrentValue
TRUE, // bDisplayMinAndMaxValues
_SpeedAttackSliderAction
};
/**************************************************************************/
// The descriptor for the SPEED RELEASE control slider:
static CONST MS_DESCRIPTOR_HSLIDER oSpeedReleaseSliderDescriptor =
{
{
sizeof(MSO_HSLIDER),
MS_NAV_NULL,
MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_0,
{
DRC_COL_3_X,
DRC_LINE_4_Y,
DRC_COL_3_WIDTH,
DRC_LINE_HEIGHT
},
HSliderOperation,
HSliderFillOSDSeg,
(UINT8*)&oSpeedReleaseSliderParams
},
HSLIDER_BAR_HEIGHT,
HSLIDER_BAR_WIDTH,
HTAB_HEIGHT,
HTAB_WIDTH,
HS_HIGHLIGHT_ON_TAB,
FALSE, // bDisplayCurrentValue
TRUE, // bDisplayMinAndMaxValues
_SpeedReleaseSliderAction
};
/**************************************************************************/
// The descriptor for the RANGE ATTACK control slider:
static CONST MS_DESCRIPTOR_HSLIDER oRangeAttackSliderDescriptor =
{
{
sizeof(MSO_HSLIDER),
MS_NAV_NULL,
MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_0,
{
DRC_COL_3_X,
DRC_LINE_5_Y,
DRC_COL_3_WIDTH,
DRC_LINE_HEIGHT
},
HSliderOperation,
HSliderFillOSDSeg,
(UINT8*)&oRangeAttackSliderParams
},
HSLIDER_BAR_HEIGHT,
HSLIDER_BAR_WIDTH,
HTAB_HEIGHT,
HTAB_WIDTH,
HS_HIGHLIGHT_ON_TAB,
FALSE, // bDisplayCurrentValue
TRUE, // bDisplayMinAndMaxValues
_RangeAttackSliderAction
};
/**************************************************************************/
// The descriptor for the RANGE RELEASE control slider:
static CONST MS_DESCRIPTOR_HSLIDER oRangeReleaseSliderDescriptor =
{
{
sizeof(MSO_HSLIDER),
MS_NAV_NULL,
MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_0,
{
DRC_COL_3_X,
DRC_LINE_6_Y,
DRC_COL_3_WIDTH,
DRC_LINE_HEIGHT
},
HSliderOperation,
HSliderFillOSDSeg,
(UINT8*)&oRangeReleaseSliderParams
},
HSLIDER_BAR_HEIGHT,
HSLIDER_BAR_WIDTH,
HTAB_HEIGHT,
HTAB_WIDTH,
HS_HIGHLIGHT_ON_TAB,
FALSE, // bDisplayCurrentValue
TRUE, // bDisplayMinAndMaxValues
_RangeReleaseSliderAction
};
static CONST OSD_TEXT oOkText =
{ OSDR_GetFormUniStr_OsdMessage, (UINT32)S_OK };
static CONST MS_DESCRIPTOR_BUTTON oDRCOKButtonDescriptor =
{// MS_DESCRIPTOR
{
{
sizeof(MSO_BUTTON),
MS_NAV_TO_ALGINED_Y,
MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_0 | MS_ATTR_RADIO_BUTTON,
{
150,
DRC_LINE_8_Y,
100,
DRC_LINE_HEIGHT
},
OBUTTON_Operation,
OBUTTON_FillOSDSeg,
mpParamNull
},
(MS_X_Y_ALIGN *)&oButtonTextXYAlign,
(MS_COLOR_SET *)&oButtonTextColorSet,
(MS_BITMAP_SET *)&oButtonBitmapSet,
(OSD_TEXT *) &oOkText,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -