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