am_event_handler_audio.cc

来自「Motorola synergy audio component」· CC 代码 · 共 1,295 行 · 第 1/3 页

CC
1,295
字号
/* (c) Copyright Motorola 1995-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:       This module is the audio board in the rack, it handles five primitives:      aud_voice_req, aud_tone_req, aud_tone_cmplt, aud_command_req,       aud_deactivation_req *************** REVISION HISTORY *********************************************     Date       Author      Reference   ========   ========    ==========================   2006-01-30 a19950      LIBhh82547              port LIBhh18354 to P044   2005-11-23 e12122      libhh43622              Subscribe for Stop Complete   2005-11-03 e42737      libhh19254              Remove sleep loop on usb detect to fix panic while voice record.   2005-10-05 e2322c      CR - LIBhh05130              Consume rights object for OMADRM ringtones   2005-07-05 rkamath1    LIBgg65242              Feature 16017 - added handle_aud_setting_change_ind   2005-06-13 w17860      CR - LIBff63840              Apple 3990042: Sometimes after sync, phone only plays out right headphone   2005-04-01 abp095      CR - LIBff53867              Add support for Siliqua (R479) by removing all product based conditional compile flags    2005-03-07 e12122      LIBff70509              Mp3 ringer tone support for open to answer on   2004-12-22 a21034      CR - LIBff43705              R3512: Adding Kauai supports to MME files   2004-11-19 abp095      CR - LIBff29197                Add Royale compile flags to the makefiles and conditional compiled files   2004-11-11 abp095      CR - LIBff33384                Add R37A compile flag in MME and AudioManager   2004-10-25 abp095      CR - LIBff23698              Add support for R4512    2004-08-16 abp095      LIBee05015                MME support for R4.7.8 (Pebble)   2004-05-10 w17860      LIBee08172              Make a seperate tone request for MFT Vib from MME   2004-04-30 w17860      LIBee01361              FT_HK: no vibration when incoming arrives while mp3 is playing              - Use a Wave pattern instead of the AM timer   04-04-15   w16006      LIBdd89829   2004-04-02 w16355      CR - LIBdd93012              RTime never told to stop stereo headset polling.              - Pull out changes for stereo headset detection here, as                it should be done when the tone is removed from the queue.   2004-03-31 w17860      LIBdd89621              E398: Pops during vibrate using MFT especially at start and end.              - Backed out changes made on LIBdd85185 to get vib working   04-03-29   w18944      CR - LIBdd85185              Redial alert doesn't work for MFT vibrate   04-02-23   w18944      CR - LIBdd72710              WAV UI sounds   04-01-08   w18944      CR - LIBdd65835              vib&ring setting causes phone to vibrate in motomixer   03-12-16   a18984      CR - LIBdd62088              Incoming calls impossible while Alarm Clock is alerting   03-12-16   w17860      CR - LIBdd62227              MFT vib Updates for E398   03-12-10   a18985      CR - LIBdd61220              To fix dump file for C650   03-12-08   a18985      CR - LIBdd57220              Move the definition of AUD_CTG_ADD_RSRC_RETRY_TIMER_T              to a header file to fix error in dump generation   03-11-17   a19436      CR - LIBdd56768              Making the mp3_ringer_handle global to enable               pausing mp3 ringer tone, when a flip is opened   03-11-03   a18984      CR - LIBdd46249              alarm clock volume follows ringertone volume   03-11-03   a18984      CR - LIBdd46249              alarm clock volume follows ringertone volume   03-10-29   a18984      CR - LIBdd50554              The alarm clock don't play polyphonic melodies in vibrate mode      03-10-15   mloutris    CR - LIBdd43633              E398: New stereo headset detection AM sw to support new HW.              - Added code to detect the condition of entering stereo                 headset detection begins.   03-09-30   w17860      CR - LIBdd44195              MP3 Powerdwn Sound not finishing before power off   03-09-18   a18984      CR - LIBdd40191              Incoming call is not playing while in motomixer Editor   03-09-03   w13738      CR - LIBdd32694              can't remove the 'new_audio' from reorder list in playlist of Sound   03-09-02   qcf001      CR - LIBdd36332              Wakeup tones out of headset revisited   03-08-29   qcf001      CR - LIBdd34240              Wakeup tones out of headset   03-04-13   brb032      CR - LIBbb90240              Support OMA DRM files.   03-05-08   ktang       CR - LIBbb95567              Random panics when editing/creating mymix mix files.   03-04-17   e11237      CR - LIBbb87186              bluetooth HFP on triplets   03-04-28   qjv001      CR - LIBbb96816              remove MME Resource Manager voice tone indications   03-03-25   e11237      CR - LIBbb77547              support video telephony   03-01-16   stlee       CR - LIBbb75497              MyTone APP and Ringer APP Play iMelody with MME instead of CTG   03-04-28   w17860      CR - LIBdd02287              Turn off Noise Suppression when Network requests it for AMR              03-01-16   stlee       CR - LIBbb75497              MyTone APP and Ringer APP Play iMelody with MME instead of CTG   02-12-05   w18944      CR - LIBbb70784         02-11-01   stlee       CR - LIBbb64769              Midi ringtones don't repeat properly, only plays 1 cycle   02-10-07   stlee       CR - LIBbb55179              Melody Required Fields Not Present on Mobile              Originiated Ring Tones   02-09-17   stlee       CR - LIBbb55753              DL Audio and AM ROM reduction   02-08-23   stlee       CR - LIBbb50962              Move audio file to /a/motorola/audio and support the long name   03-04-10   stlee       CR - LIBbb84176              MP3 ringer support   03-03-17   w17860      CR - LIBbb87685              MRS 8245: Haptics support for E390   02-11-14   brb032      CR - LIBbb56504              Send message to DL in media event.   02-10-30   bof010      CR - LIBbb65108              Invalid format in stored melody (Port the fix from TALON)   02-02-19   w17860      CR - LIBbb19124              SYSTEST audio routed thruogh MS speaker first                - LIBbb15411 changes in R1.2.1   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-08-17   shagino     CR - LIBbb02768              Merge R1.2 baseline with latest R1.1              - custom_tune changed from Global to private    01-10-05   w17860      CR - LIBbb07519              Replace MAKE_EXT_SMART_AUDIO comp flag with MAKE_MP3 &              MAKE_TELEMATICS   01-11-19   qcf001      CR - LIBbb07675              Noise during keypress and at end of call   01-07-27   arc095      CR - LIBbb00912              Operator Defined Ringer Support   01-07-24   qcf001      CR - CSGce96760              Power-up tone doesn't come out USB DHFA.   01-07-01   rsubram     CSGce95427              TELEMATICS: Need noise suppression and echo control to be dynamic.              Added function definition for handle_aud_echo_mode_req   01-04-03   ktang       CR - CSGce93816              AM needs to wait for tone cmp for AVC UL DTMF before disconnecting it              - Turns ul_dtmf_lock off upon receipt of UL DTNF tone complete   00-11-20   mtaraba     CSGce69100              Add support for DAI mode for GSM   00-12-21   mtaraba     CSGce82934              main_comp_hardware.h within engine_audio vob should be removed   00-11-17   cfarrel     CR - CSGce71778              MDI Audio error message handling   00-10-22   cfarrel     CR - CSGce76689              When a key is pressed twice in a row, there is no tone for second key.   00-09-11   mtaraba     CR - CSGce68318              Add audio manager support for customer audio loopback testing              - Added handle_aud_ctia_mode_req   00-08-23   shagino     CR - CSGce54834              Suspending Audio Manager should stop all tones              - Added a call to stop_tones   00-08-18   ktang       CR - CSGce51877              Update Audio Manager to ITL Sound StyleGuide   00-08-14   ktang       CR - CSGce68045              Analog Network DTMF fixes              - Passed the uplink information in functions handle_aud_tone_req	        and handle_audscm_tone_cmplt1 to generate_tone; and	      - Updated the parameters in calls to function generate_tone   00-08-09   mtaraba     CR - CSGce55882              Eliminate file gsm.h from audio manager   00-08-08   ktang       CR - CSGce66238              Add Ringer/Vibrate functionality   00-05-26   shagino     CR - CSGce59603              Re-Merge in changes that were removed   00-05-05   shagino     CR - CSGce56425              Implement handsfree_status funtion              - Updated DL types to match new naming convention   00-04-27   mkloza      PR - CSGce54341              MATRIX command implementation              - removed update_mode()   00-04-05   hchuang     CR - CSGce53807              Update Audio Manager to use HAPI MDI functions and header files			  - replace all api #define in l1_modem_api_queue.h with one in			    hapi_mdi_queue.h   00-03-30   shagino     CR - CSGce53305   00-03-28   shagino     CR - CSGce53043   00-03-21   shagino     CR - CSGce51678   00-03-15   shagino     CR - CSGce51678   00-03-15   mkloza      PR - CSGce51641   00-03-02   ktang       CR - CSGce50329   00-02-08   cfarrel     CR - CSGce48312   99-12-25   wchoi       CR - CSGce39558   99-12-01   ktang       CR - CSGce42434   99-11-19   ktang       CR - CSGce39546   99-10-19   ktang       PR - CSGce40494   99-10-01   mkloza      CR - CSGce39421   99-10-04   ktang       PR - CSGce39515   99-08-02   mkloza      PR - CSGce34326   99-08-03   jvoss       CR - CSGce34013   99-04-12   mkloza      PR - CSGce30453   99-03-08   mkloza      PR - CSGce29322   99-01-26   blamers     CR - CSGce27361   99-01-26   mkloza      PR - CSGce27430   99-01-05   tyellapa    CR - CSGce23316   98-12-05   mgilot      PR - CSGce25427   98-10-02   mkloza      PR - CSGce22824   98-09-16   mkloza      PR - CSGce22250   98-09-08   blamers     CR - CSGce17243   98-07-06   aliang      CR - CSGce19444   98-06-02   rentring    PR - CSGce19275   98-04-1    rentringer  PR - CSGce16647   98-02-15   gswanson    PR - CSGce12607   98-03-11   gswanson    PR - CSGce17353   97-12-30   gdrumma     CR - CSGce12568   98-02-03   slam        PR - CSGce16188   98-01-21   gswanson    PR - CSGce16260   98-01-08   gswanson    PR - CSGce14851*//************** INCLUDES ******************************************************/#include <SUAPI/suapi.h>#include <audio/am_globals.h>#include <audio/AM_Tone_Sequence_Handler.H>#include <ENGINE_AUDIO/td_aud_voice_req_type.h>#include <ENGINE_AUDIO/td_mmiloc_feature_states.h>#include <ENGINE_AUDIO/td_vr_error_codes.h>#include <ENGINE_AUDIO/td_va_status.h>#include <ENGINE_AUDIO/td_vr_defs.h>#include <ENGINE_AUDIO/td_vr_group_types.h>#include <ENGINE_AUDIO/td_vr_voice_tag.h>#include <audio/aud_voice_req.h>#include <ENGINE_AUDIO/td_aud_tone_req_type.h>#include <ENGINE_AUDIO/td_dsp_aud_reply_buff.h>#include <ENGINE_AUDIO/audscm_tone_cmplt1_ind.h>#include <ENGINE_AUDIO/mmivr_sdvr_ind.h>#include <ENGINE_AUDIO/mmivr_sdvr_ind.h>#include <audio/aud_command_req.h>#include <audio/audio_deactivate_req.h>#include <audio/audio_deactivate_cnf.h>#include <audio/aud_tone_req.h>#include <ENGINE_AUDIO/aud_prim_ids.h>#include <ENGINE_AUDIO/aud_va_status_ind.h>#include <audio/AM_SendMessage.h>#include <audio/am_custom_tune.h>#include <audio/AM_iMelody.H>#include <audio/am_app_logic_processor_main.h>#include <ENGINE_AUDIO/td_aud_command_type.h>#include <audio/am_app_configuration_server.h>#include <audio/AM_App_Configuration_Server.H>#include <audio/AM_Event_Handler.H>#include <audio/am_va_vr_command_types.h>#include <audio/AM_Relay_Layer.H>#include <ENGINE_AUDIO/am_hw_string_primitive.h>#include <SYNERGY_DEVICE_LAYER/dl_db_feature_auf.h>#include <SYNERGY_DEVICE_LAYER/dl_db_feature_msg.h>#include <SYNERGY_DEVICE_LAYER/dl_audio_auf.h>#include <SYNERGY_DEVICE_LAYER/dl_ports.h>#include <SYNERGY_DEVICE_LAYER/dl_synergy_std_def.h>#include <audio/aud_mute_req.h>#include <ENGINE_AUDIO/aud_ctia_mode_req.h>#include <audio/audio_ctia.h>#include <ENGINE_HAPI/hapi_portlist.h>#include <audio/aud_rat_change_ind.h>#include <MME/mm_auf_common_defs.h>#include <MME/mm_auf_msg.h>#include <MME/mm_auf_avp.h>#include <ENGINE_RTIME_MAINT/rtime_maint_dm.h>#include <SYNERGY_DEVICE_LAYER/dl_file_system_auf.h>#include <audio/AM_Device_Layer_Interface.H>#include <ENGINE_AUDIO/audio_conditional_compile_def.h>#if  (MAKE_OMA_DRM_SUPPORT == TRUE)#include <SYNERGY_DEVICE_LAYER/dl_hdr_drm_auf.h>#endif/************** MP3 RINGER PAUSE HACK ***********************************************/extern unsigned char off_hook_flag_glb;MMSS_MEDIA_HANDLE_T mp3_ringer_media_handle_glb = NULL;/************** MP3 RINGER PAUSE HACK END *******************************************//* This line must be included before any conditional compile cases are tested    (to see if that variable is setup *//************** LOCAL CONSTANTS ***********************************************//************** LOCAL STRUCTURES, ENUMS, AND TYPEDEFS *************************//************** LOCAL FUNCTION PROTOTYPES *************************************//************** LOCAL MACROS **************************************************//************** GLOBAL VARIABLES  *********************************************/    //these are used for telematics and bluetooth handsfree    BOOL echo_control = TRUE;    BOOL noise_sup = TRUE;UINT16 beat_to_mme = 0xFFFF;UINT16 media_tone_type = DL_AUDIO_TONE_TYPE_INVALID_TONE;UINT32 media_tone_seq = INVALID_SEQ_NUMBER;UINT8  media_tone_vol = INVALID_VOLUME_STEP;UINT16 media_vibrate_type = DL_AUDIO_TONE_TYPE_INVALID_TONE;/* This boolean would be used to see if we need to deactivate after  * the powerdown tone is played. */BOOL am_deac_req_not_honored = FALSE;/************** LOCAL VARIABLES ***********************************************/BOOL am_suspend = FALSE;BOOL am_allow_ns = TRUE;/************** FUNCTION DEFINITIONS ******************************************//* DESCRIPTION:       Function handles an incoming aud_voice_req primitive, it asks logic processor in       in application layer to turn on or off a voice based on request_type. (1 = on, 0 = off)   INPUTS:       generic primitive   OUTPUTS:       None   IMPORTANT NOTES:       None*/void AM_Event_Handler::handle_aud_voice_req (void *msg){    AUD_VOICE_REQ * aud_voice_req = (AUD_VOICE_REQ*) msg;    TD_AUD_TONE_REQ_TYPE req_type = aud_voice_req->req_type;    if (req_type == AUD_TONE_START)    {        // if config bit is not already set for ENT MUTE, then set config bit        if (!am_event_configuration_server.read(AM_CONFIGURATION_ID_ALLOW_ENT_MUTE))        {            // set the flag that indicates to allow ENT MUTE            am_event_configuration_server.set(AM_CONFIGURATION_ID_ALLOW_ENT_MUTE, TRUE);        } 	am_event_configuration_server.set (AM_CONFIGURATION_ID_INCALL , (UINT8) TRUE);    //MME_RESM_AM_callback_function(MME_RESM_TONE_VOICE_T, MME_RESM_TONE_ON);    }    else    {        am_event_configuration_server.set (AM_CONFIGURATION_ID_INCALL , (UINT8) FALSE);        //MME_RESM_AM_callback_function(MME_RESM_TONE_VOICE_T, MME_RESM_TONE_OFF);#if (AUDIO_GSM == TRUE)        suSleep(100,NULL);#endif    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?