📄 commonstubs.c
字号:
VibratorThenRing();
break;
case MMI_SILENT:
break;
case MMI_ALERT_NONE:
break;
default:
/* StartRingTone (cm_p->alert_info.RingToneId); */
CMPlayMTRingTone(cm_p->alert_info.RingToneId);
break;
}
PlayPatternCallerGroup((MMI_LEDLIGHT_STATUS_ENUM) cm_p->alert_info.BacklightPatternId);
}
/*****************************************************************************
* FUNCTION
* StopRingtoneOrVibrator
* DESCRIPTION
* This function stops RingTone or Vibrarator depending on Alert Type
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void StopRingtoneOrVibrator(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
if (mmi_bt_is_aud2hf() == MMI_TRUE)
{
mmi_bt_stop_hf_ring_req();
}
#endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */
switch (cm_p->alert_info.AlertType)
{
case MMI_RING:
StopRingTone(cm_p->alert_info.RingToneId);
break;
case MMI_VIBRATION_ONLY:
VibratorOff();
break;
case MMI_VIBRATION_AND_RING:
StopRingTone(cm_p->alert_info.RingToneId);
VibratorOff();
break;
case MMI_VIBRATION_THEN_RING:
/* NSC Does not make the mobile go back into Silent Mode */
StopTimer(CM_ALERT_NOTIFYDURATION_TIMER);
VibratorOff();
StopRingTone(cm_p->alert_info.RingToneId);
break;
case MMI_SILENT:
break;
case MMI_ALERT_NONE:
break;
default:
break;
}
StopPatternCallerGroup((MMI_LEDLIGHT_STATUS_ENUM) cm_p->alert_info.BacklightPatternId);
}
#ifdef __MMI_INTELLIGENT_CALL_ALERT__
U16 intelligent_call_alert_ring_tone;
U8 is_intelligent_call_alert_playing_text = 0;
/*****************************************************************************
* FUNCTION
* PlayIncomingCallTextHandler
* DESCRIPTION
*
* PARAMETERS
* result [IN]
* RETURNS
* void
*****************************************************************************/
void PlayIncomingCallTextHandler(mdi_result result)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
is_intelligent_call_alert_playing_text = 0;
if (result == MDI_AUDIO_END_OF_FILE)
{
AudioPlayToneWithCallBack(intelligent_call_alert_ring_tone, GetRingTypeEnum(), INCOMING_CALL_TONE);
}
}
#endif /* __MMI_INTELLIGENT_CALL_ALERT__ */
/*****************************************************************************
* FUNCTION
* StartRingTone
* DESCRIPTION
* This function statrs the ringtone
*
* This is a part of other hardware application.
* PARAMETERS
* ringTone [IN]
* ringtone(?) [IN] Index
* RETURNS
* void
*****************************************************************************/
void StartRingTone(U16 ringTone)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (ringTone < MAX_TONE_ID)
{
AudioPlayToneWithCallBack(ringTone, GetRingTypeEnum(), INCOMING_CALL_TONE);
}
else if (!IsSilentModeActivated())
{
#ifdef __MMI_INTELLIGENT_CALL_ALERT__
U16 text[(MAX_NAME + MAX_CM_NUMBER) / 2 + 1];
U16 count;
S32 text_len;
MMI_INTELLIGENT_CALL_ALERT_TYPE isIntelligentCallAlertOn = GetIntelligentCallAert();
if (isIntelligentCallAlertOn == MMI_INTELLIGENT_CALL_ALERT_ON)
{
for (count = 0; count < MAX_CALLS; count++)
{
if (CM_INCOMING_STATE == cm_p->state_info.AllCalls[count].curr_state)
{
text[0] = 0;
#ifdef DIGIT_TONE_SUPPORT
pfnUnicodeStrcpy((S8*) text, (S8*) cm_p->state_info.AllCalls[count].number);
#endif
#if defined(SIMPLE_TTS) || defined(DIGIT_TONE_SUPPORT)
pfnUnicodeStrcat((S8*) text, (S8*) cm_p->state_info.AllCalls[count].pBname);
#endif
text[(MAX_NAME + MAX_CM_NUMBER) / 2] = 0;
break;
}
}
text_len = pfnUnicodeStrlen((S8*) text);
if (text_len > 0 &&
mdi_audio_play_text_with_vol_path(
(U8*) text,
pfnUnicodeStrlen((S8*) text),
100,
NULL,
PlayIncomingCallTextHandler,
GetRingVolumeLevel(),
MDI_DEVICE_SPEAKER_BOTH) == MDI_AUDIO_SUCCESS)
{
intelligent_call_alert_ring_tone = ringTone;
is_intelligent_call_alert_playing_text = 1;
}
else
{
AudioPlayToneWithCallBack(ringTone, GetRingTypeEnum(), INCOMING_CALL_TONE);
}
}
else
#endif /* __MMI_INTELLIGENT_CALL_ALERT__ */
AudioPlayToneWithCallBack(ringTone, GetRingTypeEnum(), INCOMING_CALL_TONE);
/* AudioPlayReq(ringTone,GetRingTypeEnum()); */
}
}
/*****************************************************************************
* FUNCTION
* StopRingTone
* DESCRIPTION
* This function stops the ringtone
*
* This is a part of other hardware application.
* PARAMETERS
* ringTone [IN]
* RETURNS
* void
*****************************************************************************/
void StopRingTone(U16 ringTone)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (ringTone < MAX_TONE_ID)
{
#ifdef __MMI_INTELLIGENT_CALL_ALERT__
if (is_intelligent_call_alert_playing_text)
{
mdi_audio_stop_all();
}
else
#endif /* __MMI_INTELLIGENT_CALL_ALERT__ */
AudioStopReq(ringTone);
}
else
{
mdi_audio_stop_all();
}
}
/*****************************************************************************
* FUNCTION
* VibratorThenRing
* DESCRIPTION
* This function is called for Vibrator Then Ring indication
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void VibratorThenRing(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
VibratorOn();
StartTimer(CM_ALERT_NOTIFYDURATION_TIMER, VIB_THEN_RING_DURATION, StopVibratorPlayRing);
}
/*****************************************************************************
* FUNCTION
* StopVibratorPlayRing
* DESCRIPTION
* This function is called for StopVibrator PlayRing
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
#ifdef __MMI_INCOMING_CALL_VIDEO__
extern void EnableCategory17Audio(void);
#endif
void StopVibratorPlayRing(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
StopTimer(CM_ALERT_NOTIFYDURATION_TIMER);
VibratorOff();
/* StartRingTone (cm_p->alert_info.RingToneId); */
#ifdef __MMI_INCOMING_CALL_VIDEO__
if (cm_p->alert_info.RingToneId == CM_RINGTONE_VIDEO)
{
/* turn on audio path */
EnableCategory17Audio();
SetRingAfterVibFlag(TRUE);
}
#endif /* __MMI_INCOMING_CALL_VIDEO__ */
CMPlayMTRingTone(cm_p->alert_info.RingToneId);
}
/*****************************************************************************
* FUNCTION
* PlayConnectNotice
* DESCRIPTION
* This function is wrapper to Play Ring Tone
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
#ifdef __MMI_CONNECT_NOTICE__
void PlayConnectNotice(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (GetConnectNoticeType())
{
case MMI_NOTICE_NONE:
break;
case MMI_NOTICE_TONE_ONLY:
playRequestedTone(CONNECT_TONE);
break;
case MMI_NOTICE_VIB_ONLY:
PlayVibratorOnce();
break;
case MMI_NOTICE_TONE_AND_VIB:
playRequestedTone(CONNECT_TONE);
PlayVibratorOnce();
break;
}
}
#endif /* __MMI_CONNECT_NOTICE__ */
/*****************************************************************************
* FUNCTION
* GetRingAfterVibFlag
* DESCRIPTION
* This function returns state of alerts
*
* This is a part of other hardware application.
* PARAMETERS
* void
* TRUE(?) [OUT] Or FALSE
* RETURNS
* pBOOL
*****************************************************************************/
pBOOL GetRingAfterVibFlag(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return cm_p->alert_info.IsRingAfterVib;
}
/*****************************************************************************
* FUNCTION
* SetRingAfterVibFlag
* DESCRIPTION
* This function checks to see if need to ring again
* PARAMETERS
* truth [IN]
* TRUE(?) [OUT] Or FALSE
* RETURNS
* pBOOL(?)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -