os/mm/devsound/devsoundrefplugin/src/server/Policy/MdaHwInfo.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2002-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 "MdaHwInfo.h"
    17 #include <e32svr.h>
    18 
    19 #ifndef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER
    20 	_LIT(KPddFileName,"ESDRV.PDD");
    21 	_LIT(KLddFileName,"ESOUND.LDD");
    22 #endif
    23 
    24 CMdaHwInfo::~CMdaHwInfo()
    25 	{
    26 	}
    27 
    28 void CMdaHwInfo::ConstructL()
    29 	{
    30 	GetHwInfoL();
    31 	}
    32 
    33 CMdaHwInfo* CMdaHwInfo::NewL()
    34 	{	
    35 	CMdaHwInfo* self = new(ELeave)CMdaHwInfo();
    36 	CleanupStack::PushL(self);
    37 	self->ConstructL();
    38 	CleanupStack::Pop();
    39 	return(self);
    40 	}
    41 
    42 CMdaHwInfo::CMdaHwInfo()
    43 	{
    44 	}
    45 
    46 void CMdaHwInfo::GetHwInfoL()
    47 	{
    48 //#ifdef __WINS__ @@@ Sound drivers must be present!!!
    49 #ifndef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER
    50 	TInt ret = User::LoadPhysicalDevice(KPddFileName);
    51 	if ((ret!=KErrNone) && (ret!=KErrAlreadyExists))
    52 		User::Leave(ret);
    53 	ret = User::LoadLogicalDevice(KLddFileName);
    54 	if ((ret!=KErrNone) && (ret!=KErrAlreadyExists))
    55 		User::Leave(ret);
    56 #endif//Adapter loads the drivers too.
    57 	User::LeaveIfError(iDevice.Open());
    58 	if (!iDevice.Handle())
    59 		User::Leave(KErrBadHandle);
    60 
    61 	iDevice.PlayFormatsSupported(iPlayFormatsSupported);
    62 	iDevice.GetPlayFormat(iPlayFormat);
    63 	iDevice.RecordFormatsSupported(iRecordFormatsSupported);
    64 	iDevice.GetRecordFormat(iRecordFormat);
    65 
    66 	iDevice.Close();
    67 
    68 //#endif
    69 
    70 	}