Example #1
0
/****************************************************************************
NAME    
    sinkFmRxPowerOff
    
DESCRIPTION
    Poewrs off the FM hardware to save power and free memory used

RETURNS
    nothing
*/   
void sinkFmRxPowerOff(void)
{    
    FM_DEBUG(("sinkFmRxPowerOff \n"));
    fmRxPowerOff();
    /* store current frequency in ps */
    configManagerWriteSessionData () ;          
}
Example #2
0
/****************************************************************************
NAME    
    sinkAudioSetEnhancement
DESCRIPTION
    updates the current audio enhancement settings and updates the dsp if it
    is currently running and streaming a2dp music.

RETURNS
    void
*/
void sinkAudioSetEnhancement(uint16 enhancement, bool enable)
{
    a2dp_stream_state a2dpStatePri = a2dp_stream_idle;
    a2dp_stream_state a2dpStateSec = a2dp_stream_idle;   
    Sink a2dpSinkPri = 0;
    Sink a2dpSinkSec = 0;
    uint16 lEnhancements;
    
    /* user has changed an enhancement default, set flag to indicate user values should be used and not 
       dsp default values */
    if(enhancement != MUSIC_CONFIG_SUB_WOOFER_BYPASS)    
    {
        /* don't update for sub woofer only changes */        
        theSink.a2dp_link_data->a2dp_audio_mode_params.music_mode_enhancements |= MUSIC_CONFIG_DATA_VALID;
    }
    
    /* take local copy as enhancement bits are inverted in the dsp */
    lEnhancements = theSink.a2dp_link_data->a2dp_audio_mode_params.music_mode_enhancements;
                
    /* if an enhancement is being enabled add to enables bitmask */
    if(enable)        
        lEnhancements |= enhancement;
    /* otherwise remove it */    
    else
        lEnhancements &= ~enhancement;
   
    /* determine if value has changed and needs to be committed to PS */
    if(theSink.a2dp_link_data->a2dp_audio_mode_params.music_mode_enhancements != lEnhancements)
    {
        theSink.a2dp_link_data->a2dp_audio_mode_params.music_mode_enhancements = lEnhancements;
        configManagerWriteSessionData () ; 
    }

    /* now decide whether the music manager is currently running and an update of 
       configuration is required */
         
    /* if a2dp connected obtain the current streaming state for primary a2dp connection */
    getA2dpStreamData(a2dp_primary,   &a2dpSinkPri, &a2dpStatePri);

    /* if a2dp connected obtain the current streaming state for secondary a2dp connection */
    getA2dpStreamData(a2dp_secondary, &a2dpSinkSec, &a2dpStateSec);
 
    /* Determine which a2dp source this is for */
    if(((a2dpStatePri == a2dp_stream_streaming) && (a2dpSinkPri == theSink.routed_audio))||
       ((a2dpStateSec == a2dp_stream_streaming) && (a2dpSinkSec == theSink.routed_audio))
#ifdef ENABLE_USB
       ||((usbAudioSinkMatch(theSink.routed_audio) && (theSink.usb.config.plugin_type == usb_plugin_stereo)))
#endif
#ifdef ENABLE_WIRED        
       ||(wiredAudioSinkMatch(theSink.routed_audio))
#endif        
      )
    {                
        AudioSetMode(AUDIO_MODE_CONNECTED, &theSink.a2dp_link_data->a2dp_audio_mode_params);
    }
}