📄 o_drc.c
字号:
FONT_0,
NULL,
NULL
},
MS_OP_CLOSE_PARENT
};
/**************************************************************************/
#define NBR_DRC_CONTENTS 7
static CONST MS_DESCRIPTOR* CONST apDrcContents[NBR_DRC_CONTENTS] = {
(MS_DESCRIPTOR*)&oModeChoiceDescriptor,
(MS_DESCRIPTOR*)&oSpeedAttackSliderDescriptor,
(MS_DESCRIPTOR*)&oSpeedReleaseSliderDescriptor,
(MS_DESCRIPTOR*)&oRangeAttackSliderDescriptor,
(MS_DESCRIPTOR*)&oRangeReleaseSliderDescriptor,
(MS_DESCRIPTOR*)&oValueVListDescriptor,
(MS_DESCRIPTOR*)&oDRCOKButtonDescriptor,
};
// The descriptor for DRC
extern CONST MS_DESCRIPTOR_DRC oDrcDescriptor =
{
{
{
{
sizeof(MSO_DRC),
MS_NAV_TO_ALGINED_Y | MS_NAV_DISABLE_LR | MS_NAV_DISABLE_UD |
MS_NAV_CONTAINER_WRAP_LR | MS_NAV_CONTAINER_WRAP_UD | MS_NAV_CONTAINER_GOTO_TOP,
MS_ATTR_CONTAINER | MS_ATTR_FOCUSABLE | MS_ATTR_OSD_LAYER_2,
{
0, 0, 0, 0
},
DrcOperation,
DrcFillOSDSeg,
mpParamNull
},
(CONST MS_DESCRIPTOR**)apDrcContents,
NBR_DRC_CONTENTS,
},
(MS_DESCRIPTOR*)&oModeChoiceDescriptor
},
BMP_BG_2,
CIDX_6
};
/**************************************************************************
* Utility functions
***************************************************************************/
int CalcSpeed( int iHwValue )
{
return iHwValue * (NUM_SPEED_SLIDER_STEPS - 1) / MAX_VOLUME;
}
int CalcRange( int iHwValue )
{
return iHwValue * (NUM_THRESHOLD_SLIDER_STEPS - 1) / MAX_VOLUME;
}
/**************************************************************************
* Operation functions
***************************************************************************/
/**************************************************************************
* Function : DrcOperation
*
* In :
*
* Out :
*
* Desc :
***************************************************************************/
MS_OP DrcOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
/**************************************************************************
* Display functions
***************************************************************************/
/**************************************************************************
* Function : DrcFillOSDSeg
*
* In :
*
* Out :
*
* Desc :
***************************************************************************/
BOOL DrcFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
FORMATED_UNICODE_STRING oFormUniStr;
MS_DESCRIPTOR_DRC* pDescriptor = (MS_DESCRIPTOR_DRC*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
oFormUniStr.mtFontIndex = FONT_0;
//DRC label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_DRC);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_1_X,
DRC_LINE_2_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
// The MODE label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_MODE);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_1_X,
DRC_LINE_3_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
// The SPEED label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_SPEED);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_1_X,
DRC_LINE_4_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
// The Speed ATTACK label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_ATTACK);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_2_X + OSDR_AlignmentGetOffsetInObject(ALIGN_H_RIGHT, oFormUniStr.mwPixelWidth, DRC_COL_2_WIDTH),
DRC_LINE_4_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
// The Speed RELEASE label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_RELEASE);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_2_X + OSDR_AlignmentGetOffsetInObject(ALIGN_H_RIGHT, oFormUniStr.mwPixelWidth, DRC_COL_2_WIDTH),
DRC_LINE_5_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
// The THRESHOLD label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_THRESHOLD);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_1_X,
DRC_LINE_6_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
// The Range ATTACK label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_ATTACK);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_2_X + OSDR_AlignmentGetOffsetInObject(ALIGN_H_RIGHT, oFormUniStr.mwPixelWidth, DRC_COL_2_WIDTH),
DRC_LINE_6_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
// The Range RELEASE label
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_RELEASE);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
pAbsArea,
DRC_COL_2_X + OSDR_AlignmentGetOffsetInObject(ALIGN_H_RIGHT, oFormUniStr.mwPixelWidth, DRC_COL_2_WIDTH),
DRC_LINE_7_Y,
ALIGN_H_LEFT,
ALIGN_V_BOTTOM,
pDescriptor->mwTextColor);
return FALSE;
}
/**************************************************************************
* Name : _SpeedAttackSliderAction
* In :
* Out :
* Desc :
***************************************************************************/
static UINT16 _SpeedAttackSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
if(eType == HS_ACTION_SET)
{
CoreAPI_UpdatePlayerSetting( PS_UPDATE_DRC_ATTACK_SPEED, wValue);
}
else
{
#ifdef DIGITAL_AMPLIFIER_ENABLE
wValue = CoreAPI_GetDRCAttackSpeed();
#else
wValue = 1;
#endif
}
return(wValue);
}
/**************************************************************************
* Name : _SpeedReleaseSliderAction
* In :
* Out :
* Desc :
***************************************************************************/
static UINT16 _SpeedReleaseSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
if(eType == HS_ACTION_SET)
{
CoreAPI_UpdatePlayerSetting( PS_UPDATE_DRC_RELEASE_SPEED, wValue);
}
else
{
#ifdef DIGITAL_AMPLIFIER_ENABLE
wValue = CoreAPI_GetDRCReleaseSpeed();
#else
wValue = 1;
#endif
}
return(wValue);
}
/**************************************************************************
* Name : _RangeAttackSliderAction
* In :
* Out :
* Desc :
***************************************************************************/
static UINT16 _RangeAttackSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
if(eType == HS_ACTION_SET)
{
CoreAPI_UpdatePlayerSetting( PS_UPDATE_DRC_ATTACK_RANGE, wValue);
}
else
{
#ifdef DIGITAL_AMPLIFIER_ENABLE
wValue = CoreAPI_GetDRCAttackTheshold();
#else
wValue = 1;
#endif
}
return(wValue);
}
/**************************************************************************
* Name : _RangeReleaseSliderAction
* In :
* Out :
* Desc :
***************************************************************************/
static UINT16 _RangeReleaseSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
if(eType == HS_ACTION_SET)
{
CoreAPI_UpdatePlayerSetting( PS_UPDATE_DRC_RELEASE_RANGE, wValue);
}
else
{
#ifdef DIGITAL_AMPLIFIER_ENABLE
wValue = CoreAPI_GetDRCReleaseTheshold();
#else
wValue = 1;
#endif
}
return(wValue);
}
/**************************************************************************
* Function : _ModeChoiceOperation
* In :
* Out :
* Desc :
***************************************************************************/
static MS_OP _ModeChoiceOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_RIGHT:
// If the choice is closed and the MS_ATTR_CHOICE_OPEN_ON_RIGHT_PRESS,
// then open the choice by falling through to the next case.
if(!MS_IS_CHOICE_OPEN_ON_RIGHT_PRESS(pThis))
{
break;
}
// else FALL THRU
case MS_OP_ENTER:
{
MSO_OBJECT __NEAR* pObject;
MSO_VLIST __NEAR* pValueListObject;
// Get a pointer to the value list object
pValueListObject = (MSO_VLIST __NEAR*)MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)(pThis->mpParent),
(MS_DESCRIPTOR*)&oValueVListDescriptor);
MS_ASSERT(pValueListObject != NULL);
// Set the object to be visible:
MS_ClearInvisible(pValueListObject);
// Clear the value list of anything it might have in it:
MS_SendOperation((MSO_OBJECT __NEAR*)pValueListObject, MS_OP_EMPTY, 0);
// Add the values required for this choice:
pValueListObject->moParam.mdwData = (UINT32)pThis->mpDescriptor;
OCHOICE_AddItemsToVList((MSO_CHOICE __NEAR*)pThis, pValueListObject);
// Set focus to the selected item...
// ... first find the focused item:
pObject = ((MSO_CONTAINER __NEAR*)pValueListObject)->mpOlist;
while((NULL != pObject) && !(MS_IsSelected(pObject)))
{
pObject = pObject->mpNext;
}
MS_ASSERT(pObject != NULL);
// ... then set the focus to it:
MS_ScreenSetFocusObject(pObject);
// Extend the width of the choice object to run behind the list:
pThis->moArea.mwW = pValueListObject->moContainer.moObject.moArea.msX + CHOICE_OVERLAP_VALUELIST_W;
// Redisplay the choice:
MS_DisplayAddObject((MSO_OBJECT __NEAR *)pThis->mpParent);
// This operation has been processed fully:
MsOp = MS_OP_NONE;
}
break;
}
return ChoiceOperation(pThis, MsOp, lParam);
}
/**************************************************************************
* Function :
* In :
* Out :
* Desc :
***************************************************************************/
static void _ModeChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
// The following assumption has been made:
#if ((ANTI_CLIPPING != 0) || (DYNAMIC_RANGE_COMPRESSION != 1))
#error "This code needs re-writing"
#endif
// Which action is required?
if(eMutatorGet == eType)
{
#ifdef DIGITAL_AMPLIFIER_ENABLE
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetDRCMode());
#else // DIGITAL_AMPLIFIER_ENABLE
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, 0);
#endif // DIGITAL_AMPLIFIER_ENABLE
}
else
{
UINT8 cIndex = OCHOICE_GetIndexFromValue(pThis, wValue);
CoreAPI_UpdatePlayerSetting(PS_UPDATE_DRC_MODE, wValue);
pChoice->moParam.mwCurrValIndex = cIndex;
}
}
//#endif // DIGITAL_AMPLIFIER_ENABLE
#endif //D_SETUP_ADVANCED_DRC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -