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

📄 am_relay_layer.cc

📁 Motorola synergy audio component
💻 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:       This file is so various levels of the app layer can access each other. *************** REVISION HISTORY *********************************************   Date       Author      Reference   ========   ========    ==========================   2005-03-28 w17860      CR - LIBff83188              pFT_PRC: No power on sound              - Make multimedia powerup tone volume similar to CTG power up tones.   2004-11-05 w17860      LIBff24932              P4.4 Feature # 12583 Memory Reduction               - Remove Voice Dial and Voice Tag   2005-01-26 w16355      LIBff50278              Audio Mgr support for new PTT tone volume setting.   2004-09-13 aja099      CR - LIBff06524              Added check for multimedia volume.              Changed get_volume_step interface, now we pass in entire info_ptr.                 2004-08-05 w17860      CR - LIBee04205              Need to support new feature ID to store the multimedia volume                                  2004-06-29 w16355      CR - LIBdd80946               PTT updates.   2004-05-10 w17860      LIBee08172              Make a seperate tone request for MFT Vib from MME   04-02-23   w18944      CR - LIBdd72710              WAV UI sounds   04-01-29   w18944      CR - LIBdd69286              Alert ramp up   03-12-16   w17860      CR - LIBdd62227              MFT vib Updates for E398   03-07-03   w18944      CR - LIBdd10607              add mm alert path type   02-06-18   lorih       CR - LIBbb38688              Use alert volume for multimedia audio   00-03-18   ktang       CR - CSGce90044              Gutted out CR75696 (r1.1 ATC support).   01-03-15   mloutris    CR - CSGce83858              Need separate volume settings for voice for each accessory class.   00-08-09   mtaraba     CR - CSGce55882              Eliminate file gsm.h from audio manager   00-08-04   ktang       PR - CSGce67917              Update audio Manager to support Synergy Lite tone defs              - Removed music ringer and uplink DTMF related code   00-08-05   charlesf    CR - CSGce68099              Obtain phone volume and ringer volume from Feature DB              - Previously we only obtained ringer volume   00-05-05   shagino     CR - CSGce56425              Implement handsfree_status function              - Updated DL types to match new naming convention   00-04-25   mkloza      PR - CSGce54341              Matrix command              - removed get_mode()   00-03-17   cfarrel     PR - CSGce47853              SiERRA Audio - Update Phase 6 Headers              - Change type name to conform to the C standards   00-03-15   mkloza      PR - CSGce51641              Blue Tooth modifications for P2K platform              - enabled hands free operation   99-11-19   Dale Noble  PR -              Added AM_Relay_Layer::get_tone() from inline in AM_Relay_Layer.H              Redisigned function.   99-11-19   shagino     PR - CSGce39546              Phase III Long & Short DTMF for GRiEF Audio              - Added a function to retrieve information necessary for the                 DSP in order to process DTMF tones.                   99-10-19   ktang       PR - CSGce40494              GRiEF AM Music Ringer              - Added constants note_type_to_freq_tbl and tempo_to_1_16_duration              - Added funtions get_music_note_freq, get_music_note_duration,                and set_music.   99-10-22   ktang       PR - CSGce40785              GRiEF Audio: DL Audio Tone Types and DL DB Feature IDs              - replaced td tone types and ids by DL tone types and ids   97-12-05   gswanson    PR - CSGce15192   97-12-05   mgilot      PR - CSGce15146   97-08-06   slam        PR - CSGce11610   97-11-17   krager      PR - CSGce14669   97-07-07   gswanson    PR - CSGce06712   97-06-03   slam        PR - CSGce10240   97-04-05   gswanson    CSGce08550   97-04-01   gswanson    CSGce07212*//************** INCLUDES ******************************************************/#include <audio/am_app_configuration_server.h>#include <audio/am_hw_primitive_builder_tone.h>#include <audio/AM_Relay_Layer.H>#include <ENGINE_AUDIO/am_c_utilities.h>#include <SYNERGY_DEVICE_LAYER/dl_db_feature_ids.h>#include <SYNERGY_CORE_APPS/app_mmc_features.h>#ifndef AUD_TONE_TYPE    #include <ENGINE_AUDIO/aud_tone_type.h>#endif/************** LOCAL CONSTANTS ***********************************************//************** STATIC DECLARATIONS  ******************************************/BOOL AM_Relay_Layer::am_va_vr_int_handle_vtag_complete = FALSE;/************** FUNCTION DEFINITIONS ******************************************//* Function to return a volume step for the given output path. * * Step 1: map the path to the feature_id. * Step 2: retrieve volume step from DL Feature DB. */UINT8AM_Relay_Layer :: get_volume_step ( AM_AUDIO_INFO* info_ptr ){    /*  Return zero for data, TX only, and non-audio path */    UINT8 volume_step = 0;    switch ( info_ptr->path_type )    {        case AM_AUDIO_PATH_ID_MULTIMEDIA_PLAY :            //  If the user changes the volume during a PTT call session,            //  ALWAYS choose the appropriate voice volume step.            if ( am_get_ptt_session_state() == TRUE )            {                //  Choose the voice volume step by handset, headset,                //  speakerphone or carkit (handsfree).                volume_step = AM_App_Feature_Server :: read_value( am_get_accessory_class_feature_id () );                break;            }            // If the powerup/down has a multimedia tone, it has to use the same volume as the CTG power up tone            // which uses the keypad volume            if (isPowerupdownTone(info_ptr->tone.fields.id))            {                volume_step = AM_App_Feature_Server :: read_value( DL_DB_FEATURE_ID_ENGINE_CURRENT_PHONE_VOLUME );                break;             }             #if (MMC_MAKE_MEDIA_VOLUME_SUPPORT == TRUE)            else            {                volume_step = AM_App_Feature_Server :: read_value( DL_DB_FEATURE_ID_CURRENT_MULTIMEDIA_VOLUME );                break;            }#endif        case AM_AUDIO_PATH_ID_ALERT_LITE :        case AM_AUDIO_PATH_ID_MULTIMEDIA_ALERT :        case AM_AUDIO_PATH_ID_PHANTOM_TONE:            if ( info_ptr->tone.fields.id == DL_AUDIO_TONE_TYPE_VOLUMEKEY_MULTIMEDIA_LITE )              volume_step = AM_App_Feature_Server :: read_value( DL_DB_FEATURE_ID_CURRENT_MULTIMEDIA_VOLUME );            else              volume_step = AM_App_Feature_Server :: read_value( DL_DB_FEATURE_ID_ENGINE_CURRENT_RINGER_VOLUME );            break;        case AM_AUDIO_PATH_ID_MULTIMEDIA_UI :        case AM_AUDIO_PATH_ID_UI_LITE :        case AM_AUDIO_PATH_ID_KEY_LITE :        case AM_AUDIO_PATH_ID_NETWORK_LITE :            /*  Push-To-Talk status (aka floor) tones have their own volume setting. */            if ( isPttFloorTone( info_ptr->tone.fields.id ) == TRUE )            {                volume_step = AM_App_Feature_Server :: read_value( DL_DB_FEATURE_ID_CURRENT_PTT_TONE_VOLUME );            }            else            {                volume_step = AM_App_Feature_Server :: read_value( DL_DB_FEATURE_ID_ENGINE_CURRENT_PHONE_VOLUME );            }            break;        case AM_AUDIO_PATH_ID_VOICE :#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )        case AM_AUDIO_PATH_ID_VA_VR_OUTPUT :        case AM_AUDIO_PATH_ID_VA_IO :#endif            volume_step = AM_App_Feature_Server :: read_value( am_get_accessory_class_feature_id () );            break;        case AM_AUDIO_PATH_ID_MULTIMEDIA_MFT_VIB:            /* The vibrate should always be played at the max volume whatever be the setting */            volume_step = 7;            break;    }    return(volume_step);}/* function to return the microphone gain * * Step 1: null. * Step 2: retrieve mic_gain from DL Feature DB. */UINT8AM_Relay_Layer :: get_mic_gain (AM_AUDIO_MODE_MASK mode){   return ((UINT8)(AM_App_Feature_Server :: read_value( DL_DB_FEATURE_ID_ENGINE_MIC_VOLUME )));}/***********************************************************************************   if dtmf tones are muted and    tone id is a dtmf key, make it a generic keypress.   else   if 'DTMF mute' is on,   then return the generic key press sound,    else return the passed in sound************************************************************************************/TD_AUD_TONE_REQ_TONE_TYPE_TAM_Relay_Layer :: get_tone(TD_AUD_TONE_REQ_TONE_TYPE_T tone){    TD_AUD_TONE_REQ_TONE_TYPE_T new_tone_id = tone;    if((IsDTMFKey(tone)) &&                           // is a key press tone, and       (AM_App_Feature_Server::read_state(DL_DB_FEATURE_ID_ENGINE_CURRENT_KEYTONE_TYPE) ==                    DL_DB_FEATURE_STATE_CURRENT_KEYTONE_TYPE_SINGLE))    {        new_tone_id = DL_AUDIO_TONE_TYPE_KEY_LITE;        /* set to generic tone */    }    else if(AM_App_Configuration_Server::read(AM_CONFIGURATION_ID_DTMF_SECRET ) == TRUE )    {        new_tone_id = DL_AUDIO_TONE_TYPE_KEY_LITE;        /* set to generic tone */    }    return(new_tone_id);}

⌨️ 快捷键说明

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