devsound/sounddevbt/src/server/Policy/MdaBtHwInfo.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2005-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 "MdaBtHwInfo.h"
       
    17 #include <e32svr.h>
       
    18 
       
    19 _LIT(KPddFileName,"ESDRV.PDD");
       
    20 _LIT(KLddFileName,"ESOUND.LDD");
       
    21 
       
    22 CMdaHwInfo::~CMdaHwInfo()
       
    23 	{
       
    24 	}
       
    25 
       
    26 void CMdaHwInfo::ConstructL()
       
    27 	{
       
    28 	GetHwInfoL();
       
    29 	}
       
    30 
       
    31 CMdaHwInfo* CMdaHwInfo::NewL()
       
    32 	{	
       
    33 	CMdaHwInfo* self = new(ELeave)CMdaHwInfo();
       
    34 	CleanupStack::PushL(self);
       
    35 	self->ConstructL();
       
    36 	CleanupStack::Pop();
       
    37 	return(self);
       
    38 	}
       
    39 
       
    40 CMdaHwInfo::CMdaHwInfo()
       
    41 	{
       
    42 	}
       
    43 
       
    44 void CMdaHwInfo::GetHwInfoL()
       
    45 	{
       
    46 //#ifdef __WINS__ @@@ Sound drivers must be present!!!
       
    47 
       
    48 	TInt ret = User::LoadPhysicalDevice(KPddFileName);
       
    49 	if ((ret!=KErrNone) && (ret!=KErrAlreadyExists))
       
    50 		User::Leave(ret);
       
    51 	ret = User::LoadLogicalDevice(KLddFileName);
       
    52 	if ((ret!=KErrNone) && (ret!=KErrAlreadyExists))
       
    53 		User::Leave(ret);
       
    54 
       
    55 	User::LeaveIfError(iDevice.Open());
       
    56 	if (!iDevice.Handle())
       
    57 		User::Leave(KErrBadHandle);
       
    58 
       
    59 	iDevice.PlayFormatsSupported(iPlayFormatsSupported);
       
    60 	iDevice.GetPlayFormat(iPlayFormat);
       
    61 	iDevice.RecordFormatsSupported(iRecordFormatsSupported);
       
    62 	iDevice.GetRecordFormat(iRecordFormat);
       
    63 
       
    64 	iDevice.Close();
       
    65 
       
    66 //#endif
       
    67 
       
    68 	}