First public contribution.
2 // Copyright (c) 2006-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".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
18 #include <ecom/ecom.h>
19 #include "mmfdevsoundserverstart.h"
20 #include "mmfdevsoundserver.h"
23 //OTHER EXPORTED FUNCTIONS
26 CMMFDevSoundServer::StartThread
27 Thread entry-point function.
28 The TServerStart objects is passed as the thread parameter
30 EXPORT_C TInt CMMFDevSoundServer::StartThread(TAny* aParms)
33 #ifdef SYMBIAN_USE_SEPARATE_HEAPS
36 TDevSoundServerStart* start = reinterpret_cast<TDevSoundServerStart*>(aParms);
37 CTrapCleanup* cleanup = CTrapCleanup::New();
44 TRAP(err, StartThreadL(*start));
48 REComSession::FinalClose();
49 #ifdef SYMBIAN_USE_SEPARATE_HEAPS
55 void CMMFDevSoundServer::StartThreadL(TDevSoundServerStart& aStart)
57 CActiveScheduler* sched = new(ELeave) CActiveScheduler;
58 CleanupStack::PushL(sched);
60 CActiveScheduler::Install(sched);
61 CMMFDevSoundServer* server = CMMFDevSoundServer::NewL(aStart.iAudioServer, aStart.iProcessId);
62 CleanupStack::PushL(server);
64 //Rename and set the priority of devsound server
65 RenamePrioritizeServer();
67 aStart.iDevSoundServerHandle = server->Server();
68 // Sync with the client and enter the active scheduler
69 RThread::Rendezvous(KErrNone);
72 CleanupStack::PopAndDestroy(2, sched); // sched, server