亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? headset_volume.c

?? bluelab的一個很好的例程
?? C
?? 第 1 頁 / 共 2 頁
字號:
    3. Wait 100ms
    4. Ramp up the microphone gain from 0 to the desired value


RETURNS
    
*/
static void VolumeStartUnMuteMicrophone ( hsTaskData * pApp ) 
{
        /*1. Set mic gain to 0*/
    VolumeSetMicLevel ( pApp , 0 ) ;
        /*2. Set the mic bias to 1*/
    LEDManagerSetMicBias ( pApp , TRUE ) ;


    SOM_DEBUG(("SOM: StUnMuteMic\n")) ;
    
        /*post an internal Message to complete the Unmute*/
    MessageSendLater ( &pApp->task , EventDoCompleteUnMuteMic , 0 , VOLUME_MIC_UNMUTE_DELAY_MS ) ;

}
/****************************************************************************
NAME 
 VolumeCompleteUnmuteMicrophone

DESCRIPTION
 method to complete the unmute action - ramps the vol up to the desired level
    This should occur after the delay between setting the mic bias and beginning the #
    mic gain increase

RETURNS

*/
void VolumeCompleteUnmuteMicrophone ( hsTaskData * pApp )
{
    uint16 lMicLevel = pApp->theSoundTask.gVolMaps[pApp->theSoundTask.gSMVolumeLevel].Mic ;
    uint16 lRampLevel = 0 ;
    

    SOM_DEBUG(("SOM: ComUnMuteMic\n")) ;
    
/*4. Ramp up the microphone gain from 1 to the desired value*/
    for ( lRampLevel = 1; lRampLevel < (lMicLevel+1) ; lRampLevel++)
    {
        SOM_DEBUG(("SOM: Ramp Mic [%x]\n" , lRampLevel)) ;
        VolumeSetMicLevel ( pApp ,lRampLevel ) ;
    }
}

/****************************************************************************
NAME 
 VolumeSendAndSetHeadsetVolume

DESCRIPTION
 sets the vol to the level corresponding to the phone volume level
    In addition - send a response to the AG indicating new volume level

RETURNS
 void
    
*/
static void VolumeSendAndSetHeadsetVolume ( hsTaskData * pApp  ,uint16 pNewVolume , bool pPlayTone) 
{
        /*if there is a hfp attached - then send the vol change*/
    if ( stateManagerIsConnected() )
    {
           /*use correct profile instance*/
        if (pApp->profile_connected == hfp_handsfree_profile)
        {
           HfpSendSpeakerVolume ( pApp->hfp , pNewVolume ) ;
        }
        else
        {
           HfpSendSpeakerVolume ( pApp->hsp , pNewVolume ) ;
        }
    }
    
    SOM_DEBUG(("VOL: SEND and")) ;
    VolumeSetHeadsetVolume ( pApp , pNewVolume , pPlayTone ) ;
}
/****************************************************************************
NAME 
 VolumeSetHeadsetVolume

DESCRIPTION
 sets the internal speaker gain to the level corresponding to the phone volume level
    
RETURNS
 void
    
*/
static void VolumeSetHeadsetVolume ( hsTaskData * pApp  ,uint16 pNewVolume , bool pPlayTone) 
{    
    bool lMuted = (pApp->theSoundTask.gMuted == VOL_MUTED) ;
        
    bool lTonePlayed = FALSE ;


    bool lOverideMute = pApp->features.OverideMute ;
    bool lMuteLocalVolAction = pApp->features.MuteLocalVolAction ;

    SOM_DEBUG(("SET Vol [%x]\n" , pNewVolume)) ;
    
    SOM_DEBUG(("SOM : SetVol[%d][%d][%d]\n " , lMuted , lOverideMute , lMuteLocalVolAction)) ;
    
/*this should only occur if we are not muted*/
/*or if we are muted but wish to overide*/
    if ( (!lMuted ) || ( lOverideMute ) )
    {
        /*set the mic gain to the level specified at this corresponding profile volume level*/
        if ( lMuted ) /*if we were muted then unmute gently*/
        {
            MessageSend( &pApp->task , EventMuteOff , 0 ) ;
        }
        else
        {
            VolumeSetMicLevel ( pApp , pApp->theSoundTask.gVolMaps[pNewVolume].Mic) ;
        }

        VolumeScaleAndSetCodecs( pApp , pNewVolume) ;
        
        /*if there is a tone associated with this vol level  and we want to play it*/
        if ( soundManagerIsToneDefined ( pApp->theSoundTask.gVolMaps[pNewVolume].Tone ) )
        {
            if( (pPlayTone) )
            {
                lTonePlayed = TRUE ;
                SOM_DEBUG(("SOM: VolTn[%x]\n" , (int)pApp->theSoundTask.gVolMaps[pNewVolume].Tone)) ;
                soundManagerPlayTone ( pApp , pApp->theSoundTask.gVolMaps[pNewVolume].Tone  ) ;
            } 
        }
    }
    
/*this should be updated if we are not muted*/    
/*or if we are muted but wish to overide*/
/*or if we are muted , dont want to override but do want to take local mute vol action*/
        /*store the newly set profile volume*/
    if ( (!lMuted ) ||( lOverideMute ) || (lMuteLocalVolAction) )
    {
    
        pApp->theSoundTask.gSMVolumeLevel = pNewVolume ;
        VolumeScaleAndSetCodecs( pApp , pNewVolume) ;
        
            /*check that the tone is valid*/
        if ( soundManagerIsToneDefined ( pApp->theSoundTask.gVolMaps[pNewVolume].Tone ) )
        {
            if( (pPlayTone) )
            {
                    /*only attempt to play the tone if it has not yet been played*/
                if ( lTonePlayed == FALSE )
                {
                    SOM_DEBUG(("SOM: VolTn[%x]\n" , (int)pApp->theSoundTask.gVolMaps[pNewVolume].Tone)) ;
                    soundManagerPlayTone ( pApp , pApp->theSoundTask.gVolMaps[pNewVolume].Tone  ) ;
                }    
            } 
        }    
    }
}

