sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: #include "mmfaudioserverfactory.h" sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: * CMMFAudioServerFactory::CMMFAudioServerFactory sl@0: * C++ default constructor. sl@0: */ sl@0: CMMFAudioServerFactory::CMMFAudioServerFactory() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: * CMMFAudioServerFactory::ConstructL sl@0: * Symbian 2nd phase constructor. sl@0: */ sl@0: void CMMFAudioServerFactory::ConstructL() sl@0: { sl@0: TUid KAudioServiceInterfaceDefinitionUid = {KUidA3fAudioServicePlugin}; sl@0: RImplInfoPtrArray ecomArray; sl@0: CleanupResetAndDestroyPushL(ecomArray); sl@0: sl@0: MmPluginUtils::FindImplementationsL(KAudioServiceInterfaceDefinitionUid, ecomArray); sl@0: sl@0: TInt count = ecomArray.Count(); sl@0: sl@0: for (TInt i=0; iImplementationUid(); sl@0: sl@0: TAny* ptr = REComSession::CreateImplementationL( implementationUid,destructorKey,NULL); sl@0: MAudioSvrService* audioservice = (static_cast (ptr)); sl@0: audioservice->PassDestructorKey(destructorKey); sl@0: CleanupReleasePushL(*audioservice); sl@0: iAudioServList.AppendL(audioservice); sl@0: CleanupStack::Pop(audioservice); sl@0: User::LeaveIfError(audioservice->Load()); sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy(&ecomArray); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFAudioServerFactory::NewL sl@0: // Two-phased constructor. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CMMFAudioServerFactory* CMMFAudioServerFactory::NewL() sl@0: { sl@0: CMMFAudioServerFactory* self = new (ELeave)CMMFAudioServerFactory; sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: // Destructor sl@0: EXPORT_C CMMFAudioServerFactory::~CMMFAudioServerFactory() sl@0: { sl@0: TInt audioservicecount = iAudioServList.Count(); sl@0: for(TInt i= 0;iRelease(); sl@0: } sl@0: iAudioServList.Close(); sl@0: } sl@0: sl@0: /** sl@0: * CMMFAudioServerFactory::StartL sl@0: * Called by Audio Server when Audio Server is started sl@0: * (other items were commented in a header). sl@0: */ sl@0: EXPORT_C void CMMFAudioServerFactory::StartL( sl@0: const CMMFAudioServer& /*aAudioServer*/) sl@0: { sl@0: TInt audioservicecount = iAudioServList.Count(); sl@0: for (TInt i=0; iStart()); sl@0: } sl@0: sl@0: } sl@0: sl@0: /** sl@0: * CMMFAudioServerFactory::Stop sl@0: * Called by Audio Server when Audio Server is shutting down sl@0: */ sl@0: EXPORT_C void CMMFAudioServerFactory::Stop( sl@0: const CMMFAudioServer& /*aAudioServer*/) sl@0: { sl@0: TInt audioservicecount = iAudioServList.Count(); sl@0: for(TInt i= 0;iStop(); sl@0: } sl@0: sl@0: } sl@0: sl@0: // End of File