os/boardsupport/haitest/bspsvs/suite/bsp/sound/inc/t_mdadevsounddata.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
/**
sl@0
    19
@test
sl@0
    20
@internalComponent
sl@0
    21
sl@0
    22
This contains CT_MdaDevSoundData
sl@0
    23
*/
sl@0
    24
sl@0
    25
#if (!defined __T_MDADEVSOUND_DATA_H__)
sl@0
    26
#define __T_MDADEVSOUND_DATA_H__
sl@0
    27
sl@0
    28
//	User Includes
sl@0
    29
#include "DataWrapperBase.h"
sl@0
    30
#include "sound_util.h"
sl@0
    31
#include "t_soundactivecallback.h"
sl@0
    32
sl@0
    33
//	EPOC includes
sl@0
    34
#include <mdasound.h>
sl@0
    35
#include <e32twin.h>
sl@0
    36
sl@0
    37
/**
sl@0
    38
 * Class to wrap RMdaDevSound APIs.
sl@0
    39
 *
sl@0
    40
 */
sl@0
    41
class CT_MdaDevSoundData: public CDataWrapperBase
sl@0
    42
	{
sl@0
    43
public:
sl@0
    44
	/**
sl@0
    45
	* Two phase constructor
sl@0
    46
	*
sl@0
    47
	* @leave	system wide error
sl@0
    48
	*/
sl@0
    49
	static CT_MdaDevSoundData*	NewL(RMdaDevSound* aServerStore);
sl@0
    50
	/**
sl@0
    51
	* Public destructor
sl@0
    52
	*/
sl@0
    53
	~CT_MdaDevSoundData();
sl@0
    54
sl@0
    55
	/**
sl@0
    56
	* Process a command read from the ini file
sl@0
    57
	*
sl@0
    58
	* @param	aCommand requiring command to be processed
sl@0
    59
	* @param	aSection the section in the ini file requiring the command to be processed
sl@0
    60
	* @param	aAsyncErrorIndex the index of asynchronous command error code belongs to.
sl@0
    61
	* 
sl@0
    62
	* @leave	system wide error
sl@0
    63
	*
sl@0
    64
	* @return	ETrue if the command is processed
sl@0
    65
	*/
sl@0
    66
	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
sl@0
    67
sl@0
    68
	/**
sl@0
    69
	* Return a pointer to the object that the data wraps
sl@0
    70
	*
sl@0
    71
	* @return	pointer to the object that the data wraps
sl@0
    72
	*/
sl@0
    73
	virtual TAny*	GetObject();
sl@0
    74
	virtual void	SetObjectL(TAny* aAny);
sl@0
    75
	virtual void	DisownObjectL();
sl@0
    76
sl@0
    77
	inline virtual 	TCleanupOperation CleanupOperation();
sl@0
    78
sl@0
    79
	/**
sl@0
    80
	* Query to see if there are any outstanding requests
sl@0
    81
	*
sl@0
    82
	* @return ETrue if there are any outstanding requests
sl@0
    83
	*/
sl@0
    84
	
sl@0
    85
	void RunL(CActive* aActive, TInt aIndex);
sl@0
    86
	void DoCancel(CActive* aActive, TInt aIndex);
sl@0
    87
sl@0
    88
protected:
sl@0
    89
	/**
sl@0
    90
	* Protected constructor. First phase construction
sl@0
    91
	*/
sl@0
    92
	CT_MdaDevSoundData(RMdaDevSound* aServerStore);
sl@0
    93
	/**
sl@0
    94
	* Second phase construction
sl@0
    95
	*/
sl@0
    96
	void ConstructL();
sl@0
    97
sl@0
    98
private:
sl@0
    99
	static void CleanupOperation( TAny* aAny );
sl@0
   100
sl@0
   101
	/**
sl@0
   102
	* General commands
sl@0
   103
	*/
sl@0
   104
	void	DoCmdNewL();
sl@0
   105
	void	DoCmdOpen(const TDesC& aSection);
sl@0
   106
	void	DoCmdClose();
sl@0
   107
	void	DoCmdDestructor();
sl@0
   108
	void	DoCmdIsMdaSound();
sl@0
   109
	void	DoCmdVersionRequired(const TDesC& aSection);
sl@0
   110
sl@0
   111
	/**
sl@0
   112
	* Playback commands
sl@0
   113
	*/
sl@0
   114
	void	DoCmdPlayVolume(const TDesC& aSection);
sl@0
   115
	void	DoCmdSetPlayVolume(const TDesC& aSection);
sl@0
   116
	void	DoCmdPlayDataL(const TDesC& aSection, const TInt aAsyncErrorIndex);
sl@0
   117
	void	DoCmdCancelPlayData();
sl@0
   118
	void	DoCmdFlushPlayBuffer();
sl@0
   119
	void	DoCmdNotifyPlayErrorL(const TInt aAsyncErrorIndex);
sl@0
   120
	void	DoCmdCancelNotifyPlayError();
sl@0
   121
	void	DoCmdBytesPlayed(const TDesC& aSection);
sl@0
   122
	void	DoCmdResetBytesPlayed();
sl@0
   123
	void	DoCmdPausePlayBuffer();
sl@0
   124
	void	DoCmdResumePlaying();
sl@0
   125
sl@0
   126
	/**
sl@0
   127
	* Recording commands
sl@0
   128
	*/
sl@0
   129
	void	DoCmdRecordDataL(const TDesC& aSection, const TInt aAsyncErrorIndex);
sl@0
   130
	void	DoCmdCancelRecordData();
sl@0
   131
	void	DoCmdFlushRecordBuffer();
sl@0
   132
	void	DoCmdRecordLevel(const TDesC& aSection);	
sl@0
   133
	void	DoCmdSetRecordLevel(const TDesC& aSection);
sl@0
   134
	void	DoCmdNotifyRecordErrorL(const TInt aAsyncErrorIndex);
sl@0
   135
	void	DoCmdCancelNotifyRecordError();
sl@0
   136
	
sl@0
   137
	/**
sl@0
   138
	* Format commands
sl@0
   139
	*/
sl@0
   140
	void	DoCmdPlayFormatsSupportedL(const TDesC& aSection);
sl@0
   141
	void	DoCmdGetPlayFormatL(const TDesC& aSection);
sl@0
   142
	void	DoCmdSetPlayFormatL(const TDesC& aSection);
sl@0
   143
	void	DoCmdRecordFormatsSupportedL(const TDesC& aSection);
sl@0
   144
	void	DoCmdGetRecordFormatL(const TDesC& aSection);
sl@0
   145
	void	DoCmdSetRecordFormatL(const TDesC& aSection);
sl@0
   146
	
sl@0
   147
	/**
sl@0
   148
	* Utility commands
sl@0
   149
	*/
sl@0
   150
	void DoCmdUtilityLoadDrivers(const TDesC& aSection);
sl@0
   151
	void DoCmdUtilityFreeDrivers(const TDesC& aSection);
sl@0
   152
	void DoCmdUtilityDeleteFileL(const TDesC& aSection);
sl@0
   153
sl@0
   154
	/**
sl@0
   155
	* Helper commands
sl@0
   156
	*/
sl@0
   157
	void	DoCleanup();
sl@0
   158
	
sl@0
   159
sl@0
   160
private:
sl@0
   161
	/** RMdaDevSound class instance that is tested */
sl@0
   162
	RMdaDevSound*										iMdaDevSound;
sl@0
   163
	
sl@0
   164
	/** Reference to RMdaDevSound object stored on server side */
sl@0
   165
	RMdaDevSound* 										iServerStore;
sl@0
   166
sl@0
   167
	/** The request status for playback errors */
sl@0
   168
	RPointerArray<CActiveCallback>						iNotifyPlayError;
sl@0
   169
sl@0
   170
	/** The request status for recording errors */
sl@0
   171
	RPointerArray<CActiveCallback>						iNotifyRecordError;
sl@0
   172
sl@0
   173
	/** The request status for sound playback */
sl@0
   174
	RPointerArray<CT_SoundActiveCallback>				iPlay;
sl@0
   175
sl@0
   176
	/** The request status for sound recording */
sl@0
   177
	RPointerArray<CT_SoundActiveCallback>				iRecord;
sl@0
   178
	};
