devsound/a3fsrvstart/src/mmfaudioserverstart/mmfaudioserverstart.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 // INCLUDE FILES
       
    17 #include <e32std.h>
       
    18 #include <a3f/mmfaudioserverinterface.h>
       
    19 
       
    20 // -----------------------------------------------------------------------------
       
    21 // MainL
       
    22 // Just an E32Main and a MainL()
       
    23 // -----------------------------------------------------------------------------
       
    24 //
       
    25 LOCAL_C void MainL()
       
    26 /**
       
    27  * Much simpler, uses the new Rendezvous() call to sync with the client
       
    28  */
       
    29 	{
       
    30 	// Leave the hooks in for platform security
       
    31 #if (defined __DATA_CAGING__)
       
    32 	RProcess().DataCaging(RProcess::EDataCagingOn);
       
    33 	RProcess().SecureApi(RProcess::ESecureApiOn);
       
    34 #endif
       
    35 	CActiveScheduler* sched=NULL;
       
    36 	sched=new(ELeave) CActiveScheduler;
       
    37 	CActiveScheduler::Install(sched);
       
    38 	CAudioSvrLoader* server = NULL;
       
    39 	TRAPD(err,server = CAudioSvrLoader::NewL() );
       
    40 	// Sync with the client
       
    41 	RProcess::Rendezvous(err);
       
    42 	if(err == KErrNone)
       
    43 		{
       
    44 		// enter the active scheduler
       
    45 		sched->Start();
       
    46 		}
       
    47 	delete server;
       
    48 	server = NULL;
       
    49 	delete sched;
       
    50 	sched = NULL;
       
    51 	}
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // E32Main
       
    55 // Just an E32Main and a MainL()
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 GLDEF_C TInt E32Main()
       
    59 /**
       
    60  * @return - Standard Epoc error code on exit
       
    61  */
       
    62 	{
       
    63 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    64 	if(!cleanup)
       
    65 		{
       
    66 		return KErrNoMemory;
       
    67 		}
       
    68 	TRAP_IGNORE(MainL());
       
    69 	delete cleanup;
       
    70 	cleanup = NULL;
       
    71 	return KErrNone;
       
    72 	}
       
    73 
       
    74 // End of file