⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 am_event_handler_audio_va.cc

📁 Motorola synergy audio component
💻 CC
📖 第 1 页 / 共 2 页
字号:
/* (c) Copyright Motorola 1997, 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 file handles Voice Annotation primitive handlers.   *************** REVISION HISTORY *********************************************     Date       Author      Reference   ========   ========    ==========================   04-11-23   aja099      libff38547              VST VR Port   03-06-13   aaa063      LIBdd01040              Implementation of VST VR functionality   2004-09-10 w16355      CR - LIBff14638              Audio Manager support for full duplex AMR voice.              - Changed tone names beginning with AM_ to start with DL_.   04-02-11   w17860      LIBdd75133              Phone looses audio when we do VA recording and close flip immediately.   04-02-19   w17860      LIBdd76721              PANIC: When fast forwarding on Voice Record.   00-12-21   mtaraba     CSGce82934              main_comp_hardware.h within engine_audio vob should be removed   01-03-16   blamers     CSGce90013              Rewind, Fast Forward, and meter does not correspond to voicenote              - The device layer does not send a resume after a FF to end command.  Therefore                the AM must fake the message in the Event Handler, but not notify the DL.   01-03-15   mtaraba     CSGce90543              AM is sending CTG_ON command unnecessarily resulting in VR hangup   00-10-13   blamers     CR - CSGce76448              VA Indication to the Device Layer must contain TD_VA_STATUS_SUCCESS              - Force the playback stop and erase indication to return                TD_VA_STATUS_SUCCESS when they complete successfully.   00-10-03   blamers     CR - CSGce75176              VA resume after VA pause restarts play from the beginning              - Pass a zero as the offset for the VA pause command.   00-09-01   blamers     CR - CSGce61298              Complete functionality for VA FF/Rew              - Remove unused event handlers              - Added VA fast forward, rewind, pause, and resume functionality   00-08-23   mtaraba     CR - CSGce65193              Move AM_AUDIO_PATH_TYPE enumeration to a global header file              - include audio_path_types.h   00-08-09   mtaraba     CR - CSGce55882              Eliminate file gsm.h from audio manager   00-05-05   shagino     CR - CSGce56425              Implement handsfree_status funtion              - Updated DL types to match new naming convention   00-03-15   mkloza      PR - CSGce51641              Blue Tooth modifications for P2K platform              - removed parameters from update_mode() function   99-12-25   wchoi       CR - CSGce39558              - suapi compilancy and added VA/VR functionality back in              - removed unnecessary C++ classes for sending suapi messages   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-04-26   blamers     PR - CSGce31167   99-03-29   blamers     PR - CSGce30057   99-02-26   blamers     CR - CSGce28847   99-01-20   blamers     CR - CSGce26811   99-01-04   dmuehl      CR - CSGce23316   98-12-21   blamers     CR - CSGce26131   98-10-05   blamers     PR - CSGce17243   98-09-29   jkraisor    CR - CSGce22626*//************** INCLUDES ******************************************************/#include <SUAPI/suapi.h>#include <ENGINE_AUDIO/audio_conditional_compile_def.h>#include <ENGINE_AUDIO/td_aud_tone_req_tone_type.h>#include <ENGINE_AUDIO/td_va_command.h>#include <ENGINE_AUDIO/td_va_status.h>#include <ENGINE_AUDIO/td_vr_error_codes.h>#include <ENGINE_AUDIO/audscm_va_ind.h>#include <ENGINE_AUDIO/aud_hw_stub_command_cnf.h>#include <ENGINE_AUDIO/aud_va_command_cnf.h>#include <ENGINE_AUDIO/aud_va_command_req.h>#include <ENGINE_AUDIO/aud_va_status_ind.h>#include <audio/aud_reformat_flash_ind.h>#include <ENGINE_AUDIO/audio_path_types.h>#include <ENGINE_SEEM/seem.h>#include <ENGINE_AUDIO/va_command_cnf.h>#include <ENGINE_AUDIO/va_status_ind.h>#include <audio/am_app_configuration_server.h>#include <audio/AM_App_Configuration_Server.H>#include <audio/am_va_vr_command_types.h>#include <ENGINE_AUDIO/am_hw_primitive_builder_interrupt.h>#include <audio/am_va_info.h>#include <audio/AM_Event_Handler.H>#include <SYNERGY_DEVICE_LAYER/dl_audio_auf.h>#include <audio/AM_Device_Layer_Interface.H>#include <ENGINE_AUDIO/aud_prim_ids.h>#include <audio/AM_Tone_Sequence_Handler.H>#if (AUDIO_DIGITAL_VOICE_ANNOTATOR == TRUE)/************** LOCAL CONSTANTS ***********************************************//************** LOCAL STRUCTURES, ENUMS, AND TYPEDEFS *************************//************** LOCAL FUNCTION PROTOTYPES *************************************//************** LOCAL MACROS **************************************************//************** LOCAL VARIABLES ***********************************************/BOOLEAN send_ind = FALSE;BOOLEAN send_start_play_req = FALSE;AUD_VA_COMMAND_REQ saved_msg;/************** FUNCTION DEFINITIONS ******************************************//* DESCRIPTION:       This function handles VA command request.   INPUTS:       incoming VA primitive   OUTPUTS:       None   IMPORTANT NOTES:       1. This function is valid only when conditional compilation flag of          digital VA is set to TRUE.*/void AM_Event_Handler::handle_aud_va_command_req(void *msg){    AUD_VA_COMMAND_REQ* aud_va_command_req = (AUD_VA_COMMAND_REQ*)msg;    // VA subcommand from the primitive    TD_VA_COMMAND new_command = aud_va_command_req->command;    // VA/VR command in progress    AM_VA_VR_COMMAND_TYPE command_in_progress =        am_event_va_vr_server.get_command(AM_AUDIO_PATH_ID_VA_VR_NON_AUDIO);    if  ((command_in_progress == AM_VA_VR_ABORT_CMD) ||         (command_in_progress == AM_VA_VR_DO_NOTHING_CMD) ||         ((command_in_progress == AM_VA_START_RECORD_CMD) &&          (new_command == TD_VA_COMMAND_STOP_RECORD)) ||         ((command_in_progress == AM_VA_PLAY_VOICE_NOTE_CMD) &&          ((new_command == TD_VA_COMMAND_FAST_FORWARD) ||           (new_command == TD_VA_COMMAND_REWIND) ||           (new_command == TD_VA_COMMAND_STOP_PLAY) ||           (new_command == TD_VA_COMMAND_FAST_FORWARD_TO_END) ||           (new_command == TD_VA_COMMAND_REWIND_TO_BEGIN) ||           (new_command == TD_VA_COMMAND_PAUSE))))    {        // process new command from passed primitive        switch(new_command)        {            case TD_VA_COMMAND_FAST_FORWARD:                send_ind = TRUE;                handle_va_stop_req(msg, am_va_byte_per_sec(3));                break;            case TD_VA_COMMAND_FAST_FORWARD_TO_END:                send_ind = TRUE;                send_start_play_req = TRUE;                saved_msg = *((AUD_VA_COMMAND_REQ*)msg);                handle_va_stop_req(msg, AM_VA_OFFSET_END);                break;            case TD_VA_COMMAND_REWIND:                send_ind = TRUE;                handle_va_stop_req(msg, am_va_byte_per_sec(-3));                break;            case TD_VA_COMMAND_REWIND_TO_BEGIN:                send_ind = TRUE;                handle_va_stop_req(msg, AM_VA_OFFSET_BEGIN);                break;            case TD_VA_COMMAND_PAUSE:                handle_va_stop_req(msg, 0);                break;            case TD_VA_COMMAND_STOP_PLAY:                handle_va_stop_req(msg, AM_VA_OFFSET_NO_CHANGE);                break;            case TD_VA_COMMAND_STOP_RECORD:                handle_va_stop_req(msg, AM_VA_OFFSET_NO_CHANGE);                break;            case TD_VA_COMMAND_START_PLAY:                handle_va_start_play_req(msg, AM_VA_OFFSET_BEGIN);                break;            case TD_VA_COMMAND_RESUME:                handle_va_start_play_req(msg, AM_VA_OFFSET_NO_CHANGE);                break;            case TD_VA_COMMAND_START_RECORD:                handle_va_start_record_req(msg);                break;            case TD_VA_COMMAND_ERASE:                handle_va_erase_req(msg);                break;            default:                Send2DeviceLayer_AUD_VA_Command_Cnf((TD_VA_STATUS)TD_DSP_FLASH_BUSY,                                                     AUD_VA_TIME_UNAVAILABLE,                                                    AUD_VA_TIME_UNAVAILABLE);                break;        }    }    else    {        // build and send primitive to device layer to indicate the new VA         // command cannot be processed because flash is busy        Send2DeviceLayer_AUD_VA_Command_Cnf((TD_VA_STATUS)TD_DSP_FLASH_BUSY,                                             AUD_VA_TIME_UNAVAILABLE,                                            AUD_VA_TIME_UNAVAILABLE);    }}/* DESCRIPTION:       This function handles a Start VA Recording request. It asks the       logic processor in application layer to start VA recording.   INPUTS:       incoming VA primitive   OUTPUTS:       None   IMPORTANT NOTES:       1. This function is valid only when conditional compilation flag of          digital VA is set to TRUE.*/void AM_Event_Handler::handle_va_start_record_req(void *msg){    AUD_VA_COMMAND_REQ* aud_va_command_req = (AUD_VA_COMMAND_REQ*)msg;    Tone_Item* cur_tone_ptr = eventqueuehandler.GetCurrent();    // Before starting audio capture for VST VR functionality, make sure that    // their is no tone currently playing. If there is a tone playing the    // audio capture session will not be started now, but restarted after the     // tone is complete as their is a check for the flag wait_for_tone_completion    // at that time.    if (audVstParams.activity == AUD_VST_CAPTURE_AUDIO && cur_tone_ptr != NULL)    {        audVstParams.wait_for_tone_completion = TRUE;    }     else    {        audVstParams.wait_for_tone_completion = FALSE;    // Determine the record audio path    UINT8 recording_audio_path =        (am_event_configuration_server.read(AM_CONFIGURATION_ID_INCALL)) ?        (AM_IN_CALL_RECORD_AUDIO_PATH) : (AM_NO_CALL_RECORD_AUDIO_PATH);    // save VoiceNote id from the incoming primitive to the data record in the VA/VR server    am_event_va_vr_server.save_va_data(recording_audio_path,                                       aud_va_command_req->voicenote_number);    // set command in the VA/VR server    am_event_va_vr_server.set_command(AM_VA_START_RECORD_CMD);    // generate a start recording command    am_event_logic_processor.generate_va_vr_command(DL_AUDIO_TONE_TYPE_VA_RECORD);}}/* DESCRIPTION:       This function handles a Start VA VoiceNote Playback request. It asks the logic       processor in application layer to start playing back a specified voice note.   INPUTS:       incoming VA primitive       va_offset to begin playback   OUTPUTS:       None   IMPORTANT NOTES:       1. This function is valid only when conditional compilation flag of          digital VA is set to TRUE.*/void AM_Event_Handler::handle_va_start_play_req(void *msg, AM_VA_OFFSET va_offset){    AUD_VA_COMMAND_REQ* aud_va_command_req = (AUD_VA_COMMAND_REQ*)msg;    // Determine the playback audio path    UINT8 playback_audio_path =        (am_event_configuration_server.read(AM_CONFIGURATION_ID_INCALL)) ?        (AM_IN_CALL_PLAY_AUDIO_PATH) : (AM_NO_CALL_PLAY_AUDIO_PATH);    // save VoiceNote id from the incoming primitive to the data, record in the VA/VR server    am_event_va_vr_server.save_va_data(playback_audio_path,                                       aud_va_command_req->voicenote_number,                                       va_offset);    // set command in the VA/VR server    am_event_va_vr_server.set_command(AM_VA_PLAY_VOICE_NOTE_CMD);    // generate a VA playback command    am_event_logic_processor.generate_va_vr_command(DL_AUDIO_TONE_TYPE_VA_PLAYBACK);}/* DESCRIPTION:       This function handles a Erase VA VoiceNote request. It asks the       logic processor in application layer to erase a specified VoiceNote(s).    INPUTS:       incoming VA primitive   OUTPUTS:       None   IMPORTANT NOTES:       1. This function is valid only when conditional compilation flag of          digital VA is set to TRUE.*/void AM_Event_Handler::handle_va_erase_req(void *msg){    AUD_VA_COMMAND_REQ* aud_va_command_req = (AUD_VA_COMMAND_REQ*)msg;

⌨️ 快捷键说明

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