sl@0
   179
sl@0
   180
#define GET_MANDATORY_STRING_PARAMETER(aParamName, aSection, aResult)		GetCommandStringParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
sl@0
   181
#define GET_MANDATORY_INT_PARAMETER(aParamName, aSection, aResult)		GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
sl@0
   182
#define GET_MANDATORY_INT64_PARAMETER(aParamName, aSection, aResult)		GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
sl@0
   183
#define GET_MANDATORY_BOOL_PARAMETER(aParamName, aSection, aResult)		GetCommandBoolParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
sl@0
   184
sl@0
   185
#define GET_OPTIONAL_STRING_PARAMETER(aParamName, aSection, aResult)		GetCommandStringParameter(aParamName, aSection, aResult, (TText8*) __FILE__, __LINE__, EFalse)
sl@0
   186
#define GET_OPTIONAL_INT_PARAMETER(aParamName, aSection, aResult)		GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
sl@0
   187
#define GET_OPTIONAL_INT64_PARAMETER(aParamName, aSection, aResult)		GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
sl@0
   188
#define GET_OPTIONAL_BOOL_PARAMETER(aParamName, aSection, aResult)		GetCommandBoolParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
sl@0
   189
sl@0
   190
#endif /* __T_MDADEVSOUND_DATA_H__ */