📄 am_app_logic_processor_main.cc
字号:
/* If tone type is set to invalid, then we don't need to do any further processing * of these tones. This ensures that, no extraneous processing happens in this * scenario leading to clicks during key presses for AUL. */ if (tone.type == DL_AUDIO_TONE_TYPE_INVALID_TONE) { return; } // determine audio path: UI, Key tone, Alert tone, or Network tone path_type = get_path (tone); // If the alert type is vibrate, we are going to set the path_type // to phantom_tone so that it will have the least priority. // Since we do this for both with or without MFT, we can remove // any conditional compiles if (isVibAlert(tone.fields.id)) { path_type = AM_AUDIO_PATH_ID_PHANTOM_TONE; } if (DL_DbGetFeatureAvailability(DL_DB_FEATURE_ID_ALERT_RAMP_UP_AVAILABLE)) { if (isMultimediaAlert(tone.fields.id) || (path_type == AM_AUDIO_PATH_ID_PHANTOM_TONE) || (path_type == AM_AUDIO_PATH_ID_ALERT_LITE)) { if(volstep == INVALID_VOLUME_STEP) { /* Need temporary info_ptr here because of interface change to * get_volume_step(). get_volume_step() now accepts an info_ptr. */ AM_AUDIO_INFO temp_info; temp_info.path_type = path_type; temp_info.tone.type = tone.type; volstep = relay_layer.get_volume_step ( &temp_info ); } } //check to see if a tone with the phantom path is on the queue. The phantom tone stores the applied //volume for multimedia alerts. phantom_tone = eventqueuehandler.FindItem((UINT8)AM_AUDIO_PATH_ID_PHANTOM_TONE); if (isMultimediaAlert(tone.fields.id)) { if (phantom_tone != NULL) { //Set the volume of this tone to the volume stored in the phantom tone applied_vol = phantom_tone->AppliedVol; } else { //If there is no phantom tone on the queue, this is the start of the MM alert if (volstep > ALERT_RAMP_UP_START_VOLUME) { applied_vol = ALERT_RAMP_UP_START_VOLUME; } } } //Start the timer when we get a start request for phantom tone or CTG else if ((path_type == AM_AUDIO_PATH_ID_PHANTOM_TONE) || (path_type == AM_AUDIO_PATH_ID_ALERT_LITE)) { if (volstep > ALERT_RAMP_UP_START_VOLUME) { applied_vol = ALERT_RAMP_UP_START_VOLUME; } if (!alert_ramp_timer.IsActive()) { am_timer_handler.Start(&alert_ramp_timer); } } } #if (AUDIO_TDMA == TRUE) // Below checking is a heck. Hopefully take this part out some time if (path_type == AM_AUDIO_PATH_ID_ALERT_LITE) { if (relay_layer.is_incall()) { aud_tone_cnf(tone.type, sequenceID); tone.type = DL_AUDIO_TONE_TYPE_INCALL_SMS_ALERT; tone.fields.one_shot = 1; path_type = AM_AUDIO_PATH_ID_KEY_LITE; } }#endif#if (AUDIO_RAINBOW == TRUE) //silent_all_output feature id is set when the user selects allow alerts = no //and we are doing video capture. if set, only allow the video capture tone. DL_DbFeatureGetCurrentState (DL_DB_FEATURE_ID_SILENT_ALL_OUTPUT, &silent_all_output); if ((silent_all_output == DL_DB_FEATURE_STATE_TRUE) && (tone.type != DL_AUDIO_TONE_TYPE_MULTIMEDIA_CAPTURE) && (tone.type != DL_AUDIO_TONE_TYPE_VOICE)) { //don't push the tone on the queue path_type = AM_AUDIO_PATH_ID_INVALID_TONE; }#endif /* Feature 10223 : We don't want to queue the silent alert requests. We will * immediately send a tone cnf and set the path to invalid. */ if (tone.fields.id == DL_AUDIO_TONE_TYPE_ALERT_SILENT) { /* DL_AUDIO will send a silent alert even when no alert should be played -- * therefore, instead of playing silent, we'll just play nothing and send * an ACK immediately without queuing the tone */ aud_tone_cnf(tone.type, sequenceID); path_type = AM_AUDIO_PATH_ID_INVALID_TONE; } if ( path_type != AM_AUDIO_PATH_ID_INVALID_TONE ) { eventqueuehandler.Push (tone, path_type, sequenceID, volstep, vibrate_type, uplink, media_info, applied_vol, sampling_rate); } /* Once the vibrate tone is pushed onto the queue, we want to start the vibrate. The * idea is that, we shouldn't have to wait till vibrate gets to the top of the queue * to be able to play it. This also helps in the case of feature 10223 where we want * the BG audio to conexist with the incoming alert vibrate. */ if (isVibAlert(tone.fields.id)) { Tone_Item* vib_item = eventqueuehandler.FindItem(tone.type, sequenceID);#if (MAKE_FTR_MFT_SUPPORT == FALSE) primitive_builder.am_turn_vibrator_on(tone, vibrate_type, vib_item->DSPSequenceID);#else if (!is_MFT_Available) { primitive_builder.am_turn_vibrator_on(tone, vibrate_type, vib_item->DSPSequenceID); }#endif } } // if some tone is to be continuing played (music or vib-then-ring) else if ((tone.fields.rerun == 1) && (request == AUD_TONE_COMPLETE)) { if (cur_tone_ptr != NULL && cur_tone_ptr->SequenceID == sequenceID) { rerun = 1; } } else if (request == AUD_TONE_RENEW) { eventqueuehandler.RenewItem(eventqueuehandler.FindItem(tone.type, sequenceID)); } // if the tone is finished... else if (request != AUD_TONE_UPDATE) { Tone_Item* removed_element = eventqueuehandler.FindItem(tone.type, sequenceID); if (removed_element != NULL) { media_info = removed_element->MediaInfo; } tone_removed = eventqueuehandler.Remove (tone.type, sequenceID); if (tone_removed) { /* Screen out phones not supporting HAPI CE bus accy signals. */#if ((MAKE_NEPTUNE_CHIPSET == TRUE && MAKE_HDW_BB_IC != MAKE_HDW_NEPTUNE_LT) \ || (MAKE_NEPTUNE_CHIPSET == FALSE)) /* HAPI_get_power_ic_type() is only defined for C650, an LTS product. */#if (MAKE_HDW_BB_IC == MAKE_HDW_NEPTUNE_LTS) /* The call below will find out if we have seaweed, pcap or atlas ul. */ if (( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_PCAP ) || ( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_AUL ))#endif { //If it is a powerdown tone and MP3 is connected, mute the MP3 player //after the powerdown tone is completed. This is done to avoid the MP3 //from playing during the time between the powerdown tone completion and //the complete power down of the phone. if ( (tone.fields.id == DL_AUDIO_TONE_TYPE_POWERDOWN_LITE) && (is_ext_generated_audio_on_queue == TRUE) ) { hPortConfigure(HAPI_FM_ACC_MUTE_EN); primitive_builder.aud_hPortWrite( HAPI_FM_ACC_MUTE_EN, HAPI_SIGNAL_ENABLE, AM_HW_FM_ACC_MUTE_EN ); is_ext_generated_audio_on_queue = FALSE; fm_muted=TRUE; } }#endif /* If this is a stop request coming in for the Vibrate, we want to stop the vibrate * here because we are not waiting for the vibrate request to get to the top of the * queue to play it. */ if (isVibAlert(tone.fields.id)) { primitive_builder.stop_vibrator(); } aud_tone_cnf(tone.type, sequenceID);#if (MAKE_FTR_MFT_SUPPORT == TRUE) if ((tone.fields.media == 1) || ((DL_DbGetFeatureAvailability(DL_DB_FEATURE_ID_MFT_AVAILABLE)) && (media_info.handle != NULL)))#else if (tone.fields.media == 1)#endif { DL_MMSP_Playback_MediaClose(media_info.handle); mp3_ringer_media_handle_glb = NULL; } if((tone.type == DL_AUDIO_TONE_TYPE_ENDKEY_LITE) && !eventqueuehandler.Exists()) {#if (AUDIO_GSM != TRUE) /* Don't keep muting after END key */ if(DL_AccGetConnectionStatus(DL_ACC_DM_USB_CARKIT) == TRUE) { DL_AudSetMuteAlertState(DL_AUDIO_ENTERTAINMENT_MUTE_TYPE, FALSE); } else #endif if(DL_AccGetConnectionStatus(DL_ACC_DM_CE_BUS_ZIHF) == TRUE) { /* Screen out phones not supporting HAPI CE bus accy signals. */#if ((MAKE_NEPTUNE_CHIPSET == TRUE && MAKE_HDW_BB_IC != MAKE_HDW_NEPTUNE_LT) \ || (MAKE_NEPTUNE_CHIPSET == FALSE)) /* HAPI_get_power_ic_type() is only defined for C650, an LTS product. */#if (MAKE_HDW_BB_IC == MAKE_HDW_NEPTUNE_LTS) /* The call below will find out if we have seaweed, pcap or atlas ul. */ if (( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_PCAP ) || ( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_AUL ))#endif { /*Clear the entertainment mute*/ hPortConfigure(HAPI_FM_ACC_MUTE_EN); /*Active low, so enable = logic 0*/ primitive_builder.aud_hPortWrite( HAPI_FM_ACC_MUTE_EN, HAPI_SIGNAL_ENABLE, AM_HW_FM_ACC_MUTE_EN ); }#endif } } } if ( ( tone.type == DL_AUDIO_TONE_TYPE_RADIO ) || ( tone.type == DL_AUDIO_TONE_TYPE_MP3_PLAYER ) ) { is_ext_generated_audio_on_queue = FALSE; /* Screen out phones not supporting HAPI CE bus accy signals. */#if ((MAKE_NEPTUNE_CHIPSET == TRUE && MAKE_HDW_BB_IC != MAKE_HDW_NEPTUNE_LT) \ || (MAKE_NEPTUNE_CHIPSET == FALSE)) /* HAPI_get_power_ic_type() is only defined for C650, an LTS product. */#if (MAKE_HDW_BB_IC == MAKE_HDW_NEPTUNE_LTS) /* The call below will find out if we have seaweed, pcap or atlas ul. */ if (( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_PCAP ) || ( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_AUL ))#endif { // MUTING THE AUDIO PATH FOR THE DUMB DEVICES // Signal the FM radio or MP3 devices to go into low power mode. hPortConfigure(HAPI_FM_ACC_MUTE_EN); primitive_builder.aud_hPortWrite( HAPI_FM_ACC_MUTE_EN, HAPI_SIGNAL_ENABLE, AM_HW_FM_ACC_MUTE_EN ); fm_muted=TRUE; }#endif } } // AUD_TONE_UPDATE only falls into here, as well as other request types // Don't call update_audio for an invalid stop request. // The stop was invalid if the tone was not on the queue. // The exception -- call the function for all DTMF key requests. if ( !((request == AUD_TONE_STOP) && !tone_removed ) ) { update_audio (rerun); } // If waiting for the tone to stop, recall the initial audio command if((request == AUD_TONE_STOP) && (audVstParams.wait_for_tone_completion == TRUE)) { audVstParams.wait_for_tone_completion = FALSE; if (audVstParams.activity == AUD_VST_CAPTURE_AUDIO) { aud_start_vr_audio_capture_req(audVstParams.frame_num, audVstParams.play_tone); } } return;}#if ((AUDIO_GSM == TRUE) || (AUDIO_TDMA == TRUE))/* DESCRIPTION: Look up gains for headset or handset and send the dai command INPUTS: mode - analog/digital,uplink/downlink vol_step - gain table index to use OUTPUTS: None IMPORTANT NOTES: None*/voidAM_App_Logic_Processor :: generate_dai_command(TD_AUD_TONE_REQ_TONE_TYPE_T mode, TD_AUD_VOLUME_SETTING_T vol_step){ GAIN_STRUCT* gain_table_ptr = 0; UINT8 volume = vol_step; AM_AUDIO_INFO dai_info; UINT8 uplink_source, uplink_dest, downlink_source, downlink_dest; UINT8 device; dai_info.tone.type = DL_AUDIO_TONE_TYPE_INVALID_TONE; dai_info.path_type = AM_AUDIO_PATH_ID_INVALID_TONE; dai_info.dsp_seq = 0; dai_info.ctg_gain = 0; dai_info.echo_mode = ECHO_MODE_HANDSET; dai_info.SAP_config = SAP_DEFAULT_CONFIG; dai_info.instruction_mask = 0; dai_info.tone_insertion_method = 0;#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) ) dai_info.va_vr_command = AM_VA_VR_ABORT_CMD; dai_info.va_vr_data_ptr = NULL;#endif dai_info.phone_mode = ~(1<<AM_HANDSFREE_AUDIO); dai_info.vol_step = vol_step;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -