📄 am_hw_primitive_builder_tone.cc
字号:
/* (c) Copyright Motorola 1996-2005, All rights reserved. Motorola Confidential Proprietary Contains confidential proprietary information of Motorola, Inc. Reverse engineering is prohibited. The copyright notice does not imply publication. DESCRIPTION: File contains functions to assemble correct tone generation data based on incoming tone. *************** REVISION HISTORY ********************************************* Date Author Reference ======== ======== ========================== 2005-03-24 w17860 CR - LIBff73690 Feature 10223 : Background audio feature interactions 2005-02-22 w16355 LIBff67536 LIBff29422 Causing Keytone Mismatch. 2005-02-04 w16355 LIBff29422 New Tones for PTV feature MRS 11685. 2004-11-30 abp095 LIBff40008 Tioman compiler not needed for some MME files 2004-11-15 abp095 LIBff32598 Add Tioman conditional compile for MME Component 04-09-13 aja099 CR - LIBff06524 Added LKeyVol for DL_AUDIO_TONE_TYPE_VOLUMEKEY_MULTIMEDIA_LITE 2004-06-30 w16355 LIBee24052 PTT tones too loud using internal speaker against ear. - The frequency of the Floor Availible tone was 2349 Hz, and due to the frequency response of the earpiece speaker, made it seem much louder than other tones at lower frequencies. Per David Brenner from CXD, we lowered the tone by one octave. 2004-06-30 w16355 LIBee09318 Barge Alert routed thru earpiece instead of alerter. - Need to duplicate the first tone of a PTT session as an alert so that the initial tone will always be heard. 2004-06-30 w16355 CR - LIBee06713 Voice clipped immediatly after PTT floor control tones. - Removed long rests following PTT tone sequences for one-shot tones. 2004-06-29 w16355 CR - LIBdd64962 V400: PTT: Need new tones for push to talk. 04-05-20 w18944 CR - LIBee10277 Local ringback tone is stopped when WAV UI gets played 04-02-09 a18984 CR - LIBdd74277 Send SAP_CONFIG and TONE_CONTROL Messages to DSP in MFT interface function 04-01-08 a18984 CR - LIBdd65899 Need interface function support for MFT in V220 for Test Command 03-12-01 w16355 CR - LIBdd64880 FM radio not unmuted after ignored MT call in Silent mode. - Send a tone finished verification to the DL immediately in silent mode only if the tone is a one shot. 03-10-15 w16355 CR - LIBdd43633 New stereo headset detection AM sw to support new hardware. - Added code to start playing a tone when the stereo headset is detected and to tell Rtime so that they can determine if the headset is truly stereo or mono. We also tell Rtime when the tone is complete, simulating a crude timer so Rtime knows when to stop. 03-08-15 w18944 CR - LIBbb26383 Added 2 new general beep tones 02-11-06 qcf001 CR - LIBbb65609 Added 4 tones for Sim toolkit 02-08-23 stlee LIBbb50962 Move audio files to /a/motorola/audio and support long file name 02-20-02 stlee LIBbb31207 Audio ROM savings for T720 02-03-26 w18944 LIBaa05162 Add multimedia ui tones 02-06-24 brb032 CR - LIBbb40692 Increase customize tone. 02-05-15 r58514 CR - LIBbb29284 LCA: Take out 15 alert tones to external flash (in file am_tables.c) 02-05-13 w17860 LIBbb30929 Update 'Uh-oh' ringtone 02-13-02 w17860 LIBbb23208 1.2.1:DTMF tones beep twice on mobile side (transmitted OK) 02-01-08 qcf001 LIBbb16169 Merge volume_key_lite tone from R1.1.1 02-02-17 bmd031 CR - LIBbb20411 02-02-25 brl022 CR - LIBbb21281 add MyTone DB to LCA phone 02-02-02 ktang CR - LIBbb10803 midi support 01-12-20 ktang CR - LIBbb13753 Audio Media Request Redirection 01-12-23 byr003 LIBbb15362 - LCA catchup for R1.2.1 01-11-21 mvance LIBbb12966 Fix DTMF tone powerdowns - fix length calculation in build_tone_old function 01-10-30 byl034 CR - LIBbb10045 Fix the bug that caused warning: C2917W: no side effect in void context: 'unary -<expr> . 01-08-17 shagino LIBbb02768 Merge R1.2 baseline with latest R1.1 - Updated Sonata_in_C_short due to format change 01-07-27 arc095 LIBbb00912 Operator Defined Ringer Support 01-07-18 byl034 CR - LIBaa08107 Move constant data from RAM to ROM (to save RAM (MR)). - add a const directive to array am_hw_sound_table[] 01-06-01 rsubram LIBaa03780 Reduce level of uplink DTMF tone in AMPS 00-12-21 mtaraba CSGce82934 main_comp_hardware.h within engine_audio vob should be removed 00-11-30 ktang CSGce81496 SMS alert tone path fixes - Added a tone for incall SMS 00-09-22 hchuang CSGce66038 Provide an interface function for retrieving tone information - defination of port_am_tone_detail() - update the argument in update_tone, set_ctg_gain function call. 00-10-02 cfarrel CSGce74683 Audio using old MCU_DSP_DTMF_TX_CONTROL length and struct (for GSM/TDMA) 00-10-02 cfarrel CSGce74683 Audio using old MCU_DSP_DTMF_TX_CONTROL length and struct (for GSM/TDMA) 00-10-03 hchuang CSGce75260 Add TX DTMF gain retrive function in CDMA engine - use dsp_api_tx_dtmf_gain_retrieve in dsp_api to get tx gain 00-09-21 ktang CSGcs74305 Need separate GSM/Europe and CDMA/USA Ringback Tones - Added USA Ringback tone, and some reserved place holders in each of the tone blocks: UI, Key, Network, and Alert 00-10-03 hchuang CSGce75260 Add TX DTMF gain retrive function in CDMA engine - use dsp_api_tx_dtmf_gain_retrieve in dsp_api to get tx gain 00-09-21 ktang CSGcs73690 Fix to remove correct sample alert from tone table in DL - Moved call guard and roam call alerts to match the changes in dl_audio_auf.h 00-09-25 davidb CSGce74012 -Reorder Tone Table to align with Device Layer and ITL spec. -Define Roam_Call One Shot Tone 00-09-22 hchuang CSGce66038 Provide an interface function for retrieving tone information - create port_am_tone_detail function 00-09-18 davidb CSGcs70811 -Add Call Guard Support to tone table 00-09-11 hchuang CSGce68045 Analog Network DTMF fixes - set_ctg_gain will not be part of build_tone. - set_ctg_gain use additional input argument, tone type, for calculate cf. 00-04-04 ktang PR - CSGce67917 Update audio Manager to support Synergy Lite tone defs 00-08-14 cfarrel CR - CSGce68097 When a call fails, the user should hear either Intercept or Reorder - Define the Reorder and Intercept tones as they were in the legacy CDMA audio manager. Currently they are both equivalent to a power up tone. 00-05-09 ktang PR - CSGce51877 Update Audio Manager to ITL Sound StyleGuide - Remvoed the member function build_music - Replace the legacy tones with Synergy Lite sounds 00-08-09 mtaraba CR - CSGce55882 Eliminate file gsm.h from audio manager 00-08-14 ktang CR - CSGce68045 Analog Network DTMF fixes - Replaced the hardcoding with the appropriate info in function update_tone_control 00-05-01 ktang PR - CSGcw55777 CDMA Alert - On MT call, ringer remains on after pressing send - Added static variable enabling TONE_GEN_OFF ctg message to send correct tone id to DSP 00-04-04 ktang CR - CSGce53367 CTG conformation to ctg_mdi.fm 2.1 - Converted frequencies to cos values to send to DSP. - replace MCU_DSP_AUDIO_TONE_CONTROL with MCU_DSP_DTMF_TX_CONTROL 00-03-31 shagino CR - CSGce53043 Stop all tones - Implemented the function stop_current_tone. 00-03-02 ktang CR - CSGce50329 Sierra Audio Manager CTG fix - Added DTMF tone stop (if it is requested by upperlayer) BEFORE a possible next tone start is sent to DSP. 99-11-16 ktang PR - CSGce42434 Common Tone Generator MDI messages - Rewrite funcitons update_tone and build_tone - Added function build_music - modified tone definition table 99-11-08 ktang PR - CSGce40494 GRiEF AM Music Ringer - Moved const table note_type_to_freq_tbl to am_relay_layer_music.h 99-10-25 ktang PR - CSGce40785 GRiEF Audio: DL Audio Tone Types and DL DB Feature IDs - replaced td tone types and ids with DL tone types and ids 99-10-05 ktang PR - CSGce39515 99-09-01 mkloza CSGce34326 99-03-30 mkloza PR - CSGce30284 99-03-30 jkraisor PR - CSGce29675 99-03-21 joeh CR - CSGce29889 99-01-26 blamers CR - CSGce27361 98-12-01 jkraisor CR - CSGce22626 98-10-28 jkraisor PR - CSGce23753 98-10-15 mgilot PR - CSGce23191 98-08-07 mkloza PR - CSGce20957 98-07-06 aliang CR - cSGce19444 98-06-18 dmichau CR - CSGce19897 98-04-10 gswanson PR - CSGce18195 98-02-15 gswanson PR - CSGce12607 98-03-03 mrisop PR - CSGce15153 98-02-26 mbonness PR - CSGce17138 97-11-12 lindan PR - CSGce13656 97-12-05 gswanson PR - CSGce15192 97-11-26 gswanson PR - CSGce15001 97-12-30 gswanson PR - CSGce15864 97-12-30 gdrumma CR - CSGce12568 97-11-20 gdrumma PR - CSGce14786 97-10-31 gdrumma PR - CSGce13990 97-08-11 gswanson PR - CSGce12130 97-08-27 gdrumma PR - CSGce11316 97-01-31 gswanson PR - CSGce07659 97-01-21 gswanson PR - CSGce07211*//************** INCLUDES ******************************************************/#include <SUAPI/suapi.h>#include "string.h"#include <ENGINE_AUDIO/audio_conditional_compile_def.h>#include <audio/am_hw_primitive_builder_tone.h>#include <audio/am_hw_primitive_builder_phase.h>#include <audio/AM_HW_Primitive_Builder.H>#include <audio/AM_Relay_Layer.H>#include <audio/am_custom_tune.h>#include <ENGINE_AUDIO/am_aud_tone_reply.h>#include <SYNERGY_DEVICE_LAYER/dl_audio_auf.h>#include <ENGINE_AUDIO/aud_test_command_interface.h>#include <audio/am_hw_primitive_builder_main.h>#include <ENGINE_AUDIO/aud_tone_type.h>#if (MAKE_PRODUCT == MAKE_PRODUCT_C650)#include <ENGINE_HAPI/hapi_ext.h>#include <ENGINE_HAPI/hapi_mdi_queue.h>#endif/************** LOCAL STRUCTURES, ENUMS, AND TYPEDEFS *************************//************** LOCAL FUNCTION PROTOTYPES *************************************/extern AM_AUDIO_PATH_TYPE get_path (TD_AUD_TONE_UNION_T tone);/************** LOCAL CONSTANTS ***********************************************/#define MAX_FREQ_A_MSG 25#define BEAT_PER_FULL_NOTE 4#define MAX_411_GAIN 0x7FFF#define MAX_CADENCE_AMOUNT 4/* Below are Synergy Lite sounds, in the sequence that is given in dl_audio_auf.h *//* UI Tones */const UINT8 LBatChrg[] ={ 3 * AM_MUSIC_UNIT_TEMPO, 5, 1, 1, 255, 0x53, 3, 0x56, 3, 0x59, 3, 0x51, 3, 0x65, 3};const UINT8 LBatLow[] ={ 6 * AM_MUSIC_UNIT_TEMPO, 2, 1, 1, 255, 0x57, 3, 0x48, 3};const UINT8 LCalDrop[] ={ 6 * AM_MUSIC_UNIT_TEMPO, 3, 1, 1, 255, 0x42, 3, 0x41, 3, 0x43, 3};const UINT8 LCalSet[] ={ 4 * AM_MUSIC_UNIT_TEMPO, 3, 1, 1, 255, 0x40, 3, 0x55, 3, 0x57, 3};const UINT8 LCalTimr[] ={ 2 * AM_MUSIC_UNIT_TEMPO, 2, 1, 1, 255, 0x49, 3, 0x4a, 3};const UINT8 LConfirm[] ={ 6 * AM_MUSIC_UNIT_TEMPO, 2, 1, 1, 255, 0x43, 3, 0x47, 3};const UINT8 LDelItem[] ={ 4 * AM_MUSIC_UNIT_TEMPO, 4, 1, 1, 255, 0x40, 3, 0x4b, 3, 0x48, 3, 0x49, 3};const UINT8 LDelText[] ={ 3 * AM_MUSIC_UNIT_TEMPO, 1, 1, 1, 255, 0x38, 3};const UINT8 LDevCnct[] ={ 4 * AM_MUSIC_UNIT_TEMPO, 3, 1, 1, 127, 0x5b, 11, 0x5b, 3, 0x66, 7};const UINT8 LDevDrop[] ={ 4 * AM_MUSIC_UNIT_TEMPO, 3, 1, 1, 255, 0x66, 11, 0x66, 3, 0x5b, 3};const UINT8 LEndList[] ={ 3 * AM_MUSIC_UNIT_TEMPO, 3, 1, 1, 255, 0x31, 3, 0x0c, 3, 0x31, 3};const UINT8 LError[] ={ 6 * AM_MUSIC_UNIT_TEMPO, 2, 1, 1, 255, 0x53, 3, 0x39, 3};const UINT8 LKeyHold[] ={ 6 * AM_MUSIC_UNIT_TEMPO, 2, 1, 1, 255, 0x45, 11, 0x55, 3};const UINT8 LNegate[] ={ 6 * AM_MUSIC_UNIT_TEMPO, 2, 1, 1, 255, 0x47, 3, 0x44, 3};const UINT8 LPwrDown[] ={ 4 * AM_MUSIC_UNIT_TEMPO, 21, 1, 1, 255, 0x0c, 23, 0x6a, 3, 0x67, 3, 0x63, 3, 0x52, 3, 0x67, 3, 0x63, 3, 0x52, 3, 0x5a, 3, 0x63, 3, 0x52, 3, 0x5a, 3, 0x57, 3, 0x52, 3, 0x5a, 3, 0x57, 3, 0x53, 3, 0x5a, 3, 0x57, 3, 0x53, 3, 0x42, 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -