devsound/devsoundrefplugin/tsrc/DevsoundTestDevice/TSU_MMF_DEVSOUND_TestDevice.cpp
changeset 0 79dd3e2336a0
equal deleted inserted replaced
-1:000000000000 0:79dd3e2336a0
       
     1 /*
       
     2 * Copyright (c) 2004 - 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "TSU_MMF_DEVSOUND_TestDevice.h"
       
    20 #include "TSU_MMF_DEVSOUND_TESTDEVICE_ImplementationUID.hrh"
       
    21 #include <ecom/implementationproxy.h>
       
    22 #include <ecom/ecom.h>
       
    23 
       
    24 // __________________________________________________________________________
       
    25 // Implementation
       
    26 
       
    27 CMMFHwDevice* CMMF_TSU_DEVSOUND_TestDevice::NewL()
       
    28 	{
       
    29 	CMMF_TSU_DEVSOUND_TestDevice* self=new(ELeave) CMMF_TSU_DEVSOUND_TestDevice();
       
    30 	CleanupStack::PushL(self);
       
    31 	self->ConstructL();
       
    32 	CleanupStack::Pop(self);
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 CMMF_TSU_DEVSOUND_TestDevice::~CMMF_TSU_DEVSOUND_TestDevice()
       
    37 	{
       
    38 	delete iDummyInterface;
       
    39 	}
       
    40 
       
    41 CMMF_TSU_DEVSOUND_TestDevice::CMMF_TSU_DEVSOUND_TestDevice()
       
    42 	{
       
    43 	}
       
    44 
       
    45 /**
       
    46 *
       
    47 *
       
    48 */
       
    49 void CMMF_TSU_DEVSOUND_TestDevice::ConstructL()
       
    50 	{
       
    51 	}
       
    52 	
       
    53 
       
    54 TInt CMMF_TSU_DEVSOUND_TestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/) 
       
    55 	{
       
    56 	return 0;
       
    57 	}
       
    58 	
       
    59 
       
    60 TInt CMMF_TSU_DEVSOUND_TestDevice::Stop()
       
    61 	{
       
    62 	return 0;
       
    63 	}
       
    64 	
       
    65 
       
    66 TInt CMMF_TSU_DEVSOUND_TestDevice::Pause()
       
    67 	{
       
    68 	return 0;
       
    69 	}
       
    70 
       
    71 		
       
    72 TInt CMMF_TSU_DEVSOUND_TestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
       
    73 	{
       
    74 	return 0;
       
    75 	}
       
    76 	
       
    77 	
       
    78 TAny* CMMF_TSU_DEVSOUND_TestDevice::CustomInterface(TUid aInterfaceId)
       
    79 	{	
       
    80 	if(aInterfaceId == KUidHwDeviceSetupInterface)
       
    81 		{
       
    82 		// For MDF		
       
    83 		MMdfHwDeviceSetup* setup = static_cast<MMdfHwDeviceSetup*>(this);
       
    84 		return setup;
       
    85 		}
       
    86 	
       
    87 	TAny* ret = NULL;
       
    88 	if (!iDummyInterface)
       
    89 		{
       
    90 		iDummyInterface = new TDummyCustomInterface();
       
    91 		if (!iDummyInterface)
       
    92 			{
       
    93 			ret = NULL;
       
    94 			}			
       
    95 		else
       
    96 			{
       
    97 			ret = static_cast<TAny*>(iDummyInterface);
       
    98 			}			
       
    99 		}
       
   100 	else
       
   101 		{
       
   102 		ret = static_cast<TAny*>(iDummyInterface);
       
   103 		}
       
   104 	return ret;
       
   105 	}
       
   106 
       
   107 	
       
   108 TInt CMMF_TSU_DEVSOUND_TestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
       
   109 	{
       
   110 	return 0;
       
   111 	}
       
   112 	
       
   113 	
       
   114 TInt CMMF_TSU_DEVSOUND_TestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
       
   115 	{
       
   116 	return 0;
       
   117 	}
       
   118 	
       
   119 	
       
   120 TInt CMMF_TSU_DEVSOUND_TestDevice::SetConfig(TTaskConfig& /*aConfig*/)
       
   121 	{
       
   122 	return 0;
       
   123 	}
       
   124 	
       
   125 	
       
   126 TInt CMMF_TSU_DEVSOUND_TestDevice::StopAndDeleteCodec()
       
   127 	{
       
   128 	return 0;
       
   129 	}
       
   130 	
       
   131 	
       
   132 TInt CMMF_TSU_DEVSOUND_TestDevice::DeleteCodec()
       
   133 	{
       
   134 	return 0;
       
   135 	}
       
   136 
       
   137 // From MMdfHwDeviceSetup
       
   138 void CMMF_TSU_DEVSOUND_TestDevice::SetDataTypesL(TFourCC /*aSrcType*/, TFourCC /*aDestType*/)
       
   139 	{
       
   140 	}
       
   141 
       
   142 
       
   143 /////////
       
   144 CTestAudioHwDevice* CTestAudioHwDevice::NewL()
       
   145 	{
       
   146 	CTestAudioHwDevice* self = new(ELeave)CTestAudioHwDevice();
       
   147 	CleanupStack::PushL(self);
       
   148 	self->ConstructL();
       
   149 	CleanupStack::Pop(self);
       
   150 	return self;
       
   151 	}
       
   152 
       
   153 void CTestAudioHwDevice::ConstructL()
       
   154 	{
       
   155 	iCodec = new(ELeave)CMMFTestCodec();
       
   156 	}
       
   157 
       
   158 CMMFSwCodec& CTestAudioHwDevice::Codec()
       
   159 	{
       
   160 	return *iCodec;
       
   161 	}
       
   162 
       
   163 TInt CTestAudioHwDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
       
   164 	{
       
   165 	return KErrAbort;
       
   166 	}
       
   167 
       
   168 TInt CTestAudioHwDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
       
   169 	{
       
   170 	return KErrAbort;
       
   171 	}
       
   172 
       
   173 CMMFSwCodec::TCodecProcessResult CMMFTestCodec::ProcessL(const CMMFBuffer& /*aSource*/, CMMFBuffer& /*aDest*/)
       
   174 	{
       
   175 	return CMMFSwCodec::TCodecProcessResult();
       
   176 	}
       
   177 TUint CMMFTestCodec::SourceBufferSize()
       
   178 	{
       
   179 	return KSourceBufferSize;
       
   180 	}
       
   181 
       
   182 TUint CMMFTestCodec::SinkBufferSize()
       
   183 	{
       
   184 	return KSinkBufferSize;
       
   185 	}
       
   186 ///////////////
       
   187 CTestAudioHwDevice2* CTestAudioHwDevice2::NewL()
       
   188 	{
       
   189 	CTestAudioHwDevice2* self = new(ELeave)CTestAudioHwDevice2();
       
   190 	CleanupStack::PushL(self);
       
   191 	self->ConstructL();
       
   192 	CleanupStack::Pop(self);
       
   193 	return self;
       
   194 	}
       
   195 	
       
   196 void CTestAudioHwDevice2::ConstructL()
       
   197 	{
       
   198 	iCodec = new(ELeave)CMMFTestCodec();
       
   199 	}
       
   200 	
       
   201 CMMFSwCodec& CTestAudioHwDevice2::Codec()
       
   202 	{
       
   203 	return *iCodec;
       
   204 	}
       
   205 
       
   206 TInt CTestAudioHwDevice2::SetConfig(TTaskConfig& /*aConfig*/)
       
   207 	{
       
   208 	return KErrAbort;
       
   209 	}
       
   210 //////////////////////////////
       
   211 CTestAudioHwDevice3* CTestAudioHwDevice3::NewL()
       
   212 	{
       
   213 	CTestAudioHwDevice3* self = new(ELeave)CTestAudioHwDevice3();
       
   214 	CleanupStack::PushL(self);
       
   215 	self->ConstructL();
       
   216 	CleanupStack::Pop(self);
       
   217 	return self;
       
   218 	}
       
   219 
       
   220 void CTestAudioHwDevice3::ConstructL()
       
   221 	{
       
   222 	iCodec = new(ELeave)CMMFTestCodec();
       
   223 	}
       
   224 
       
   225 CMMFSwCodec& CTestAudioHwDevice3::Codec()
       
   226 	{
       
   227 	return *iCodec;
       
   228 	}
       
   229 
       
   230 TInt CTestAudioHwDevice3::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
       
   231 	{
       
   232 	return KErrAbort;
       
   233 	}
       
   234 
       
   235 /////////////////////////////////
       
   236 const TImplementationProxy ImplementationTable[] = 
       
   237 	{
       
   238 	IMPLEMENTATION_PROXY_ENTRY(KMmfUidTestHwDevice,	CMMF_TSU_DEVSOUND_TestDevice::NewL),
       
   239 	IMPLEMENTATION_PROXY_ENTRY(0x102834C3,	CTestAudioHwDevice::NewL),
       
   240 	IMPLEMENTATION_PROXY_ENTRY(0x10286461,	CTestAudioHwDevice::NewL),
       
   241 	IMPLEMENTATION_PROXY_ENTRY(0x102834C4,	CTestAudioHwDevice2::NewL),
       
   242 	IMPLEMENTATION_PROXY_ENTRY(0x10286462,	CTestAudioHwDevice2::NewL),
       
   243 	IMPLEMENTATION_PROXY_ENTRY(0x102834C5,	CTestAudioHwDevice3::NewL),
       
   244 	IMPLEMENTATION_PROXY_ENTRY(0x10286463,	CTestAudioHwDevice3::NewL)
       
   245 	};
       
   246 
       
   247 
       
   248 
       
   249 
       
   250 
       
   251 //
       
   252 // ImplementationGroupProxy
       
   253 //
       
   254 ////////////////////////////////////////////////////////////////////////////////
       
   255 
       
   256 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   257 	{
       
   258 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
   259 
       
   260 	return ImplementationTable;
       
   261 	}
       
   262 
       
   263