os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/underflowautostopcontroltestdevice.cpp
First public contribution.
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 "underflowautostopcontroltestdevice.h"
20 #include "devsoundciutestdevices.hrh"
24 CMMFUnderflowAutoStopControl implementation
26 CMMFUnderflowAutoStopControl* CMMFUnderflowAutoStopControl::NewL()
28 CMMFUnderflowAutoStopControl* self = new(ELeave) CMMFUnderflowAutoStopControl();
32 CMMFUnderflowAutoStopControl::~CMMFUnderflowAutoStopControl()
36 // Actual implementation of method
37 TInt CMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop()
44 CUnderflowAutoStopControlTestDevice Implementation
46 CMMFHwDevice* CUnderflowAutoStopControlTestDevice::NewL()
48 CUnderflowAutoStopControlTestDevice* self=new(ELeave) CUnderflowAutoStopControlTestDevice();
49 CleanupStack::PushL(self);
51 CleanupStack::Pop(self);
55 CUnderflowAutoStopControlTestDevice::~CUnderflowAutoStopControlTestDevice()
57 delete iUnderflowAutoStopCtrl;
60 CUnderflowAutoStopControlTestDevice::CUnderflowAutoStopControlTestDevice()
64 void CUnderflowAutoStopControlTestDevice::ConstructL()
68 TInt CUnderflowAutoStopControlTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
73 TInt CUnderflowAutoStopControlTestDevice::Stop()
78 TInt CUnderflowAutoStopControlTestDevice::Pause()
83 TInt CUnderflowAutoStopControlTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
88 TAny* CUnderflowAutoStopControlTestDevice::CustomInterface(TUid aInterfaceId)
90 // Just return something non-NULL to keep the
91 // DevSound initialisation process happy
92 TAny* ret = static_cast<TAny*>(this);
94 // Now for the CIs we want to test...
95 if (aInterfaceId == KUidUnderflowAutoStopControl)
97 if (!iUnderflowAutoStopCtrl)
99 TRAPD(err, iUnderflowAutoStopCtrl = CMMFUnderflowAutoStopControl::NewL());
100 if (err == KErrNone && iUnderflowAutoStopCtrl)
102 MMMFUnderflowAutoStopControl* ptr = this;
103 ret = static_cast<TAny*>(ptr);
115 TInt CUnderflowAutoStopControlTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
120 TInt CUnderflowAutoStopControlTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
125 TInt CUnderflowAutoStopControlTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
130 TInt CUnderflowAutoStopControlTestDevice::StopAndDeleteCodec()
135 TInt CUnderflowAutoStopControlTestDevice::DeleteCodec()
140 CMMFSwCodec& CUnderflowAutoStopControlTestDevice::Codec()
145 TInt CUnderflowAutoStopControlTestDevice::MmuascTurnOffUnderflowAutoStop()
147 TInt result = KErrBadHandle;
149 if (iUnderflowAutoStopCtrl)
151 result = iUnderflowAutoStopCtrl->MmuascTurnOffUnderflowAutoStop();