radioengine/engine/src/cradioengine.cpp
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 // User includes
       
    19 #include "cradioengine.h"
       
    20 #include "cradioengineimp.h"
       
    21 #include "cradioenginelogger.h"
       
    22 #include "mradioengineinitializer.h"
       
    23 #include "radioengineutils.h"
       
    24 
       
    25 // ================= MEMBER FUNCTIONS =======================
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // Starts the radio engine initialization.
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 EXPORT_C CRadioEngine* CRadioEngine::NewL( MRadioEngineInitializer& aInitializer )
       
    32     {
       
    33     RadioEngineUtils::InitializeL();
       
    34     LEVEL3( LOG_METHOD_AUTO );
       
    35     CRadioAudioRouter* audioRouter = aInitializer.InitAudioRouterL();
       
    36     CleanupStack::PushL( audioRouter );
       
    37 
       
    38     CRadioEngineImp* self = new (ELeave) CRadioEngineImp( audioRouter );
       
    39     CleanupStack::Pop( audioRouter );
       
    40     CleanupStack::PushL( self );
       
    41 
       
    42     self->SetSystemEventCollector( aInitializer.InitSystemEventCollectorL() );
       
    43     self->SetRadioSettings( aInitializer.InitSettingsL() );
       
    44     self->ConstructL();
       
    45 
       
    46     self->InitRadioL( self->DetermineRegion() );
       
    47     self->EnableAudio( ETrue );
       
    48 
       
    49     CleanupStack::Pop( self );
       
    50     return self;
       
    51     }
       
    52 
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 // ---------------------------------------------------------------------------
       
    56 //
       
    57 CRadioEngine::CRadioEngine( CRadioAudioRouter* aAudioRouter )
       
    58     : CRadioRoutableAudio( aAudioRouter )
       
    59     {
       
    60     LEVEL3( LOG_METHOD_AUTO );
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 EXPORT_C CRadioEngine::~CRadioEngine()
       
    68     {
       
    69     RadioEngineUtils::Release();
       
    70     }