os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/a3fcistubextn/a3fcistubextn.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/a3fcistubextn/a3fcistubextn.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,131 @@
     1.4 +// Copyright (c) 2005-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 +#ifndef A3FCISTUBEXTN_H
    1.20 +#define A3FCISTUBEXTN_H
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <a3f/mmfdevsoundcustominterfaceextensions.h>
    1.24 +
    1.25 +#include <a3f/maudiocontext.h>
    1.26 +#include <a3f/maudiocontextobserver.h>
    1.27 +
    1.28 +#include "testsetvol.h"
    1.29 +
    1.30 +class CSetVol;
    1.31 +
    1.32 +enum TSetVolCommands
    1.33 +    {
    1.34 +    ETestSetVolIfSetVolCommand,
    1.35 +    ETestSetVolIfVolCommand,
    1.36 +    };
    1.37 +
    1.38 +/**
    1.39 +*
    1.40 +* CA3fClientCiStubExtn
    1.41 +*
    1.42 +* stub version of MDevSoundCIClientExtension 
    1.43 +* Always fails to open CIs, but simulates presence of object
    1.44 +*/
    1.45 +
    1.46 +class CA3fClientCiStubExtn : public CBase,
    1.47 +			   		   		 public MDevSoundCIClientExtension,
    1.48 +			   		   		 public MTestSetVolIf
    1.49 +			      	 					
    1.50 +	{
    1.51 +public:
    1.52 +	static MDevSoundCIClientExtension* NewL();
    1.53 +	~CA3fClientCiStubExtn();
    1.54 +
    1.55 +protected:	
    1.56 +	// from MDevSoundCIClientExtension
    1.57 +	TInt Setup(MCustomCommand& aCustomCommand);
    1.58 +	TInt CustomInterfaceExtension(TUid aUid, TAny*& aInterface);
    1.59 +	void Release();
    1.60 +	void PassDestructorKey(TUid aDestructorKey);
    1.61 +	
    1.62 +	// from MTestSetVolIf
    1.63 +	TInt SetVol(TInt aVolume);
    1.64 +	TInt Vol(TInt aMaxVolume);
    1.65 +	
    1.66 +protected:
    1.67 +	TUid iKey;
    1.68 +	MCustomCommand* iCommand; // not owned
    1.69 +	HBufC* iDummyBuffer;
    1.70 +	};
    1.71 +
    1.72 +
    1.73 +/**
    1.74 +*
    1.75 +* CA3fServerCiStubExtn
    1.76 +*
    1.77 +* stub version of MDevSoundCIServerExtension 
    1.78 +* Always fails to open CIs, but simulates presence of object
    1.79 +*/
    1.80 +
    1.81 +class CA3fServerCiStubExtn : public CBase,
    1.82 +			   		   		 public MDevSoundCIServerExtension
    1.83 +			      	 					
    1.84 +	{
    1.85 +public:
    1.86 +	static MDevSoundCIServerExtension* NewL();
    1.87 +	~CA3fServerCiStubExtn();
    1.88 +
    1.89 +protected:	
    1.90 +	// from MDevSoundCIServerExtension
    1.91 +	TInt Setup(MCustomInterface& aInterface);
    1.92 +	TInt HandleMessageL(const RMmfIpcMessage& aMessage);
    1.93 +	void Release();
    1.94 +	void PassDestructorKey(TUid aDestructorKey);
    1.95 +	
    1.96 +protected:
    1.97 +	TUid iKey;
    1.98 +	MCustomInterface* iInterface; // not owned
    1.99 +	HBufC* iDummyBuffer;
   1.100 +	CSetVol* iSetVol;
   1.101 +	};
   1.102 +	
   1.103 +// CAVEAT - for testing only
   1.104 +class CSetVol : public CBase,
   1.105 +				public MAudioContextObserver
   1.106 +	{
   1.107 +public:
   1.108 +	static CSetVol* NewL(MCustomInterface& aCustomInterface);
   1.109 +	~CSetVol();
   1.110 +
   1.111 +	TInt HandleMessageL(const RMmfIpcMessage& aMessage);
   1.112 +	
   1.113 +	// from MAudioContextObserver
   1.114 +	void ContextEvent(TUid aEvent, TInt aError);
   1.115 +	
   1.116 +private:
   1.117 +	CSetVol(MCustomInterface& aCustomInterface);
   1.118 +	void ConstructL();
   1.119 +	
   1.120 +	void UpdateA3fPointers();
   1.121 +	void SetVolumeL(TInt aVol);
   1.122 +	TInt VolumeL(TInt aMaxVolume);
   1.123 +	
   1.124 +	MCustomInterface* iInterface; // not owned
   1.125 +	MAudioContext* iContext;
   1.126 +	MAudioStream* iStream;
   1.127 +	MAudioProcessingUnit* iGain;
   1.128 +	
   1.129 +	CActiveSchedulerWait* iWait;
   1.130 +	TInt iError;
   1.131 +	};
   1.132 +
   1.133 +
   1.134 +#endif