os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/underflowautostopcontroltestdevice.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include <ecom/implementationproxy.h>
    17 #include <ecom/ecom.h>
    18 #include <f32file.h>
    19 #include "underflowautostopcontroltestdevice.h"
    20 #include "devsoundciutestdevices.hrh"
    21 
    22 
    23 /*
    24 CMMFUnderflowAutoStopControl implementation
    25 */
    26 CMMFUnderflowAutoStopControl* CMMFUnderflowAutoStopControl::NewL()
    27 	{
    28 	CMMFUnderflowAutoStopControl* self = new(ELeave) CMMFUnderflowAutoStopControl();
    29 	return self;
    30 	}
    31 
    32 CMMFUnderflowAutoStopControl::~CMMFUnderflowAutoStopControl()
    33 	{
    34 	}
    35 
    36 // Actual implementation of method
    37 TInt CMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop()
    38 	{
    39 	return KErrNone;
    40 	}
    41 
    42 
    43 /*
    44 CUnderflowAutoStopControlTestDevice Implementation
    45 */
    46 CMMFHwDevice* CUnderflowAutoStopControlTestDevice::NewL()
    47 	{
    48 	CUnderflowAutoStopControlTestDevice* self=new(ELeave) CUnderflowAutoStopControlTestDevice();
    49 	CleanupStack::PushL(self);
    50 	self->ConstructL();
    51 	CleanupStack::Pop(self);
    52 	return self;
    53 	}
    54 
    55 CUnderflowAutoStopControlTestDevice::~CUnderflowAutoStopControlTestDevice()
    56 	{
    57 	delete iUnderflowAutoStopCtrl;
    58 	}
    59 
    60 CUnderflowAutoStopControlTestDevice::CUnderflowAutoStopControlTestDevice()
    61 	{
    62 	}
    63 
    64 void CUnderflowAutoStopControlTestDevice::ConstructL()
    65 	{
    66 	}
    67 
    68 TInt CUnderflowAutoStopControlTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/) 
    69 	{
    70 	return 0;
    71 	}
    72 
    73 TInt CUnderflowAutoStopControlTestDevice::Stop()
    74 	{
    75 	return 0;
    76 	}
    77 
    78 TInt CUnderflowAutoStopControlTestDevice::Pause()
    79 	{
    80 	return 0;
    81 	}
    82 
    83 TInt CUnderflowAutoStopControlTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
    84 	{
    85 	return 0;
    86 	}
    87 
    88 TAny* CUnderflowAutoStopControlTestDevice::CustomInterface(TUid aInterfaceId)
    89 	{
    90 	// Just return something non-NULL to keep the
    91 	// DevSound initialisation process happy
    92 	TAny* ret = static_cast<TAny*>(this);
    93 
    94 	// Now for the CIs we want to test...
    95 	if (aInterfaceId == KUidUnderflowAutoStopControl)
    96 		{
    97 		if (!iUnderflowAutoStopCtrl)
    98 			{
    99 			TRAPD(err, iUnderflowAutoStopCtrl = CMMFUnderflowAutoStopControl::NewL());
   100 			if (err == KErrNone && iUnderflowAutoStopCtrl)
   101 				{
   102 				MMMFUnderflowAutoStopControl* ptr = this;
   103 				ret = static_cast<TAny*>(ptr);
   104 				}
   105 			else
   106 				{
   107 				ret = NULL;
   108 				}
   109 			}
   110 		}
   111 
   112 	return ret;
   113 	}
   114 
   115 TInt CUnderflowAutoStopControlTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
   116 	{
   117 	return 0;
   118 	}
   119 
   120 TInt CUnderflowAutoStopControlTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
   121 	{
   122 	return 0;
   123 	}
   124 
   125 TInt CUnderflowAutoStopControlTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
   126 	{
   127 	return 0;
   128 	}
   129 
   130 TInt CUnderflowAutoStopControlTestDevice::StopAndDeleteCodec()
   131 	{
   132 	return 0;
   133 	}
   134 
   135 TInt CUnderflowAutoStopControlTestDevice::DeleteCodec()
   136 	{
   137 	return 0;
   138 	}
   139 
   140 CMMFSwCodec& CUnderflowAutoStopControlTestDevice::Codec()
   141 	{
   142 	return *iCodec;
   143 	}
   144 
   145 TInt CUnderflowAutoStopControlTestDevice::MmuascTurnOffUnderflowAutoStop()
   146 	{
   147 	TInt result = KErrBadHandle;
   148 
   149 	if (iUnderflowAutoStopCtrl)
   150 		{
   151 		result = iUnderflowAutoStopCtrl->MmuascTurnOffUnderflowAutoStop();
   152 		}
   153 
   154 	return result;
   155 	}