📄 o_karaoke.c
字号:
// Post-processing
switch(MsOp)
{
case MS_OP_INIT: // Fall Through !!!
case MS_OP_REFRESH:
{
if((FALSE == CoreAPI_IsKaraokeOn()) || !CoreAPI_IsDVDVideoKaraokeDisc())
{
MS_SET_CHOICE_DISABLE(pThis);
MS_DisplayAddObject(pThis);
}
else
{
MS_CLEAR_CHOICE_DISABLE(pThis);
MS_DisplayAddObject(pThis);
}
}
return MS_OP_NONE;
default:
break;
}
return MsOp;
}
#endif // D_VOCAL_SUPPORT_ENABLED
/***************************************************************************************
* Display functions
****************************************************************************************/
/***************************************************************************************
* Function : _KaraokeFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_KARAOKE display function.
****************************************************************************************/
#pragma argsused
static BOOL _KaraokeFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
MS_DESCRIPTOR_KARAOKE* pDescriptor = (MS_DESCRIPTOR_KARAOKE*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Choice item action functions
****************************************************************************************/
/***************************************************************************************
* Function : _KaraokeOnOffChoiceAction
*
* In : pthis =
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Karaoke on off choice action function.
****************************************************************************************/
#pragma argsused
STATIC void _KaraokeOnOffChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
if(eMutatorGet == eType)
{
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_IsKaraokeOn());
}
else
{
CoreAPI_UpdatePlayerSetting((UINT16)((PS_UPDATE_SAVE_FLAG>>PS_ACTION_SHIFT) |PS_UPDATE_KARAOKE_SETTING), wValue);
}
}
/***************************************************************************************
* Function : _LRModeChoiceAction
*
* In : pthis =
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Karaoke LR Mode choice action function.
****************************************************************************************/
#ifdef D_KARAOKE_LRMODE
#pragma argsused
STATIC void _LRModeChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
if(eMutatorGet == eType)
{
if (TRUE ==CoreAPI_IsKaraokeOn())
{
#ifdef D_KARAOKE_LR_PARAM_UPDATE
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetKaraokeLR());
#else
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetDMM());
#endif
}
else
{
#ifdef D_KARAOKE_LR_PARAM_UPDATE
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, KARAOKE_LR_STEREO);
#else
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, DMM_SETTING_NORMAL);
#endif
}
}
else
{
// Update the Dual-mono setting.
#ifdef D_KARAOKE_LR_PARAM_UPDATE
CoreAPI_UpdatePlayerSetting(PS_UPDATE_KARAOKE_LR_MODE, wValue);
#else
CoreAPI_UpdatePlayerSetting(PS_UPDATE_DMM_SETTING, wValue);
#endif//D_KARAOKE_LR_PARAM_UPDATE
}
}
#endif//D_KARAOKE_LRMODE
/***************************************************************************************
* Function : _KeyShiftSliderAction
*
* In : eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Key shift choice action function.
****************************************************************************************/
#pragma argsused
STATIC UINT16 _KeyShiftSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
if(HS_ACTION_GET == eType)
{
// Convert hardware value to slider value
if((TRUE ==CoreAPI_IsKaraokeOn())
#ifdef D_KARAOKE_MIC_EFFECT
&& (KAR_MIC_EFFECT_HARMONY != CoreAPI_GetKarmiceEffect())
#endif
)
wValue = (UINT16)_CalculateKeyShift((int)CoreAPI_GetKarKeyShift());
else
wValue = (UINT16)_CalculateKeyShift((int)ADP_KAR_DEFAULT_KEY_SHIFT_PAR);
}
else
{
int iKeyShift = aKeyShiftStages[wValue];
CoreAPI_UpdatePlayerSetting(PS_UPDATE_KARKEYSHIFT_SETTING, iKeyShift);
}
return wValue;
}
/***************************************************************************************
* Function : _EchoSliderAction
*
* In : eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Echo choice action function.
****************************************************************************************/
#pragma argsused
STATIC UINT16 _EchoSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
if(HS_ACTION_GET == eType)
{
// Convert hardware value to slider value
if(TRUE == CoreAPI_IsKaraokeOn())
wValue = (UINT16)_CalculateEcho((int)CoreAPI_GetKarEchoDelay());
else
wValue = (UINT16)_CalculateEcho((int)ADP_KAR_DEFAULT_ECHO_PAR);
}
else
{
// Scale the UI value to hardware range
int iEcho = ((int)wValue * HW_MAX_ECHO_DELAY) / ECHO_SLIDER_MAX_VALUE;
// Send the new value to the core.
CoreAPI_UpdatePlayerSetting( PS_UPDATE_KARECHODELAY_SETTING, iEcho);
}
return wValue;
}
/***************************************************************************************
* Function : _VoiceCancelChoiceAction
*
* In : pthis =
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Voice Cancel on off choice action function.
****************************************************************************************/
#pragma argsused
STATIC void _VoiceCancelChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
if(eMutatorGet == eType)
{
if (TRUE ==CoreAPI_IsKaraokeOn())
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetVoiceCanel());
else
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, VOICE_CANCEL_SETTING_OFF);
}
else
{
CoreAPI_UpdatePlayerSetting(PS_UPDATE_VOICE_CANCEL_SETTING, wValue);
// Voice Cancel and Vocal Effect are mutually exclusive. just allowed one to set to on state.
if (VOICE_CANCEL_SETTING_OFF != wValue)
{
if (CoreAPI_IsDVDVideoKaraokeDisc()
&& KAR_AC3_SETTING_NOVOCAL != CoreAPI_GetAC3KarVocal())
{
CoreAPI_UpdatePlayerSetting(PS_UPDATE_KAR_AC3_VOCAL_SETTING, KAR_AC3_SETTING_NOVOCAL);
MS_SendOperation((MSO_OBJECT __NEAR*)MS_GetParentPtr(pThis), MS_OP_REFRESH, 0);
}
}
}
}
/***************************************************************************************
* Function : _MelodyChoiceAction
*
* In : pthis =
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Melody on off choice action function.
****************************************************************************************/
#ifdef D_KARAOKE_MELODY
#pragma argsused
STATIC void _MelodyChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
if(eMutatorGet == eType)
{
if(CoreAPI_IsDVDVideoKaraokeDisc() && TRUE ==CoreAPI_IsKaraokeOn())
{
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetAC3KarMel());
}
else
{
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, KAR_AC3_MELODY_SETTING_OFF);
}
}
else
{
if(CoreAPI_IsDVDVideoKaraokeDisc())
{
CoreAPI_UpdatePlayerSetting(PS_UPDATE_KAR_AC3_MEL_SETTING, wValue);
}
}
}
#endif//D_KARAOKE_MELODY
/***************************************************************************************
* Function : _MicEffectChoiceAction
*
* In : pthis =
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Mic Effect choice action function.
****************************************************************************************/
#ifdef D_KARAOKE_MIC_EFFECT
#pragma argsused
STATIC void _MicEffectChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
if(eMutatorGet == eType)
{
if (TRUE ==CoreAPI_IsKaraokeOn())
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetKarmiceEffect());
else
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, KAR_MIC_EFFECT_OFF);
}
else
{
if ((ADP_KAR_DEFAULT_KEY_SHIFT_PAR != CoreAPI_GetKarKeyShift())
&& (KAR_MIC_EFFECT_HARMONY == wValue))
return;
CoreAPI_UpdatePlayerSetting(PS_UPDATE_MIC_EFFECT, wValue);
}
}
#endif//D_KARAOKE_MIC_EFFECT
/***************************************************************************************
* Function : _VocalEffectChoiceAction
*
* In : pthis =
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The vocal effect choice action function.
****************************************************************************************/
#ifdef D_VOCAL_SUPPORT_ENABLED
#pragma argsused
STATIC void _VocalEffectChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
if(eMutatorGet == eType)
{
if(CoreAPI_IsDVDVideoKaraokeDisc() && TRUE ==CoreAPI_IsKaraokeOn())
{
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, CoreAPI_GetAC3KarVocal());
}
else
{
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis,VOICE_CANCEL_SETTING_OFF);
}
}
else
{
if(CoreAPI_IsDVDVideoKaraokeDisc())
{
CoreAPI_UpdatePlayerSetting(PS_UPDATE_KAR_AC3_VOCAL_SETTING, wValue);
// Voice Cancel and Vocal Effect are mutually exclusive. just allowed one to set to on state.
if( KAR_AC3_SETTING_NOVOCAL != wValue )
{
if (VOICE_CANCEL_SETTING_OFF != CoreAPI_GetVoiceCanel())
{
CoreAPI_UpdatePlayerSetting(PS_UPDATE_VOICE_CANCEL_SETTING, VOICE_CANCEL_SETTING_OFF);
MS_SendOperation((MSO_OBJECT __NEAR*)MS_GetParentPtr(pThis), MS_OP_REFRESH, 0);
}
}
}
}
}
#endif//D_VOCAL_SUPPORT_ENABLED
/***************************************************************************************
* Public functions
****************************************************************************************/
/***************************************************************************************
* Function : OKARAOKE_OpenAtPos
*
* In : pParent = Pointer to the parent container.
*
* wStartX = X position of the component. The default position (specified in the
* descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
* wStartY = Y position of the component.The default position (specified in the
* descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
* Out : None.
*
* Return : Pointer to the karaoke componet if opened successfully, otherwise NULL.
*
* Desc : Creates, and displays a karaoke component.
****************************************************************************************/
MSO_OBJECT __NEAR* OKARAOKE_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
if((NULL != pParent) && CoreAPI_IsMenuAllowedKaraoke())
{
MSO_OBJECT __NEAR* pKaraokeWnd = NULL;
pKaraokeWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oKaraokeDescriptor, pParent);
if(NULL != pKaraokeWnd)
{
if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
{
wStartX = (DEFAULT_POSITION == wStartX) ? pKaraokeWnd->mpDescriptor->moArea.msX : wStartX;
wStartY = (DEFAULT_POSITION == wStartY) ? pKaraokeWnd->mpDescriptor->moArea.msY : wStartY;
MS_ObjectMove(pKaraokeWnd, wStartX, wStartY);
}
MS_DisplayAddObject(pKaraokeWnd);
}
return pKaraokeWnd;
}
return NULL;
}
#endif // INTERNAL_KARAOKE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -