os/boardsupport/haitest/bspsvs/suite/bsp/sound/inc/t_mdadevsounddata.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/bsp/sound/inc/t_mdadevsounddata.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,190 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +/**
    1.22 +@test
    1.23 +@internalComponent
    1.24 +
    1.25 +This contains CT_MdaDevSoundData
    1.26 +*/
    1.27 +
    1.28 +#if (!defined __T_MDADEVSOUND_DATA_H__)
    1.29 +#define __T_MDADEVSOUND_DATA_H__
    1.30 +
    1.31 +//	User Includes
    1.32 +#include "DataWrapperBase.h"
    1.33 +#include "sound_util.h"
    1.34 +#include "t_soundactivecallback.h"
    1.35 +
    1.36 +//	EPOC includes
    1.37 +#include <mdasound.h>
    1.38 +#include <e32twin.h>
    1.39 +
    1.40 +/**
    1.41 + * Class to wrap RMdaDevSound APIs.
    1.42 + *
    1.43 + */
    1.44 +class CT_MdaDevSoundData: public CDataWrapperBase
    1.45 +	{
    1.46 +public:
    1.47 +	/**
    1.48 +	* Two phase constructor
    1.49 +	*
    1.50 +	* @leave	system wide error
    1.51 +	*/
    1.52 +	static CT_MdaDevSoundData*	NewL(RMdaDevSound* aServerStore);
    1.53 +	/**
    1.54 +	* Public destructor
    1.55 +	*/
    1.56 +	~CT_MdaDevSoundData();
    1.57 +
    1.58 +	/**
    1.59 +	* Process a command read from the ini file
    1.60 +	*
    1.61 +	* @param	aCommand requiring command to be processed
    1.62 +	* @param	aSection the section in the ini file requiring the command to be processed
    1.63 +	* @param	aAsyncErrorIndex the index of asynchronous command error code belongs to.
    1.64 +	* 
    1.65 +	* @leave	system wide error
    1.66 +	*
    1.67 +	* @return	ETrue if the command is processed
    1.68 +	*/
    1.69 +	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
    1.70 +
    1.71 +	/**
    1.72 +	* Return a pointer to the object that the data wraps
    1.73 +	*
    1.74 +	* @return	pointer to the object that the data wraps
    1.75 +	*/
    1.76 +	virtual TAny*	GetObject();
    1.77 +	virtual void	SetObjectL(TAny* aAny);
    1.78 +	virtual void	DisownObjectL();
    1.79 +
    1.80 +	inline virtual 	TCleanupOperation CleanupOperation();
    1.81 +
    1.82 +	/**
    1.83 +	* Query to see if there are any outstanding requests
    1.84 +	*
    1.85 +	* @return ETrue if there are any outstanding requests
    1.86 +	*/
    1.87 +	
    1.88 +	void RunL(CActive* aActive, TInt aIndex);
    1.89 +	void DoCancel(CActive* aActive, TInt aIndex);
    1.90 +
    1.91 +protected:
    1.92 +	/**
    1.93 +	* Protected constructor. First phase construction
    1.94 +	*/
    1.95 +	CT_MdaDevSoundData(RMdaDevSound* aServerStore);
    1.96 +	/**
    1.97 +	* Second phase construction
    1.98 +	*/
    1.99 +	void ConstructL();
   1.100 +
   1.101 +private:
   1.102 +	static void CleanupOperation( TAny* aAny );
   1.103 +
   1.104 +	/**
   1.105 +	* General commands
   1.106 +	*/
   1.107 +	void	DoCmdNewL();
   1.108 +	void	DoCmdOpen(const TDesC& aSection);
   1.109 +	void	DoCmdClose();
   1.110 +	void	DoCmdDestructor();
   1.111 +	void	DoCmdIsMdaSound();
   1.112 +	void	DoCmdVersionRequired(const TDesC& aSection);
   1.113 +
   1.114 +	/**
   1.115 +	* Playback commands
   1.116 +	*/
   1.117 +	void	DoCmdPlayVolume(const TDesC& aSection);
   1.118 +	void	DoCmdSetPlayVolume(const TDesC& aSection);
   1.119 +	void	DoCmdPlayDataL(const TDesC& aSection, const TInt aAsyncErrorIndex);
   1.120 +	void	DoCmdCancelPlayData();
   1.121 +	void	DoCmdFlushPlayBuffer();
   1.122 +	void	DoCmdNotifyPlayErrorL(const TInt aAsyncErrorIndex);
   1.123 +	void	DoCmdCancelNotifyPlayError();
   1.124 +	void	DoCmdBytesPlayed(const TDesC& aSection);
   1.125 +	void	DoCmdResetBytesPlayed();
   1.126 +	void	DoCmdPausePlayBuffer();
   1.127 +	void	DoCmdResumePlaying();
   1.128 +
   1.129 +	/**
   1.130 +	* Recording commands
   1.131 +	*/
   1.132 +	void	DoCmdRecordDataL(const TDesC& aSection, const TInt aAsyncErrorIndex);
   1.133 +	void	DoCmdCancelRecordData();
   1.134 +	void	DoCmdFlushRecordBuffer();
   1.135 +	void	DoCmdRecordLevel(const TDesC& aSection);	
   1.136 +	void	DoCmdSetRecordLevel(const TDesC& aSection);
   1.137 +	void	DoCmdNotifyRecordErrorL(const TInt aAsyncErrorIndex);
   1.138 +	void	DoCmdCancelNotifyRecordError();
   1.139 +	
   1.140 +	/**
   1.141 +	* Format commands
   1.142 +	*/
   1.143 +	void	DoCmdPlayFormatsSupportedL(const TDesC& aSection);
   1.144 +	void	DoCmdGetPlayFormatL(const TDesC& aSection);
   1.145 +	void	DoCmdSetPlayFormatL(const TDesC& aSection);
   1.146 +	void	DoCmdRecordFormatsSupportedL(const TDesC& aSection);
   1.147 +	void	DoCmdGetRecordFormatL(const TDesC& aSection);
   1.148 +	void	DoCmdSetRecordFormatL(const TDesC& aSection);
   1.149 +	
   1.150 +	/**
   1.151 +	* Utility commands
   1.152 +	*/
   1.153 +	void DoCmdUtilityLoadDrivers(const TDesC& aSection);
   1.154 +	void DoCmdUtilityFreeDrivers(const TDesC& aSection);
   1.155 +	void DoCmdUtilityDeleteFileL(const TDesC& aSection);
   1.156 +
   1.157 +	/**
   1.158 +	* Helper commands
   1.159 +	*/
   1.160 +	void	DoCleanup();
   1.161 +	
   1.162 +
   1.163 +private:
   1.164 +	/** RMdaDevSound class instance that is tested */
   1.165 +	RMdaDevSound*										iMdaDevSound;
   1.166 +	
   1.167 +	/** Reference to RMdaDevSound object stored on server side */
   1.168 +	RMdaDevSound* 										iServerStore;
   1.169 +
   1.170 +	/** The request status for playback errors */
   1.171 +	RPointerArray<CActiveCallback>						iNotifyPlayError;
   1.172 +
   1.173 +	/** The request status for recording errors */
   1.174 +	RPointerArray<CActiveCallback>						iNotifyRecordError;
   1.175 +
   1.176 +	/** The request status for sound playback */
   1.177 +	RPointerArray<CT_SoundActiveCallback>				iPlay;
   1.178 +
   1.179 +	/** The request status for sound recording */
   1.180 +	RPointerArray<CT_SoundActiveCallback>				iRecord;
   1.181 +	};
   1.182 +
   1.183 +#define GET_MANDATORY_STRING_PARAMETER(aParamName, aSection, aResult)		GetCommandStringParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
   1.184 +#define GET_MANDATORY_INT_PARAMETER(aParamName, aSection, aResult)		GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
   1.185 +#define GET_MANDATORY_INT64_PARAMETER(aParamName, aSection, aResult)		GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
   1.186 +#define GET_MANDATORY_BOOL_PARAMETER(aParamName, aSection, aResult)		GetCommandBoolParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
   1.187 +
   1.188 +#define GET_OPTIONAL_STRING_PARAMETER(aParamName, aSection, aResult)		GetCommandStringParameter(aParamName, aSection, aResult, (TText8*) __FILE__, __LINE__, EFalse)
   1.189 +#define GET_OPTIONAL_INT_PARAMETER(aParamName, aSection, aResult)		GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
   1.190 +#define GET_OPTIONAL_INT64_PARAMETER(aParamName, aSection, aResult)		GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
   1.191 +#define GET_OPTIONAL_BOOL_PARAMETER(aParamName, aSection, aResult)		GetCommandBoolParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
   1.192 +
   1.193 +#endif /* __T_MDADEVSOUND_DATA_H__ */