radioengine/utils/src/cradioroutableaudio.cpp
branchGCC_SURGE
changeset 37 451b2e1545b2
parent 14 63aabac4416d
parent 28 075425b8d9a4
equal deleted inserted replaced
26:6bcf277166c1 37:451b2e1545b2
    19 #include <AudioOutput.h>
    19 #include <AudioOutput.h>
    20 
    20 
    21 // User includes
    21 // User includes
    22 #include "cradioroutableaudio.h"
    22 #include "cradioroutableaudio.h"
    23 #include "cradioaudiorouter.h"
    23 #include "cradioaudiorouter.h"
       
    24 #include "cradioenginelogger.h"
    24 
    25 
    25 
    26 
    26 // ---------------------------------------------------------------------------
    27 // ---------------------------------------------------------------------------
    27 //
    28 //
    28 // ---------------------------------------------------------------------------
    29 // ---------------------------------------------------------------------------
    29 //
    30 //
    30 EXPORT_C CRadioRoutableAudio::CRadioRoutableAudio( CRadioAudioRouter* aAudioRouter )
    31 EXPORT_C CRadioRoutableAudio::CRadioRoutableAudio( CRadioAudioRouter* aAudioRouter )
    31     : iAudioRouter( aAudioRouter )
    32     : iAudioRouter( aAudioRouter )
    32     {
    33     {
       
    34     LEVEL3( LOG_METHOD_AUTO );
    33     iAudioRouter->RegisterRoutableAudio( this );
    35     iAudioRouter->RegisterRoutableAudio( this );
    34     }
    36     }
    35 
    37 
    36 // ---------------------------------------------------------------------------
    38 // ---------------------------------------------------------------------------
    37 //
    39 //
    49 //
    51 //
    50 // ---------------------------------------------------------------------------
    52 // ---------------------------------------------------------------------------
    51 //
    53 //
    52 EXPORT_C void CRadioRoutableAudio::SetAudioOutput( CAudioOutput* aAudioOutput )
    54 EXPORT_C void CRadioRoutableAudio::SetAudioOutput( CAudioOutput* aAudioOutput )
    53     {
    55     {
       
    56     LEVEL3( LOG_METHOD_AUTO );
    54     delete iAudioOutput;
    57     delete iAudioOutput;
    55     iAudioOutput = aAudioOutput;
    58     iAudioOutput = aAudioOutput;
    56     }
    59     }
    57 
    60 
    58 // ---------------------------------------------------------------------------
    61 // ---------------------------------------------------------------------------
    59 //
    62 //
    60 // ---------------------------------------------------------------------------
    63 // ---------------------------------------------------------------------------
    61 //
    64 //
    62 EXPORT_C void CRadioRoutableAudio::DeleteAudioOutput()
    65 EXPORT_C void CRadioRoutableAudio::DeleteAudioOutput()
    63     {
    66     {
       
    67     LEVEL3( LOG_METHOD_AUTO );
    64     delete iAudioOutput;
    68     delete iAudioOutput;
    65     iAudioOutput = NULL;
    69     iAudioOutput = NULL;
    66     }
    70     }
    67 
    71 
    68 // ---------------------------------------------------------------------------
    72 // ---------------------------------------------------------------------------
    69 //
    73 //
    70 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    71 //
    75 //
    72 EXPORT_C void CRadioRoutableAudio::SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute )
    76 EXPORT_C void CRadioRoutableAudio::SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute )
    73     {
    77     {
       
    78     LEVEL3( LOG_METHOD_AUTO );
    74     if ( iAudioOutput )
    79     if ( iAudioOutput )
    75         {
    80         {
    76         iAudioOutput->SetAudioOutputL( aRoute == RadioEngine::ERadioSpeaker ? CAudioOutput::EPublic
    81         iAudioOutput->SetAudioOutputL( aRoute == RadioEngine::ERadioSpeaker ? CAudioOutput::EPublic
    77                                                                             : CAudioOutput::EPrivate );
    82                                                                             : CAudioOutput::EPrivate );
    78         }
    83         }
    82 //
    87 //
    83 // ---------------------------------------------------------------------------
    88 // ---------------------------------------------------------------------------
    84 //
    89 //
    85 EXPORT_C TBool CRadioRoutableAudio::AudioRoutingSupported() const
    90 EXPORT_C TBool CRadioRoutableAudio::AudioRoutingSupported() const
    86     {
    91     {
       
    92     LEVEL3( LOG_METHOD_AUTO );
    87 #ifdef __WINS__
    93 #ifdef __WINS__
    88     return ETrue;
    94     return ETrue;
    89 #else
    95 #else
    90     return iAudioOutput ? ETrue : EFalse;
    96     return iAudioOutput ? ETrue : EFalse;
    91 #endif
    97 #endif