os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/gsmconfigtestdevice.cpp
Update contrib.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include <ecom/implementationproxy.h>
17 #include <ecom/ecom.h>
19 #include "gsmconfigtestdevice.h"
20 #include "devsoundciutestdevices.hrh"
24 CMMFGsmConfig implementation
26 CMMFGsmConfig* CMMFGsmConfig::NewL()
28 CMMFGsmConfig* self = new(ELeave) CMMFGsmConfig();
32 CMMFGsmConfig::~CMMFGsmConfig()
36 // Actual implementation of method
37 TInt CMMFGsmConfig::SetConversionFormat(TMMFGsmConversionFormat aConvFormat)
39 iConvFormat = aConvFormat;
43 // Actual implementation of method
44 TInt CMMFGsmConfig::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const
46 aConvFormat = iConvFormat;
52 CGsmConfigTestDevice Implementation
54 CMMFHwDevice* CGsmConfigTestDevice::NewL()
56 CGsmConfigTestDevice* self=new(ELeave) CGsmConfigTestDevice();
57 CleanupStack::PushL(self);
59 CleanupStack::Pop(self);
63 CGsmConfigTestDevice::~CGsmConfigTestDevice()
68 CGsmConfigTestDevice::CGsmConfigTestDevice()
72 void CGsmConfigTestDevice::ConstructL()
76 TInt CGsmConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
81 TInt CGsmConfigTestDevice::Stop()
86 TInt CGsmConfigTestDevice::Pause()
91 TInt CGsmConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
96 TAny* CGsmConfigTestDevice::CustomInterface(TUid aInterfaceId)
98 // Just return something non-NULL to keep the
99 // DevSound initialisation process happy
100 TAny* ret = static_cast<TAny*>(this);
102 // Now for the CIs we want to test...
103 if (aInterfaceId == KUidGsmConfig)
107 TRAPD(err, iGsmConfig = CMMFGsmConfig::NewL());
108 if (err == KErrNone && iGsmConfig)
110 MMMFGsmConfig* ptr = this;
111 ret = static_cast<TAny*>(ptr);
123 TInt CGsmConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
128 TInt CGsmConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
133 TInt CGsmConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
138 TInt CGsmConfigTestDevice::StopAndDeleteCodec()
143 TInt CGsmConfigTestDevice::DeleteCodec()
148 CMMFSwCodec& CGsmConfigTestDevice::Codec()
153 TInt CGsmConfigTestDevice::SetConversionFormat(TMMFGsmConversionFormat aConvFormat)
155 TInt result = KErrBadHandle;
159 result = iGsmConfig->SetConversionFormat(aConvFormat);
165 TInt CGsmConfigTestDevice::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const
167 TInt result = KErrBadHandle;
171 result = iGsmConfig->ConversionFormat(aConvFormat);