os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/audiodspcontroltestdevice.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/audiodspcontroltestdevice.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,197 @@
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/implementationproxy.h>
1.21 +#include <ecom/ecom.h>
1.22 +#include <f32file.h>
1.23 +#include "audiodspcontroltestdevice.h"
1.24 +#include "devsoundciutestdevices.hrh"
1.25 +
1.26 +
1.27 +/*
1.28 +CMMFAudioDspControl implementation
1.29 +*/
1.30 +CMMFAudioDspControl* CMMFAudioDspControl::NewL()
1.31 + {
1.32 + CMMFAudioDspControl* self = new(ELeave) CMMFAudioDspControl();
1.33 + return self;
1.34 + }
1.35 +
1.36 +CMMFAudioDspControl::~CMMFAudioDspControl()
1.37 + {
1.38 + }
1.39 +
1.40 +//Actual implementation of method MmdspcGetAudioPlaybackInfo
1.41 +TInt CMMFAudioDspControl::MmdspcGetAudioPlaybackInfo (TInt64& aSamplesPlayed, TInt64& aSystemTime, TUint& aB, TUint& aT)
1.42 + {
1.43 + aSamplesPlayed = 999;
1.44 + aSystemTime = 999;
1.45 + aB = 999;
1.46 + aT = 999;
1.47 +
1.48 + return KErrNone;
1.49 + }
1.50 +
1.51 +//Actual implementation of method MmdspcAcceptRecordBuffersInvalidFollowingStop
1.52 +TInt CMMFAudioDspControl::MmdspcAcceptRecordBuffersInvalidFollowingStop()
1.53 + {
1.54 + return KErrNone;
1.55 + }
1.56 +
1.57 +//Actual implementation of method MmdspcAcceptPlaybackBuffersInvalidFollowingStop
1.58 +TInt CMMFAudioDspControl::MmdspcAcceptPlaybackBuffersInvalidFollowingStop()
1.59 + {
1.60 + return KErrNone;
1.61 + }
1.62 +
1.63 +
1.64 +/*
1.65 +implementation
1.66 +*/
1.67 +CMMFHwDevice* CAudioDspControlTestDevice::NewL()
1.68 + {
1.69 + CAudioDspControlTestDevice* self=new(ELeave) CAudioDspControlTestDevice();
1.70 + CleanupStack::PushL(self);
1.71 + self->ConstructL();
1.72 + CleanupStack::Pop(self);
1.73 + return self;
1.74 + }
1.75 +
1.76 +CAudioDspControlTestDevice::~CAudioDspControlTestDevice()
1.77 + {
1.78 + delete iAudioDspControl;
1.79 + }
1.80 +
1.81 +CAudioDspControlTestDevice::CAudioDspControlTestDevice()
1.82 + {
1.83 + }
1.84 +
1.85 +void CAudioDspControlTestDevice::ConstructL()
1.86 + {
1.87 + }
1.88 +
1.89 +TInt CAudioDspControlTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
1.90 + {
1.91 + return 0;
1.92 + }
1.93 +
1.94 +TInt CAudioDspControlTestDevice::Stop()
1.95 + {
1.96 + return 0;
1.97 + }
1.98 +
1.99 +TInt CAudioDspControlTestDevice::Pause()
1.100 + {
1.101 + return 0;
1.102 + }
1.103 +
1.104 +TInt CAudioDspControlTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
1.105 + {
1.106 + return 0;
1.107 + }
1.108 +
1.109 +TAny* CAudioDspControlTestDevice::CustomInterface(TUid aInterfaceId)
1.110 + {
1.111 + // Just return something non-NULL to keep the
1.112 + // DevSound initialisation process happy
1.113 + TAny* ret = static_cast<TAny*>(this);
1.114 +
1.115 + // Now for the CIs we want to test...
1.116 + if (aInterfaceId == KUidDSPControl)
1.117 + {
1.118 + if (!iAudioDspControl)
1.119 + {
1.120 + TRAPD(err, iAudioDspControl = CMMFAudioDspControl::NewL());
1.121 + if (err == KErrNone && iAudioDspControl)
1.122 + {
1.123 + MMMFDSPControl* ptr = this;
1.124 + ret = static_cast<TAny*>(ptr);
1.125 + }
1.126 + else
1.127 + {
1.128 + ret = NULL;
1.129 + }
1.130 + }
1.131 + }
1.132 +
1.133 + return ret;
1.134 + }
1.135 +
1.136 +TInt CAudioDspControlTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
1.137 + {
1.138 + return 0;
1.139 + }
1.140 +
1.141 +TInt CAudioDspControlTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
1.142 + {
1.143 + return 0;
1.144 + }
1.145 +
1.146 +TInt CAudioDspControlTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
1.147 + {
1.148 + return 0;
1.149 + }
1.150 +
1.151 +TInt CAudioDspControlTestDevice::StopAndDeleteCodec()
1.152 + {
1.153 + return 0;
1.154 + }
1.155 +
1.156 +TInt CAudioDspControlTestDevice::DeleteCodec()
1.157 + {
1.158 + return 0;
1.159 + }
1.160 +
1.161 +CMMFSwCodec& CAudioDspControlTestDevice::Codec()
1.162 + {
1.163 + return *iCodec;
1.164 + }
1.165 +
1.166 +TInt CAudioDspControlTestDevice::MmdspcGetAudioPlaybackInfo (TInt64& aSamplesPlayed, TInt64& aSystemTime, TUint& aB, TUint& aT)
1.167 + {
1.168 + TInt result = KErrBadHandle;
1.169 +
1.170 + if (iAudioDspControl)
1.171 + {
1.172 + result = iAudioDspControl->MmdspcGetAudioPlaybackInfo (aSamplesPlayed, aSystemTime, aB, aT);
1.173 + }
1.174 +
1.175 + return result;
1.176 + }
1.177 +
1.178 +TInt CAudioDspControlTestDevice::MmdspcAcceptRecordBuffersInvalidFollowingStop()
1.179 + {
1.180 + TInt result = KErrBadHandle;
1.181 +
1.182 + if (iAudioDspControl)
1.183 + {
1.184 + result = iAudioDspControl->MmdspcAcceptRecordBuffersInvalidFollowingStop();
1.185 + }
1.186 +
1.187 + return result;
1.188 + }
1.189 +
1.190 +TInt CAudioDspControlTestDevice::MmdspcAcceptPlaybackBuffersInvalidFollowingStop()
1.191 + {
1.192 + TInt result = KErrBadHandle;
1.193 +
1.194 + if (iAudioDspControl)
1.195 + {
1.196 + result = iAudioDspControl->MmdspcAcceptPlaybackBuffersInvalidFollowingStop();
1.197 + }
1.198 +
1.199 + return result;
1.200 + }