os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/underflowautostopcontroltestdevice.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/underflowautostopcontroltestdevice.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,155 @@
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 "underflowautostopcontroltestdevice.h"
1.23 +#include "devsoundciutestdevices.hrh"
1.24 +
1.25 +
1.26 +/*
1.27 +CMMFUnderflowAutoStopControl implementation
1.28 +*/
1.29 +CMMFUnderflowAutoStopControl* CMMFUnderflowAutoStopControl::NewL()
1.30 + {
1.31 + CMMFUnderflowAutoStopControl* self = new(ELeave) CMMFUnderflowAutoStopControl();
1.32 + return self;
1.33 + }
1.34 +
1.35 +CMMFUnderflowAutoStopControl::~CMMFUnderflowAutoStopControl()
1.36 + {
1.37 + }
1.38 +
1.39 +// Actual implementation of method
1.40 +TInt CMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop()
1.41 + {
1.42 + return KErrNone;
1.43 + }
1.44 +
1.45 +
1.46 +/*
1.47 +CUnderflowAutoStopControlTestDevice Implementation
1.48 +*/
1.49 +CMMFHwDevice* CUnderflowAutoStopControlTestDevice::NewL()
1.50 + {
1.51 + CUnderflowAutoStopControlTestDevice* self=new(ELeave) CUnderflowAutoStopControlTestDevice();
1.52 + CleanupStack::PushL(self);
1.53 + self->ConstructL();
1.54 + CleanupStack::Pop(self);
1.55 + return self;
1.56 + }
1.57 +
1.58 +CUnderflowAutoStopControlTestDevice::~CUnderflowAutoStopControlTestDevice()
1.59 + {
1.60 + delete iUnderflowAutoStopCtrl;
1.61 + }
1.62 +
1.63 +CUnderflowAutoStopControlTestDevice::CUnderflowAutoStopControlTestDevice()
1.64 + {
1.65 + }
1.66 +
1.67 +void CUnderflowAutoStopControlTestDevice::ConstructL()
1.68 + {
1.69 + }
1.70 +
1.71 +TInt CUnderflowAutoStopControlTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
1.72 + {
1.73 + return 0;
1.74 + }
1.75 +
1.76 +TInt CUnderflowAutoStopControlTestDevice::Stop()
1.77 + {
1.78 + return 0;
1.79 + }
1.80 +
1.81 +TInt CUnderflowAutoStopControlTestDevice::Pause()
1.82 + {
1.83 + return 0;
1.84 + }
1.85 +
1.86 +TInt CUnderflowAutoStopControlTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
1.87 + {
1.88 + return 0;
1.89 + }
1.90 +
1.91 +TAny* CUnderflowAutoStopControlTestDevice::CustomInterface(TUid aInterfaceId)
1.92 + {
1.93 + // Just return something non-NULL to keep the
1.94 + // DevSound initialisation process happy
1.95 + TAny* ret = static_cast<TAny*>(this);
1.96 +
1.97 + // Now for the CIs we want to test...
1.98 + if (aInterfaceId == KUidUnderflowAutoStopControl)
1.99 + {
1.100 + if (!iUnderflowAutoStopCtrl)
1.101 + {
1.102 + TRAPD(err, iUnderflowAutoStopCtrl = CMMFUnderflowAutoStopControl::NewL());
1.103 + if (err == KErrNone && iUnderflowAutoStopCtrl)
1.104 + {
1.105 + MMMFUnderflowAutoStopControl* ptr = this;
1.106 + ret = static_cast<TAny*>(ptr);
1.107 + }
1.108 + else
1.109 + {
1.110 + ret = NULL;
1.111 + }
1.112 + }
1.113 + }
1.114 +
1.115 + return ret;
1.116 + }
1.117 +
1.118 +TInt CUnderflowAutoStopControlTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
1.119 + {
1.120 + return 0;
1.121 + }
1.122 +
1.123 +TInt CUnderflowAutoStopControlTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
1.124 + {
1.125 + return 0;
1.126 + }
1.127 +
1.128 +TInt CUnderflowAutoStopControlTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
1.129 + {
1.130 + return 0;
1.131 + }
1.132 +
1.133 +TInt CUnderflowAutoStopControlTestDevice::StopAndDeleteCodec()
1.134 + {
1.135 + return 0;
1.136 + }
1.137 +
1.138 +TInt CUnderflowAutoStopControlTestDevice::DeleteCodec()
1.139 + {
1.140 + return 0;
1.141 + }
1.142 +
1.143 +CMMFSwCodec& CUnderflowAutoStopControlTestDevice::Codec()
1.144 + {
1.145 + return *iCodec;
1.146 + }
1.147 +
1.148 +TInt CUnderflowAutoStopControlTestDevice::MmuascTurnOffUnderflowAutoStop()
1.149 + {
1.150 + TInt result = KErrBadHandle;
1.151 +
1.152 + if (iUnderflowAutoStopCtrl)
1.153 + {
1.154 + result = iUnderflowAutoStopCtrl->MmuascTurnOffUnderflowAutoStop();
1.155 + }
1.156 +
1.157 + return result;
1.158 + }