/****************************************************************************
NAME 
 VolumeScaleVolume

DESCRIPTION
 helper function to scale the volume for the codecs
    
RETURNS
 void
    
*/
static uint16 VolumeScaleVolume ( uint16 pVolume , uint16 pRange )
{    
    uint16 lCodecVal = 0 ;
 
       /*scale and set the actual headset volume*/
    if (pVolume == 0 )
    {
        lCodecVal = 0 ;
    }
    else
    {
            /*calc the range = we have 16 vol settings 0-15 hence - 1*/
            /*pRange - we can only use settings in the range 0 to (pRange - 1) */
        lCodecVal = (pVolume  * (pRange - 1) ) / (SOM_NUM_VOL_SETTINGS - 1) ;
    }
    
    SOM_DEBUG(("SOM: Cod[%d]/%d*[%d] = [%d]\n", pVolume, SOM_NUM_VOL_SETTINGS, pRange , lCodecVal)) ;
 
    return lCodecVal ;
    
}
/****************************************************************************
NAME 
 VolumeScaleAndSetCodecs

DESCRIPTION
 Sets the Speaker Gain to the New scaled value
 
RETURNS
    
*/

static void VolumeScaleAndSetCodecs ( hsTaskData * pApp , uint16 pNewVolume ) 
{  
    uint16 lCodecVal = 0 ;
       /*scale the output value*/
    if (pApp->features.ScaleSpeakerCodec)
    {

        lCodecVal = VolumeScaleVolume ( pNewVolume , CodecOutputGainRange() ) ; 
    }
    else
    {
           /*only provide a non-zero volume */
        if (pNewVolume)
        {
            lCodecVal = pNewVolume + VOLUME_SPEAKER_CODEC_OFFSET ;
        }
        
        SOM_DEBUG(("SOM: LinCodScale[%x][%x]\n" , pNewVolume , lCodecVal)) ;
        
    }
    

        /*user defined codec gains take priority*/
    if (pApp->features.UseUserDefinedCodecGains)
    {
        SOM_DEBUG(("SOM: User Codec\n")) ;
        
        lCodecVal = pApp->theSoundTask.gVolMaps[pNewVolume].VolGain;
    }
    SOM_DEBUG(("SOM: Vol Codec [%d]\n" , lCodecVal)) ;
    
        /*and set the codecs  with the new value*/
    CodecSetOutputGainA(lCodecVal);
    CodecSetOutputGainB(lCodecVal);
}

