os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/gsmconfigtestdevice.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/gsmconfigtestdevice.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,175 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <ecom/implementationproxy.h>
1.20 +#include <ecom/ecom.h>
1.21 +#include <f32file.h>
1.22 +#include "gsmconfigtestdevice.h"
1.23 +#include "devsoundciutestdevices.hrh"
1.24 +
1.25 +
1.26 +/*
1.27 +CMMFGsmConfig implementation
1.28 +*/
1.29 +CMMFGsmConfig* CMMFGsmConfig::NewL()
1.30 + {
1.31 + CMMFGsmConfig* self = new(ELeave) CMMFGsmConfig();
1.32 + return self;
1.33 + }
1.34 +
1.35 +CMMFGsmConfig::~CMMFGsmConfig()
1.36 + {
1.37 + }
1.38 +
1.39 +// Actual implementation of method
1.40 +TInt CMMFGsmConfig::SetConversionFormat(TMMFGsmConversionFormat aConvFormat)
1.41 + {
1.42 + iConvFormat = aConvFormat;
1.43 + return KErrNone;
1.44 + }
1.45 +
1.46 +// Actual implementation of method
1.47 +TInt CMMFGsmConfig::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const
1.48 + {
1.49 + aConvFormat = iConvFormat;
1.50 + return KErrNone;
1.51 + }
1.52 +
1.53 +
1.54 +/*
1.55 +CGsmConfigTestDevice Implementation
1.56 +*/
1.57 +CMMFHwDevice* CGsmConfigTestDevice::NewL()
1.58 + {
1.59 + CGsmConfigTestDevice* self=new(ELeave) CGsmConfigTestDevice();
1.60 + CleanupStack::PushL(self);
1.61 + self->ConstructL();
1.62 + CleanupStack::Pop(self);
1.63 + return self;
1.64 + }
1.65 +
1.66 +CGsmConfigTestDevice::~CGsmConfigTestDevice()
1.67 + {
1.68 + delete iGsmConfig;
1.69 + }
1.70 +
1.71 +CGsmConfigTestDevice::CGsmConfigTestDevice()
1.72 + {
1.73 + }
1.74 +
1.75 +void CGsmConfigTestDevice::ConstructL()
1.76 + {
1.77 + }
1.78 +
1.79 +TInt CGsmConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
1.80 + {
1.81 + return 0;
1.82 + }
1.83 +
1.84 +TInt CGsmConfigTestDevice::Stop()
1.85 + {
1.86 + return 0;
1.87 + }
1.88 +
1.89 +TInt CGsmConfigTestDevice::Pause()
1.90 + {
1.91 + return 0;
1.92 + }
1.93 +
1.94 +TInt CGsmConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
1.95 + {
1.96 + return 0;
1.97 + }
1.98 +
1.99 +TAny* CGsmConfigTestDevice::CustomInterface(TUid aInterfaceId)
1.100 + {
1.101 + // Just return something non-NULL to keep the
1.102 + // DevSound initialisation process happy
1.103 + TAny* ret = static_cast<TAny*>(this);
1.104 +
1.105 + // Now for the CIs we want to test...
1.106 + if (aInterfaceId == KUidGsmConfig)
1.107 + {
1.108 + if (!iGsmConfig)
1.109 + {
1.110 + TRAPD(err, iGsmConfig = CMMFGsmConfig::NewL());
1.111 + if (err == KErrNone && iGsmConfig)
1.112 + {
1.113 + MMMFGsmConfig* ptr = this;
1.114 + ret = static_cast<TAny*>(ptr);
1.115 + }
1.116 + else
1.117 + {
1.118 + ret = NULL;
1.119 + }
1.120 + }
1.121 + }
1.122 +
1.123 + return ret;
1.124 + }
1.125 +
1.126 +TInt CGsmConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
1.127 + {
1.128 + return 0;
1.129 + }
1.130 +
1.131 +TInt CGsmConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
1.132 + {
1.133 + return 0;
1.134 + }
1.135 +
1.136 +TInt CGsmConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
1.137 + {
1.138 + return 0;
1.139 + }
1.140 +
1.141 +TInt CGsmConfigTestDevice::StopAndDeleteCodec()
1.142 + {
1.143 + return 0;
1.144 + }
1.145 +
1.146 +TInt CGsmConfigTestDevice::DeleteCodec()
1.147 + {
1.148 + return 0;
1.149 + }
1.150 +
1.151 +CMMFSwCodec& CGsmConfigTestDevice::Codec()
1.152 + {
1.153 + return *iCodec;
1.154 + }
1.155 +
1.156 +TInt CGsmConfigTestDevice::SetConversionFormat(TMMFGsmConversionFormat aConvFormat)
1.157 + {
1.158 + TInt result = KErrBadHandle;
1.159 +
1.160 + if (iGsmConfig)
1.161 + {
1.162 + result = iGsmConfig->SetConversionFormat(aConvFormat);
1.163 + }
1.164 +
1.165 + return result;
1.166 + }
1.167 +
1.168 +TInt CGsmConfigTestDevice::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const
1.169 + {
1.170 + TInt result = KErrBadHandle;
1.171 +
1.172 + if (iGsmConfig)
1.173 + {
1.174 + result = iGsmConfig->ConversionFormat(aConvFormat);
1.175 + }
1.176 +
1.177 + return result;
1.178 + }