aud_tone_req.c

来自「Motorola synergy audio component」· C语言 代码 · 共 1,254 行 · 第 1/4 页

C
1,254
字号
/*==================================================================================================                                                                                   Module Name:  aud_tone_req.c    General Description: Utility function to send Tone requests to the Audio Manager====================================================================================================                               Motorola Confidential Proprietary                           Advanced Technology and Software Operations                     (c) Copyright Motorola 1999 - 2005, All Rights Reserved   Revision History:                            Modification     Tracking   Date       Author      Reference   ========   ========    ==========   2005-06-23 w16355      CR - LIBgg36361              Need additional logging capabilities.   2005-07-05 rkamath1    LIBgg65242              Feature 16017 - changed aud_tone_req & aud_tone_vib_mm_req to return BOOL. Added the              aud_audio_update_req.   2005-04-15 w18944      LIBff96589              Fix Klocworks error in engine audio   2005-03-16 a21034      LIBff72838              aud_tone_custom_file_req function changed to get              user volume from fhandle instead of getting it directly   2004-10-11 w17860      LIBff18577              ST:RND:Accy: Phone don't vibrate with connected BT Headset   2004-06-15 w17860      LIBee21826              BT: During MFT sample vibs, there is noise on BT headset   2004-06-07 w17860      LIBee18192              FT: BT: No indication of MT voice call if profile is set to vibrate.   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   2004-03-31 w17860      LIBdd89621              E398: Pops during vibrate using MFT especially at start and end.              - Use MP3 instead of Wave for MFT vibrate content                2004-03-19 w16355      LIBdd88804              DTMF tones are often not heard.Author                          Date          Number     Description of Changes-------------------------   ------------    ----------   -------------------------------------------Lori Lareau                 03/02/2004      LIBdd82207   MIDI alerts not routed to BT HSLori Lareau                 02/23/2004      LIBdd72710   WAV UI soundsMichael Loutris             02/18/2004      LIBdd76140   Can't use MotoMixer when phone linked with                                                          Bluetooth headset.Ravi Subramanyan            02/04/2003      LIBdd73500   MFT Vibration Frequency not at 157 Hz                                                         - Add support for 16 bits/sample wave.Lori Lareau                 01/08/2004      LIBdd65835   vib&ring setting causes phone to vibrate in motomixerRavi Subramanyan            12/16/2003      LIBdd62227   MFT vib Updates for E398Mohan Manoj Kumar           12/04/2003      LIBdd57305   Compile out Ring and Vib for Neptune LTLori Lareau                 11/10/2003      LIBdd44821   Simultaneous Ring and VibMohan Manoj Kumar           10/29/2003      LIBdd50554   The alarm clock don't play polyphonic (duplicate of LIBdd46249)                                melodies in vibrate modeLori Lareau                 10/13/2003      LIBdd47240   Stuck tone for one-shot multimedia tones w/BTChris Fries                 09/02/2003      LIBdd36332   Play wakeup tone in headset.Ravi Nistala                08/28/2003      LIBdd33145   Do not mute midi when there is a lo_fi type reqJon Eklund                  08/18/2003      LIBdd30018   MME knows about multimedia alerts (back out 65872)Ravi Nistala                08/21/2003      LIBdd29476   No_audio_in_Bluetooth_car_kit_while_doing_MT                                                         -Merging changes from LIBdd20228Chris Fries                 08/21/2003      LIBdd30016   Fix tone type in custom file req APIMohan Manoj Kumar           07/30/2003      LIBdd21617   Conversation is not possible while                                                         storing a user defined soundChao Wang                   07/21/2003      LIBdd20932   No soft ringer when light patern selecteda3177c                      07/11/2003      LIBdd14264   Volume adjustment from Java doesn't work correctly                                                         - Volume update for oki handleda3177c                      06/23/2003      LIBdd10198   ST:OKI:2:Call/msg alert tone not played.                                                          - Removed stop request from aud_tone_vibrate_req Gayathri S                  06/17/2003      LIBdd11236   BaseTrack corrupted while playing                                                          Can't Edit/Mixed File Mohan Manoj Kumar           05/29/2003      LIBdd07377   MFT feature ON/OFF through Flex                                                          - OKI stop request to be sent only in case                                                         of MIDI or iMelody in aud_tone_vibrate_reqStephen Lee                 04/10/03        LIBbb84176   MP3 ringer supportRavi Subramanyan            04/15/2003      LIBbb91620   MRS 8291: MFT support for E390a3177c                      24/04/2003      LIBbb96625   iMelody playback through the MME instead of engine audioa3177c                      18/02/2003      LIBbb77026   OKI Support.                                                         OKI audio tone request call is made just before                                                         DSP tone request.Kevin Tang                  05/08/2003      LIBbb95567   Random panics when editing/creating mymix                                                         mix files.Stephen Lee                 01/16/02        LIBbb75497   MyTone APP and Ringer APP Play iMelody with                                                         MME instead of CTGJon Eklund                  12/10/02        LIBbb71523   replace midi alert with beep on bt headsetJon Eklund                  12/10/02        LIBbb65872   make audio manager think MME supports MM_ALERT_MIDIStephen Lee                 11/09/02        LIBbb70175   FT: Can't return to Photo Viewfinder after                                                         reading SMSStephen Lee                 10/07/02        LIBbb55179   Melody Required Fields Not Present on Mobile                                                         Originiated Ring TonesStephen Lee                 10/02/02        LIBbb58887   Userdefined sounds not played by                                                         DL_AudPlaySampleAudioStephen Lee                 09/17/02        LIBbb55753   DL Audio and AM ROM reductionStephen Lee                 08/23/02        LIBbb50962   Move audio files to /a/motorola/audio and                                                         support long file nameRavi Subramanyan            07/03/02        LIBbb41925   AWS panic#157 - while playing a melody filebal023                      11/28/2002      LIBbb69413   Stop the previous midi before starting a new one Rafi Baifous                11/19/2002      LIBbb66650   Stop media tone when we play the network service tone.brb032                      11/14/2002      LIBbb56504   Audio Media support. Olga Fine                   10/30/2002      LIBbb65108   Invalid format in stored melody (Port the fix from TALON) btk015                      09/25/2002      LIBbb57856   Remove LIBbb40731 to enable playing midi incoming call while playing in MotoMixer Randy Scott                 09/02/2002      LIBbb51242   Support turning off vocoder when starting MIDI  brb032                      08/19/2002      LIBbb49461   Add pwrerup support in function aud_tone_custom_file_req() Chao Wang                   06/26/2002      LIBbb40731   Play bas and mix file from ringer list bmd031                      06/23/2002      LIBbb39271   Sending big EMS cause panic.  Kevin Tang                  06/10/02        LIBbb30667   M Services - Sound preview bar is always full  brb032                      06/03/2002      LIBbb36635   The audio media will open via mme interface only                                                           for media format and not for imelody format.  Meirav Djerassi Medina      05/12/2002      LIBbb31473   sms cause panic if the default is MIDI file  Meirav Djerassi Medina      05/07/2002      LIBbb29252   Change the function: aud_audio_media_open Stephen Lee                 04/08/02        LIBbb27015   Stop the previous midi before starting a                                                          new midi Ravit Leijden Van Amstel    25/02/2002      LIBbb21281   Add MyTone DB to LCA phone Kevin Tang                  02/02/02        LIBbb10803   Added new interfaces to support dealing                                                          with file names  Kevin Tang                  12/20/2001      LIBbb13753   Audio Media Request Redirection  Steve Hagino                08/17/2001      LIBbb02768   Merge R1.2 baseline with latest R1.1                                                         - custom_tune changed from Global to private Ravi Chebolu                07/27/2001      LIBbb00912   Operator Defined Ringer SupportMark Taraba                 08/09/2000      CSGce55882   Eliminate file gsm.h from audio managerKevin Tang                  08/24/2000      CSGce67917   Update audio Manager to support Synergy                                                          Lite tone defsDavid Brenner               07/24/2000      CSGce66238   Add Ringer/Vibrate functionalitySteve Hagino                08/16/2000      CSGce68531   Menu keypress tone comes out the alert                                                         speaker instead of earpiece spkr                                                         -Added a switch statement to take care of                                                           the mismapping of tones from the DL.Steve Hagino                04/24/2000      CSGce55663   Change AM code to have strict ANSI                                                          complianceKevin Tang                  04/04/2000      CSGce53448   AM DL interface update                                                         - Added default_volume parameter to                                                           aud_tone_req functionM. Gilot                    09/01/1999      CSGce34326   GRiEF: Stubout all Audio SEEM functions                                                          calls                                                         - First versionChuck Farrel                02/02/2000      CSGce47853   SiERRA Audio: Update Phase 6 Headers                                                         - Add sequence_number parameter to                                                            aud_tone_req                                                         - Add uplink parameter to                                                           aud_tone_keyfeedback_reqPortability: Indicate if this module is portable to other compilers or   platforms. If not, indicate specific reasons why is it not portable.====================================================================================================                                        INCLUDE FILES==================================================================================================*/#include <ENGINE_AUDIO/aud_prim_ids.h>#include <audio/aud_tone_req.h>#include <ENGINE_AUDIO/aud_alert_info.h> #include <audio/AM_SendMessage.h>#include <SYNERGY_DEVICE_LAYER/dl_audio_auf.h>#include <audio/am_server_task.h>#include <SYNERGY_DEVICE_LAYER/dl_message_ids.h>#include <SYNERGY_DEVICE_LAYER/dl_db_feature_ids.h>#include <audio/am_custom_tune.h>#include <SYNERGY_DEVICE_LAYER/dl_file_system_auf.h>#include <audio/AM_Device_Layer_Interface.H>#include <SYNERGY_DEVICE_LAYER/dl_db_feature_auf.h>#if (AUDIO_GSM == TRUE)#include <ENGINE_SEEM/seem_element_length_address.h>#endif#include <MME/mm_auf_avp.h>#include <ENGINE_AUDIO/aud_tone_type.h>#include <SYNERGY_DEVICE_LAYER/dl_acc_auf.h>#include <MME/mm_auf_avp.h> #include "/vobs/synergy_device_layer/code/dl_util/src/dl_util_string.h"#include <ENGINE_HAPI/hapi_portlist.h>#if (MAKE_HDW_OKI == TRUE)#include "aud_soundlib_interface.h"#endif/*==================================================================================================                                 LOCAL FUNCTION PROTOTYPES==================================================================================================*/static TD_AUD_MEDIA_INFO_T aud_audio_media_open(TD_AUD_TONE_REQ_TONE_TYPE_T tone_type,						MMSS_FILE_FORMAT_T format, W_CHAR * fName);   /*==================================================================================================                                     LOCAL CONSTANTS==================================================================================================*//*==================================================================================================                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)==================================================================================================*//*==================================================================================================                                        LOCAL MACROS==================================================================================================*/#define read_mask(a, mask) ((((a) & (mask)) == mask) ? 1: 0)/*==================================================================================================                                      LOCAL VARIABLES==================================================================================================*//*==================================================================================================                                     GLOBAL VARIABLES==================================================================================================*/extern UINT16 beat_to_mme;extern UINT16 media_tone_type;extern UINT32 media_tone_seq;extern UINT8  media_tone_vol;extern UINT16 media_vibrate_type;BOOL midi_supported = FALSE; /*==================================================================================================                                     LOCAL FUNCTIONS==================================================================================================*//*==================================================================================================                                       GLOBAL FUNCTIONS==================================================================================================*//*==================================================================================================  FUNCTION:aud_media_req  DESCRIPTION:     This function create audio tone request msg  ARGUMENTS PASSED:    req_type,  TD_AUD_TONE_REQ_TYPE_T    tone_type, TD_AUD_TONE_REQ_TONE_TYPE_T.      RETURN VALUE:    None  PRE-CONDITIONS:    None   POST-CONDITIONS:    None  IMPORTANT NOTES:    None. ==================================================================================================*/ void aud_media_req(TD_AUD_TONE_REQ_TYPE_T req_type, TD_AUD_TONE_REQ_TONE_TYPE_T tone_type) {     TD_AUD_TONE_UNION_T tone = {0};     char* msgptr = suCreateMessage((UINT32)sizeof(AUD_TONE_REQ), (UINT32)AUD_TONE_REQ_ID,                                    SU_INVALID_HANDLE, NULL);      tone.fields.id = TONE_ID_MASK & tone_type;     tone.fields.one_shot = 1;     tone.fields.media = 1;     tone.fields.pwrup = 0;      /* Fill in tone info */     ((AUD_TONE_REQ*)msgptr)->tone = tone;     ((AUD_TONE_REQ*)msgptr)->req_type = req_type;     ((AUD_TONE_REQ*)msgptr)->sequence_number = 1234;     ((AUD_TONE_REQ*)msgptr)->uplink     = FALSE;     ((AUD_TONE_REQ*)msgptr)->vol_step   = DL_AUDIO_VOLUME_SETTING_CURRENT;     ((AUD_TONE_REQ*)msgptr)->vibrate_type  = DL_AUDIO_TONE_TYPE_INVALID_TONE;     ((AUD_TONE_REQ*)msgptr)->media_info.handle = (void *)NULL;     ((AUD_TONE_REQ*)msgptr)->media_info.seq = 0;     ((AUD_TONE_REQ*)msgptr)->sampling_rate = AM_SAMPLING_RATE_08_00;     /* Send Message to the Audio Manager */     AM_SendMessage(msgptr); }  /*================================================================================================== 

⌨️ 快捷键说明

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