/****************************************************************************
NAME 
 SetSpeakerVolumeForTonePlayback

DESCRIPTION
 Sets a VOlume Level to be used for the Tone playback. This level is just set to the
    codecs and notused as an internal volume level. This can be restored once the tone 
    playback is complete
 
RETURNS
    
*/
void VolumeSetForTonePlayback (hsTaskData * pApp , uint16 pNewVolume )
{
    VolumeScaleAndSetCodecs ( pApp , pNewVolume )  ;
}
/****************************************************************************
NAME 
 RestoreVolumeAfterTonePlayback

DESCRIPTION
 After the tone has been played - this restores the volume to the internal level used
 
RETURNS
    
*/
void VolumeRestoreAfterTonePlayback ( hsTaskData * pApp  ) 
{
        /*if we are currently muted and mutre controls the speaker gain then return to mute*/
    if ( (pApp->theSoundTask.gMuted == VOL_MUTED ) && (pApp->features.MuteSpeakerAndMic) )
    {
        VolumeScaleAndSetCodecs ( pApp , 0 )  ;    
    }
    else
    {
        VolumeScaleAndSetCodecs ( pApp , pApp->theSoundTask.gSMVolumeLevel )  ;    
    }
}

/****************************************************************************
NAME 
 VolumeGetStoredAGVolumeLevel

DESCRIPTION
 Get the stored volume level of the device with the specified bdaddr
 
RETURNS
   
*/
void VolumeGetStoredAGVolumeLevel(const bdaddr* bd_addr)
{
 ConnectionSmGetAttribute(SOM_VOLUME_PSKEY_BASE, bd_addr, sizeof(uint16));
}


/****************************************************************************
NAME 
 VolumeSetStoredAGVolumeLevel

DESCRIPTION
 Set the stored volume level of the device with the specified bdaddr
 
RETURNS
 
*/
void VolumeSetStoredAGVolumeLevel(const bdaddr* bd_addr, uint16 level)
{
 ConnectionSmPutAttribute(SOM_VOLUME_PSKEY_BASE, bd_addr, sizeof(uint16), (uint8*)&level);  
}

/****************************************************************************
NAME 
 VolumeMuteRemind

DESCRIPTION
 Sends a mute reminder message
 
RETURNS
 
*/
void VolumeMuteRemind ( hsTaskData * pApp )
{
        /*start the mute reminder event*/
    MessageSendLater( &pApp->task , EventMuteReminder , 0 ,D_SEC(pApp->theSoundTask.gSMMuteRemindTimeSec ) ) ;
}

