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