radioengine/utils/src/cradioaudiorouter.cpp
branchGCC_SURGE
changeset 37 451b2e1545b2
parent 14 63aabac4416d
parent 28 075425b8d9a4
equal deleted inserted replaced
26:6bcf277166c1 37:451b2e1545b2
    30 // ---------------------------------------------------------------------------
    30 // ---------------------------------------------------------------------------
    31 //
    31 //
    32 CRadioAudioRouter::CRadioAudioRouter( MRadioAudioRoutingObserver& aAudioRoutingObserver )
    32 CRadioAudioRouter::CRadioAudioRouter( MRadioAudioRoutingObserver& aAudioRoutingObserver )
    33     : iAudioRoutingObserver( aAudioRoutingObserver )
    33     : iAudioRoutingObserver( aAudioRoutingObserver )
    34     {
    34     {
       
    35     LEVEL3( LOG_METHOD_AUTO );
    35     }
    36     }
    36 
    37 
    37 // ---------------------------------------------------------------------------
    38 // ---------------------------------------------------------------------------
    38 //
    39 //
    39 // ---------------------------------------------------------------------------
    40 // ---------------------------------------------------------------------------
    40 //
    41 //
    41 EXPORT_C CRadioAudioRouter* CRadioAudioRouter::NewL( MRadioAudioRoutingObserver& aAudioRoutingObserver )
    42 EXPORT_C CRadioAudioRouter* CRadioAudioRouter::NewL( MRadioAudioRoutingObserver& aAudioRoutingObserver )
    42     {
    43     {
       
    44     LEVEL3( LOG_METHOD_AUTO );
    43     CRadioAudioRouter* self = new( ELeave ) CRadioAudioRouter( aAudioRoutingObserver );
    45     CRadioAudioRouter* self = new( ELeave ) CRadioAudioRouter( aAudioRoutingObserver );
    44     CleanupStack::PushL( self );
    46     CleanupStack::PushL( self );
    45     self->ConstructL();
    47     self->ConstructL();
    46     CleanupStack::Pop( self );
    48     CleanupStack::Pop( self );
    47     return self;
    49     return self;
    51 //
    53 //
    52 // ---------------------------------------------------------------------------
    54 // ---------------------------------------------------------------------------
    53 //
    55 //
    54 EXPORT_C CRadioAudioRouter::~CRadioAudioRouter()
    56 EXPORT_C CRadioAudioRouter::~CRadioAudioRouter()
    55     {
    57     {
       
    58     LEVEL3( LOG_METHOD_AUTO );
    56     iRoutableAudios.Close();
    59     iRoutableAudios.Close();
    57     RadioEngineUtils::Release();
    60     RadioEngineUtils::Release();
    58     }
    61     }
    59 
    62 
    60 // ---------------------------------------------------------------------------
    63 // ---------------------------------------------------------------------------
    62 // ---------------------------------------------------------------------------
    65 // ---------------------------------------------------------------------------
    63 //
    66 //
    64 void CRadioAudioRouter::ConstructL()
    67 void CRadioAudioRouter::ConstructL()
    65     {
    68     {
    66     RadioEngineUtils::InitializeL();
    69     RadioEngineUtils::InitializeL();
       
    70     LEVEL3( LOG_METHOD_AUTO );
    67     iRoutableAudios = RArray<CRadioRoutableAudio*>( KVisualRadioInitialRoutableAudioArraySize );
    71     iRoutableAudios = RArray<CRadioRoutableAudio*>( KVisualRadioInitialRoutableAudioArraySize );
    68     }
    72     }
    69 
    73 
    70 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    71 // Sets audio route
    75 // Sets audio route
    72 // ---------------------------------------------------------------------------
    76 // ---------------------------------------------------------------------------
    73 //
    77 //
    74 EXPORT_C void CRadioAudioRouter::SetAudioRouteL( RadioEngine::TRadioAudioRoute aAudioRoute )
    78 EXPORT_C void CRadioAudioRouter::SetAudioRouteL( RadioEngine::TRadioAudioRoute aAudioRoute )
    75     {
    79     {
    76     LOG_FORMAT( "CRadioAudioRouter::SetAudioRouteL: Route: %d", aAudioRoute );
    80     LEVEL3( LOG_METHOD_AUTO );
    77 
    81 
    78     for ( TInt i = 0 ; i < iRoutableAudios.Count(); i++ )
    82     for ( TInt i = 0 ; i < iRoutableAudios.Count(); i++ )
    79         {
    83         {
    80         iRoutableAudios[i]->SetAudioRouteL( aAudioRoute );
    84         iRoutableAudios[i]->SetAudioRouteL( aAudioRoute );
    81         }
    85         }
    86 //
    90 //
    87 // ---------------------------------------------------------------------------
    91 // ---------------------------------------------------------------------------
    88 //
    92 //
    89 EXPORT_C void CRadioAudioRouter::RegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio )
    93 EXPORT_C void CRadioAudioRouter::RegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio )
    90     {
    94     {
    91     LOG( "CRadioAudioRouter::RegisterRoutableAudio" );
    95     LEVEL3( LOG_METHOD_AUTO );
    92     iRoutableAudios.Append( aRoutableAudio );
    96     iRoutableAudios.Append( aRoutableAudio );
    93     }
    97     }
    94 
    98 
    95 // ---------------------------------------------------------------------------
    99 // ---------------------------------------------------------------------------
    96 //
   100 //
    97 // ---------------------------------------------------------------------------
   101 // ---------------------------------------------------------------------------
    98 //
   102 //
    99 EXPORT_C void CRadioAudioRouter::UnRegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio )
   103 EXPORT_C void CRadioAudioRouter::UnRegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio )
   100     {
   104     {
   101     LOG( "CRadioAudioRouter::UnRegisterRoutableAudio" );
   105     LEVEL3( LOG_METHOD_AUTO );
   102 
   106 
   103     TInt objectIndex = iRoutableAudios.Find( aRoutableAudio );
   107     TInt objectIndex = iRoutableAudios.Find( aRoutableAudio );
   104 
   108 
   105     __ASSERT_DEBUG( objectIndex != KErrNotFound, User::Panic( _L("VisualRadio" ), KErrAbort ) );
   109     __ASSERT_DEBUG( objectIndex != KErrNotFound, User::Panic( _L("VisualRadio" ), KErrAbort ) );
   106 
   110