/****************************************************************************
NAME 
 VolumeZero

DESCRIPTION
 Set the volume to zero
 
RETURNS
    
*/
void VolumeZero ( hsTaskData * pApp  ) 
{
	VolumeScaleAndSetCodecs ( pApp , 0 )  ;    
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日本一区二区| 日韩欧美一区二区免费| 久久99精品久久久久久| 亚洲成人综合在线| 一区二区三区在线观看国产 | 亚洲国产欧美在线人成| 一区二区高清免费观看影视大全| 亚洲色图欧洲色图| 亚洲九九爱视频| 一区二区三区在线播| 一个色在线综合| 丝袜脚交一区二区| 九九九久久久精品| 国产高清精品久久久久| 91啪九色porn原创视频在线观看| 99精品桃花视频在线观看| 色网站国产精品| 51精品视频一区二区三区| 亚洲精品一区二区三区在线观看| 久久久亚洲精品石原莉奈| 亚洲国产岛国毛片在线| 亚洲六月丁香色婷婷综合久久| 一区二区激情视频| 韩国成人福利片在线播放| 9人人澡人人爽人人精品| 欧美日韩一二三| 欧美精品一区二区三区很污很色的| 久久精品人人爽人人爽| 日韩一区日韩二区| 天天av天天翘天天综合网| 激情综合一区二区三区| 99久久精品国产观看| 欧美一激情一区二区三区| 国产亚洲综合av| 日韩中文字幕不卡| 成人一区在线观看| 欧美日韩久久不卡| 亚洲国产精品v| 肉色丝袜一区二区| 99久久国产综合精品麻豆| 91麻豆精品国产自产在线| 国产丝袜美腿一区二区三区| 亚洲国产人成综合网站| 菠萝蜜视频在线观看一区| 日韩一区二区在线播放| 亚洲免费电影在线| 国产精品一品二品| 欧美日韩国产综合久久| ...中文天堂在线一区| 美国精品在线观看| 欧美日韩国产免费| 亚洲精品久久久久久国产精华液| 国产精品一色哟哟哟| 91精品中文字幕一区二区三区| 国产精品夫妻自拍| 国产河南妇女毛片精品久久久| 欧美在线小视频| 中文字幕综合网| 成人精品免费看| 亚洲精品一区二区精华| 日产国产欧美视频一区精品| 在线精品观看国产| 亚洲精品第1页| www.综合网.com| 国产片一区二区| 国产精品正在播放| 久久亚区不卡日本| 九九在线精品视频| 精品久久久三级丝袜| 日本亚洲一区二区| 91精品在线免费观看| 日本女优在线视频一区二区| 欧美日韩国产另类不卡| 日日嗨av一区二区三区四区| 欧美男生操女生| 日韩精品一级二级 | 国产精品二三区| 成人avav影音| 亚洲视频在线观看三级| 一本大道久久a久久精品综合| 亚洲三级电影网站| 日本韩国精品在线| 亚洲国产婷婷综合在线精品| 欧美午夜在线一二页| 亚洲成人av福利| 制服丝袜一区二区三区| 精品制服美女丁香| 国产无一区二区| 成人av免费在线播放| 亚洲精品免费电影| 日韩欧美卡一卡二| 国产成人av在线影院| **网站欧美大片在线观看| 在线这里只有精品| 久久99精品久久久| 中文字幕日韩av资源站| 欧美日韩亚洲另类| 国产精品影音先锋| 亚洲精品日韩专区silk| 日韩欧美资源站| 高清不卡一区二区| 亚洲一区二区av在线| 欧美一区二区高清| 成人av影视在线观看| 性做久久久久久久免费看| 久久这里只有精品6| 在线免费观看一区| 精品一区二区在线视频| 亚洲免费观看高清完整版在线观看 | 亚洲成人av一区二区| 久久久亚洲精华液精华液精华液| www..com久久爱| 日本不卡视频在线| 一色桃子久久精品亚洲| 日韩一区二区三区在线视频| av在线不卡网| 韩国v欧美v日本v亚洲v| 亚洲一区二区高清| 国产精品久久久久影院| 日韩欧美一区二区三区在线| 色系网站成人免费| 成人免费不卡视频| 久久国产免费看| 视频在线观看91| 亚洲码国产岛国毛片在线| 2017欧美狠狠色| 日韩欧美一级特黄在线播放| 91黄色激情网站| 成人一级视频在线观看| 久久99精品久久久久久动态图 | 欧美一区二区在线视频| 99精品久久只有精品| 国产福利一区二区三区| 美腿丝袜亚洲三区| 夜夜嗨av一区二区三区四季av| 国产农村妇女毛片精品久久麻豆 | 欧美一级一级性生活免费录像| 91在线国内视频| 粗大黑人巨茎大战欧美成人| 狠狠色综合色综合网络| 青青草原综合久久大伊人精品优势| 亚洲欧美国产毛片在线| 国产精品电影一区二区三区| 国产清纯白嫩初高生在线观看91 | 亚洲v中文字幕| 伊人开心综合网| 亚洲欧美日本韩国| 国产精品久久夜| 中文字幕亚洲视频| 亚洲欧美日韩综合aⅴ视频| 中文字幕一区二| 一区二区久久久久久| 亚洲一区在线看| 亚洲第一av色| 日韩精品免费专区| 麻豆精品国产91久久久久久| 日本三级亚洲精品| 美女脱光内衣内裤视频久久影院| 天天综合色天天综合| 午夜精品久久久久久久久久久| 亚洲成a天堂v人片| 日韩av网站免费在线| 狠狠色综合色综合网络| 国产成人精品免费在线| 99在线精品视频| 91官网在线免费观看| 在线不卡的av| 久久亚洲综合色一区二区三区| 国产午夜精品久久久久久久| 国产精品私人影院| 亚洲网友自拍偷拍| 另类中文字幕网| 成人97人人超碰人人99| 色8久久精品久久久久久蜜 | 精品久久久久久久一区二区蜜臀| 欧美精品一区二区久久久| 中文字幕在线播放不卡一区| 亚洲综合视频在线| 久久精品国产99久久6| 成人99免费视频| 欧美高清激情brazzers| 国产亚洲欧洲997久久综合| 国产精品入口麻豆九色| 亚洲成人黄色影院| 国产成人av自拍| 欧美日本一道本| 日本一区二区久久| 婷婷中文字幕综合| 成人永久aaa| 日韩一级高清毛片| 最新国产の精品合集bt伙计| 日韩中文字幕不卡| 成人av网站免费观看| 日韩欧美一区二区三区在线| 国产精品电影院| 韩国欧美国产一区| 欧美日韩五月天| 国产精品不卡在线| 韩国精品主播一区二区在线观看| 欧美在线视频日韩|