os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/gsmconfigtestdevice.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 "gsmconfigtestdevice.h"
    20 #include "devsoundciutestdevices.hrh"
    21 
    22 
    23 /*
    24 CMMFGsmConfig implementation
    25 */
    26 CMMFGsmConfig* CMMFGsmConfig::NewL()
    27 	{
    28 	CMMFGsmConfig* self = new(ELeave) CMMFGsmConfig();
    29 	return self;
    30 	}
    31 
    32 CMMFGsmConfig::~CMMFGsmConfig()
    33 	{
    34 	}
    35 
    36 // Actual implementation of method
    37 TInt CMMFGsmConfig::SetConversionFormat(TMMFGsmConversionFormat aConvFormat)
    38 	{
    39 	iConvFormat = aConvFormat;
    40 	return KErrNone;
    41 	}
    42 
    43 // Actual implementation of method
    44 TInt CMMFGsmConfig::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const
    45 	{
    46 	aConvFormat = iConvFormat;
    47 	return KErrNone;
    48 	}
    49 
    50 
    51 /*
    52 CGsmConfigTestDevice Implementation
    53 */
    54 CMMFHwDevice* CGsmConfigTestDevice::NewL()
    55 	{
    56 	CGsmConfigTestDevice* self=new(ELeave) CGsmConfigTestDevice();
    57 	CleanupStack::PushL(self);
    58 	self->ConstructL();
    59 	CleanupStack::Pop(self);
    60 	return self;
    61 	}
    62 
    63 CGsmConfigTestDevice::~CGsmConfigTestDevice()
    64 	{
    65 	delete iGsmConfig;
    66 	}
    67 
    68 CGsmConfigTestDevice::CGsmConfigTestDevice()
    69 	{
    70 	}
    71 
    72 void CGsmConfigTestDevice::ConstructL()
    73 	{
    74 	}
    75 
    76 TInt CGsmConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/) 
    77 	{
    78 	return 0;
    79 	}
    80 
    81 TInt CGsmConfigTestDevice::Stop()
    82 	{
    83 	return 0;
    84 	}
    85 
    86 TInt CGsmConfigTestDevice::Pause()
    87 	{
    88 	return 0;
    89 	}
    90 
    91 TInt CGsmConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
    92 	{
    93 	return 0;
    94 	}
    95 
    96 TAny* CGsmConfigTestDevice::CustomInterface(TUid aInterfaceId)
    97 	{
    98 	// Just return something non-NULL to keep the
    99 	// DevSound initialisation process happy
   100 	TAny* ret = static_cast<TAny*>(this);
   101 
   102 	// Now for the CIs we want to test...
   103 	if (aInterfaceId == KUidGsmConfig)
   104 		{
   105 		if (!iGsmConfig)
   106 			{
   107 			TRAPD(err, iGsmConfig = CMMFGsmConfig::NewL());
   108 			if (err == KErrNone && iGsmConfig)
   109 				{
   110 				MMMFGsmConfig* ptr = this;
   111 				ret = static_cast<TAny*>(ptr);
   112 				}
   113 			else
   114 				{
   115 				ret = NULL;
   116 				}
   117 			}
   118 		}
   119 
   120 	return ret;
   121 	}
   122 
   123 TInt CGsmConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
   124 	{
   125 	return 0;
   126 	}
   127 
   128 TInt CGsmConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
   129 	{
   130 	return 0;
   131 	}
   132 
   133 TInt CGsmConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
   134 	{
   135 	return 0;
   136 	}
   137 
   138 TInt CGsmConfigTestDevice::StopAndDeleteCodec()
   139 	{
   140 	return 0;
   141 	}
   142 
   143 TInt CGsmConfigTestDevice::DeleteCodec()
   144 	{
   145 	return 0;
   146 	}
   147 
   148 CMMFSwCodec& CGsmConfigTestDevice::Codec()
   149 	{
   150 	return *iCodec;
   151 	}
   152 
   153 TInt CGsmConfigTestDevice::SetConversionFormat(TMMFGsmConversionFormat aConvFormat)
   154 	{
   155 	TInt result = KErrBadHandle;
   156 
   157 	if (iGsmConfig)
   158 		{
   159 		result = iGsmConfig->SetConversionFormat(aConvFormat);
   160 		}
   161 
   162 	return result;
   163 	}
   164 
   165 TInt CGsmConfigTestDevice::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const
   166 	{
   167 	TInt result = KErrBadHandle;
   168 
   169 	if (iGsmConfig)
   170 		{
   171 		result = iGsmConfig->ConversionFormat(aConvFormat);
   172 		}
   173 
   174 	return result;
   175 	}